From dc020cede9064bbaa6132947ce73d0e85585355d Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 3 Dec 2021 18:01:13 +0100 Subject: [PATCH] MDL-72112 admin_presets: Fix behat errors --- admin/tool/admin_presets/db/install.php | 2 ++ .../tool/admin_presets/tests/behat/apply_presets.feature | 8 ++++---- admin/tool/admin_presets/tests/behat/delete.feature | 8 ++++---- admin/tool/admin_presets/tests/behat/download.feature | 8 ++++---- .../admin_presets/tests/behat/export_settings.feature | 4 ++-- .../tool/admin_presets/tests/behat/revert_changes.feature | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/admin/tool/admin_presets/db/install.php b/admin/tool/admin_presets/db/install.php index 274602d41ee..0e4095c47ef 100755 --- a/admin/tool/admin_presets/db/install.php +++ b/admin/tool/admin_presets/db/install.php @@ -52,6 +52,7 @@ function xmldb_tool_admin_presets_install() { helper::add_item($presetid, 'showdataretentionsummary', '0', 'tool_dataprivacy'); helper::add_item($presetid, 'forum_maxattachments', '3'); helper::add_item($presetid, 'customusermenuitems', 'grades,grades|/grade/report/mygrades.php|t/grades +calendar,core_calendar|/calendar/view.php?view=month|i/calendar preferences,moodle|/user/preferences.php|t/preferences'); // Modules: Hide chat, database, external tool (lti), IMS content package (imscp), lesson, SCORM, survey, wiki, workshop. @@ -160,6 +161,7 @@ preferences,moodle|/user/preferences.php|t/preferences'); helper::add_item($presetid, 'forum_maxattachments', '9'); // In that case, the indentation coding style can't follow the rules to guarantee the setting value is created properly. helper::add_item($presetid, 'customusermenuitems', 'grades,grades|/grade/report/mygrades.php|t/grades +calendar,core_calendar|/calendar/view.php?view=month|i/calendar messages,message|/message/index.php|t/message preferences,moodle|/user/preferences.php|t/preferences' ); diff --git a/admin/tool/admin_presets/tests/behat/apply_presets.feature b/admin/tool/admin_presets/tests/behat/apply_presets.feature index 5f61422585b..3ae392d19b9 100644 --- a/admin/tool/admin_presets/tests/behat/apply_presets.feature +++ b/admin/tool/admin_presets/tests/behat/apply_presets.feature @@ -8,7 +8,7 @@ Feature: I can apply presets Given I navigate to "Site admin presets" in site administration And I should see "Full" And I open the action menu in "Full" "table_row" - When I choose "Apply" in the open action menu + When I choose "Review settings and apply" in the open action menu Then I should not see "Setting changes" Scenario: Applying Starter Moodle preset changes status and settings @@ -28,7 +28,7 @@ Feature: I can apply presets When I navigate to "Site admin presets" in site administration And I should see "Starter" And I open the action menu in "Starter" "table_row" - And I choose "Apply" in the open action menu + And I choose "Review settings and apply" in the open action menu And I should see "Setting changes" # We are not testing all the settings, just one of each type. And I should see "Enable badges" in the "Setting changes" "table" @@ -63,13 +63,13 @@ Feature: I can apply presets And I click on "Create preset" "button" And I should see "Current" And I open the action menu in "Current" "table_row" - When I choose "Apply" in the open action menu + When I choose "Review settings and apply" in the open action menu And I should not see "Setting changes" And I click on "Continue" "button" And the following config values are set as admin: | enabled | 0 | core_competency | And I open the action menu in "Current" "table_row" - And I choose "Apply" in the open action menu + And I choose "Review settings and apply" in the open action menu Then I should see "Setting changes" And I should see "Enable competencies" in the "core_competency" "table_row" And I click on "Apply" "button" diff --git a/admin/tool/admin_presets/tests/behat/delete.feature b/admin/tool/admin_presets/tests/behat/delete.feature index db079717bca..aa358509d21 100644 --- a/admin/tool/admin_presets/tests/behat/delete.feature +++ b/admin/tool/admin_presets/tests/behat/delete.feature @@ -12,12 +12,12 @@ Feature: Admin preset deletion Given I should see "Starter" And I should see "Full" And I should see "Custom preset" - When I open the action menu in "Starter" "table_row" + When I open the action menu in "Custom preset" "table_row" + And I should see "Delete" + And I open the action menu in "Full" "table_row" Then I should not see "Delete" And I open the action menu in "Starter" "table_row" And I should not see "Delete" - And I open the action menu in "Custom preset" "table_row" - And I should see "Delete" Scenario: Custom preset settings can be deleted Given I should see "Custom preset" @@ -37,7 +37,7 @@ Feature: Admin preset deletion Scenario: Delete preset that has been applied Given I open the action menu in "Custom preset" "table_row" - And I choose "Apply" in the open action menu + And I choose "Review settings and apply" in the open action menu And I click on "Apply" "button" And I navigate to "Site admin presets" in site administration When I open the action menu in "Custom preset" "table_row" diff --git a/admin/tool/admin_presets/tests/behat/download.feature b/admin/tool/admin_presets/tests/behat/download.feature index d17dc65655e..16be3f888fe 100644 --- a/admin/tool/admin_presets/tests/behat/download.feature +++ b/admin/tool/admin_presets/tests/behat/download.feature @@ -12,7 +12,7 @@ Feature: I can download a preset Scenario: Core and custom preset settings can be downloaded Given I log in as "admin" And I navigate to "Site admin presets" in site administration - When I open the action menu in "Starter" "table_row" - Then following "Download" "link" in the "Starter" "table_row" should download between "0" and "5000" bytes - And I open the action menu in "Custom preset" "table_row" - And following "Download" "link" in the "Custom preset" "table_row" should download between "0" and "5000" bytes + When I open the action menu in "Custom preset" "table_row" + Then following "Download" "link" in the "Custom preset" "table_row" should download between "0" and "5000" bytes + And I open the action menu in "Starter" "table_row" + And following "Download" "link" in the "Starter" "table_row" should download between "0" and "5000" bytes diff --git a/admin/tool/admin_presets/tests/behat/export_settings.feature b/admin/tool/admin_presets/tests/behat/export_settings.feature index 2781c5ce637..86d49e667e2 100644 --- a/admin/tool/admin_presets/tests/behat/export_settings.feature +++ b/admin/tool/admin_presets/tests/behat/export_settings.feature @@ -20,11 +20,11 @@ Feature: I can add a new preset with current settings And I click on "Create preset" "button" And I should see "Current" And I open the action menu in "Current" "table_row" - When I choose "Apply" in the open action menu + When I choose "Review settings and apply" in the open action menu And I should not see "Setting changes" And I click on "Continue" "button" And the following config values are set as admin: | enableportfolios | 1 | And I open the action menu in "Current" "table_row" - And I choose "Apply" in the open action menu + And I choose "Review settings and apply" in the open action menu Then I should see "Setting changes" diff --git a/admin/tool/admin_presets/tests/behat/revert_changes.feature b/admin/tool/admin_presets/tests/behat/revert_changes.feature index 4f28570649a..1a9aff329b9 100755 --- a/admin/tool/admin_presets/tests/behat/revert_changes.feature +++ b/admin/tool/admin_presets/tests/behat/revert_changes.feature @@ -5,7 +5,7 @@ Feature: I can revert changes after a load Given I log in as "admin" And I navigate to "Site admin presets" in site administration And I open the action menu in "Starter" "table_row" - And I choose "Apply" in the open action menu + And I choose "Review settings and apply" in the open action menu And I should see "Setting changes" And I click on "Apply" "button" And I click on "Continue" "button"