From b36bdd18d884e04ac479f77059b56e7735c35326 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 26 Aug 2021 09:58:15 +0800 Subject: [PATCH] MDL-69588 core: Activity navigation fixes --- mod/forum/tests/behat/behat_mod_forum.php | 6 +++--- mod/workshop/tests/behat/behat_mod_workshop.php | 4 ++-- report/competency/tests/behat/breakdown_by_activity.feature | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mod/forum/tests/behat/behat_mod_forum.php b/mod/forum/tests/behat/behat_mod_forum.php index f0244dea444..f6025b6ec62 100644 --- a/mod/forum/tests/behat/behat_mod_forum.php +++ b/mod/forum/tests/behat/behat_mod_forum.php @@ -113,7 +113,7 @@ class behat_mod_forum extends behat_base { */ public function i_reply_post_from_forum_using_an_inpage_reply_with($postsubject, $forumname, TableNode $table) { // Navigate to forum. - $this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($forumname)); + $this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']); $this->execute('behat_general::click_link', $this->escape($postsubject)); $this->execute('behat_general::click_link', get_string('reply', 'forum')); @@ -132,7 +132,7 @@ class behat_mod_forum extends behat_base { */ public function i_navigate_to_post_in_forum($postsubject, $forumname) { // Navigate to forum discussion. - $this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($forumname)); + $this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']); $this->execute('behat_general::click_link', $this->escape($postsubject)); } @@ -493,7 +493,7 @@ class behat_mod_forum extends behat_base { */ protected function add_new_discussion_inline($forumname, TableNode $table, $buttonstr) { // Navigate to forum. - $this->execute("behat_navigation::go_to_breadcrumb_location", $this->escape($forumname)); + $this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']); $this->execute('behat_general::click_link', $buttonstr); $this->fill_new_discussion_form($table); } diff --git a/mod/workshop/tests/behat/behat_mod_workshop.php b/mod/workshop/tests/behat/behat_mod_workshop.php index ca2f6e4f88f..22b4b0c5895 100644 --- a/mod/workshop/tests/behat/behat_mod_workshop.php +++ b/mod/workshop/tests/behat/behat_mod_workshop.php @@ -52,7 +52,7 @@ class behat_mod_workshop extends behat_base { $xpath = "//*[@class='userplan']/descendant::div[./span[contains(.,$phaseliteral)]]"; $continue = $this->escape(get_string('continue')); - $this->execute("behat_navigation::go_to_breadcrumb_location", $workshopname); + $this->execute('behat_navigation::i_am_on_page_instance', [$workshopname, 'workshop activity']); $this->execute('behat_general::i_click_on_in_the', array('a.action-icon', "css_element", $this->escape($xpath), "xpath_element") @@ -116,7 +116,7 @@ class behat_mod_workshop extends behat_base { $assess = $this->escape(get_string('assess', 'workshop')); $saveandclose = $this->escape(get_string('saveandclose', 'workshop')); - $this->execute("behat_navigation::go_to_breadcrumb_location", $workshopname); + $this->execute('behat_navigation::i_am_on_page_instance', [$workshopname, 'workshop activity']); $this->execute('behat_general::i_click_on_in_the', array($assess, "button", $xpath, "xpath_element") diff --git a/report/competency/tests/behat/breakdown_by_activity.feature b/report/competency/tests/behat/breakdown_by_activity.feature index 833de9ac71e..add4f27b604 100644 --- a/report/competency/tests/behat/breakdown_by_activity.feature +++ b/report/competency/tests/behat/breakdown_by_activity.feature @@ -41,9 +41,7 @@ Feature: See the competencies for an activity And "Competency picker" "dialogue" should be visible And I select "Test-Comp2" of the competency tree And I click on "Add" "button" in the "Competency picker" "dialogue" - And I am on "Course 1" course homepage - And I follow "PageName1" - And I navigate to "Edit settings" in current page administration + And I am on the PageName1 "page activity editing" page And I follow "Expand all" And I set the field "Course competencies" to "Test-Comp1" And I press "Save and return to course"