From 76fde950c1ddbefa0a17918ce0ff2e27288d8374 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Mon, 21 Nov 2022 11:44:55 +0000 Subject: [PATCH] MDL-76398 reportbuilder: use improved action menu steps in Behat. Improved steps for using actions menus were added in 232ebac3, so make use of them here for consistency/reliability. --- reportbuilder/tests/behat/behat_reportbuilder.php | 8 ++++++-- reportbuilder/tests/behat/customreports.feature | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/reportbuilder/tests/behat/behat_reportbuilder.php b/reportbuilder/tests/behat/behat_reportbuilder.php index 10818fbc889..9db24f09a7e 100644 --- a/reportbuilder/tests/behat/behat_reportbuilder.php +++ b/reportbuilder/tests/behat/behat_reportbuilder.php @@ -109,7 +109,11 @@ class behat_reportbuilder extends behat_base { * @param string $row */ public function i_press_action_in_the_report_row(string $action, string $row): void { - $this->execute('behat_action_menu::i_open_the_action_menu_in', [$this->escape($row), 'table_row']); - $this->execute('behat_action_menu::i_choose_in_the_open_action_menu', [$this->escape($action)]); + $this->execute('behat_action_menu::i_choose_in_the_named_menu_in_container', [ + $this->escape($action), + get_string('actions', 'core_reportbuilder'), + $this->escape($row), + 'table_row', + ]); } } diff --git a/reportbuilder/tests/behat/customreports.feature b/reportbuilder/tests/behat/customreports.feature index 0be0833214f..b8c95377887 100644 --- a/reportbuilder/tests/behat/customreports.feature +++ b/reportbuilder/tests/behat/customreports.feature @@ -96,10 +96,9 @@ Feature: Manage custom reports And I click on "Close 'Manager report' editor" "button" # Manager can edit their own report, but not those of other users. And I set the field "Edit report name" in the "Manager report" "table_row" to "Manager report (renamed)" - And I open the action menu in "Manager report (renamed)" "table_row" - Then "Edit report content" "link" should be visible + Then the "Edit report content" item should exist in the "Actions" action menu of the "Manager report (renamed)" "table_row" And "Edit report name" "link" should not exist in the "My report" "table_row" - And ".dropdown-toggle" "css_element" should not exist in the "My report" "table_row" + And "Actions" "actionmenu" should not exist in the "My report" "table_row" Scenario: Rename custom report Given the following "core_reportbuilder > Reports" exist: