From f65b92577a56e75c0988d44dd99b37b40ca914d2 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Tue, 30 Nov 2021 12:06:30 +0800 Subject: [PATCH] MDL-70197 navigation: Update classic goutte tests --- .../behat/tests/behat/data_generators.feature | 3 +-- .../block_course_summary_frontpage.feature | 2 +- .../tests/behat/access_permissions.feature | 2 +- ...ourse_download_content_permissions.feature | 21 +++++++------------ lib/upgrade.txt | 20 ++++++++++++++++++ .../behat/delete_question_column.feature | 4 ++-- .../tests/behat/export_to_xml_action.feature | 4 ++-- .../tests/behat/tag_question_action.feature | 4 ++-- report/outline/tests/behat/user.feature | 4 ++-- 9 files changed, 38 insertions(+), 26 deletions(-) diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index a54c5466742..0fb2c5344bd 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -385,8 +385,7 @@ Feature: Set up contextual data for tests | enableoutcomes | 1 | When I log in as "admin" And I am on "Course 1" course homepage - And I navigate to "Grades" in current page administration - And I follow "Outcomes" + And I navigate to "Outcomes" in current page administration Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element" And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element" And I follow "Edit outcomes" diff --git a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature index 3b7aca2a814..ee6a13ed6b8 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature @@ -9,7 +9,7 @@ Feature: Course summary block used on the frontpage And I am on site homepage And I turn editing mode on And I add the "Course/site summary" block - And I navigate to "Front page settings" in site administration + And I navigate to "Front page > Front page settings" in site administration And I set the following fields to these values: | summary | Proved the summary block works! | And I press "Save changes" diff --git a/contentbank/tests/behat/access_permissions.feature b/contentbank/tests/behat/access_permissions.feature index e1d17c8ce67..dce95488fcd 100644 --- a/contentbank/tests/behat/access_permissions.feature +++ b/contentbank/tests/behat/access_permissions.feature @@ -18,7 +18,7 @@ Feature: Access permission to content Bank Scenario: Admins access content bank Given I log in as "admin" And I am on "Course 1" course homepage - Then "Content bank" "link" should exist in current page administration + Then "Content bank" "link" should exist Scenario: Editing teachers can access content bank at course level Given I log in as "teacher1" diff --git a/course/tests/behat/course_download_content_permissions.feature b/course/tests/behat/course_download_content_permissions.feature index 74dd85e3d84..29fd590d3f0 100644 --- a/course/tests/behat/course_download_content_permissions.feature +++ b/course/tests/behat/course_download_content_permissions.feature @@ -27,13 +27,11 @@ Feature: Access to downloading course content can be controlled And I navigate to "Settings" in current page administration And I set the field "Enable download course content" to "Yes" And I press "Save and display" - And I navigate to "Course administration" in current page administration - And "Download course content" "link" should exist + Then "Download course content" "link" should exist in current page administration When the following config values are set as admin: | downloadcoursecontentallowed | 0 | And I am on "Hockey 101" course homepage - And I navigate to "Course administration" in current page administration - And "Download course content" "link" should not exist + Then "Download course content" "link" should not exist in current page administration And I navigate to "Settings" in current page administration And I should not see "Enable download course content" @@ -45,8 +43,7 @@ Feature: Access to downloading course content can be controlled And I set the field "Enable download course content" to "Yes" And I press "Save changes" And I am on "Hockey 101" course homepage - And I navigate to "Course administration" in current page administration - Then "Download course content" "link" should exist + Then "Download course content" "link" should exist in current page administration Scenario: A teacher can enable and disable the download course content feature when it is available Given I log in as "teacher1" @@ -56,13 +53,11 @@ Feature: Access to downloading course content can be controlled And I should see "Enable download course content" And I set the field "Enable download course content" to "Yes" And I press "Save and display" - And I navigate to "Course administration" in current page administration - Then "Download course content" "link" should exist + Then "Download course content" "link" should exist in current page administration And I navigate to "Settings" in current page administration And I set the field "Enable download course content" to "No" And I press "Save and display" - And I navigate to "Course administration" in current page administration - And "Download course content" "link" should not exist + Then "Download course content" "link" should not exist in current page administration Scenario: Teachers require a capability to access the download course content feature or modify its availability in a course Given I log in as "admin" @@ -73,8 +68,7 @@ Feature: Access to downloading course content can be controlled # Check teacher can see download option and enable dropdown. And I log in as "teacher1" And I am on "Hockey 101" course homepage - And I navigate to "Course administration" in current page administration - And "Download course content" "link" should exist + Then "Download course content" "link" should exist in current page administration And I navigate to "Settings" in current page administration And "Enable download course content" "select" should exist And I log out @@ -88,8 +82,7 @@ Feature: Access to downloading course content can be controlled # Check teacher can no longer see download option, and that enable value is visible, but dropdown no longer available. When I log in as "teacher1" And I am on "Hockey 101" course homepage - And I navigate to "Course administration" in current page administration - Then "Download course content" "link" should not exist + Then "Download course content" "link" should not exist in current page administration And I navigate to "Settings" in current page administration And I should see "Enable download course content" And I should see "Site default (Yes)" diff --git a/lib/upgrade.txt b/lib/upgrade.txt index ac20988a76d..8bf1c6c73d2 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -128,6 +128,26 @@ completely removed from Moodle core too. -get_safe_orderby() - where a single sort parameter is required. -get_safe_orderby_multiple() - where multiple sort parameters are required. * Added the cleanstr mustache template helper to clean strings after loading them from language packs. +* The following behat functions have been modified to work with the new navigation + - i_add_the_block + - the_add_block_selector_should_contain_block + - the_add_block_selector_should_contain_block + - go_to_the_current_course_activity_completion_report + - i_navigate_to_course_participants + - i_go_to_advanced_grading_page + - i_navigate_to_in_the_course_gradebook + - should_exist_in_current_page_administration + - should_not_exist_in_current_page_administration + - go_to_main_course_page + - select_on_administration_page + - find_header_administration_menu + - select_from_administration_menu + - i_edit_the_lesson + - i_add_a_question_filling_the_form_with + +* The following behat step has been deprecated + - i_select_from_flat_navigation_drawer + === 3.11.4 === * A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function. diff --git a/question/bank/deletequestion/tests/behat/delete_question_column.feature b/question/bank/deletequestion/tests/behat/delete_question_column.feature index c11ac8b9b9e..5baea132dd8 100644 --- a/question/bank/deletequestion/tests/behat/delete_question_column.feature +++ b/question/bank/deletequestion/tests/behat/delete_question_column.feature @@ -24,13 +24,13 @@ Feature: Use the qbank plugin manager page for deletequestion And I click on "Disable" "link" in the "Delete question" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank > Questions" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" Then I should not see "Delete" in the "region-main" "region" And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration And I click on "Enable" "link" in the "Delete question" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank > Questions" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" And I should see "Delete" in the "region-main" "region" @javascript diff --git a/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature b/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature index f713f2a7eb5..f172d6c0f64 100644 --- a/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature +++ b/question/bank/exporttoxml/tests/behat/export_to_xml_action.feature @@ -23,11 +23,11 @@ Feature: Use the qbank plugin manager page for exporttoxml And I click on "Disable" "link" in the "Export to XML" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" Then I should not see "Export as Moodle XML" And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration And I click on "Enable" "link" in the "Export to XML" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" And I should see "Export as Moodle XML" diff --git a/question/bank/tagquestion/tests/behat/tag_question_action.feature b/question/bank/tagquestion/tests/behat/tag_question_action.feature index 795b0299875..0a0c13f9a79 100644 --- a/question/bank/tagquestion/tests/behat/tag_question_action.feature +++ b/question/bank/tagquestion/tests/behat/tag_question_action.feature @@ -23,13 +23,13 @@ Feature: Use the qbank plugin manager page for tagquestion And I click on "Disable" "link" in the "Tag question" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" Then I should not see "Manage tags" And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration And I click on "Enable" "link" in the "Tag question" "table_row" And I am on the "Test quiz" "quiz activity" page And I navigate to "Question bank" in current page administration - And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row" + And I click on ".dropdown-toggle" "css_element" in the "First question" "table_row" And I should see "Manage tags" Scenario: Enable/disable tagquestion section from question edit form diff --git a/report/outline/tests/behat/user.feature b/report/outline/tests/behat/user.feature index 2a0d968f6b4..dc08edcfd55 100644 --- a/report/outline/tests/behat/user.feature +++ b/report/outline/tests/behat/user.feature @@ -120,8 +120,8 @@ Feature: View the user page for the outline report When I follow "Participants" And I follow "Student 1" And I follow "Outline report" - Then I should see "forum1" + Then I should see "Activity report" When I follow "Participants" And I follow "Student 1" And I follow "Complete report" - Then I should see "No posts" + Then I should see "Activity report"