From 31aee1c82e103bdcfb60a96fca202c328339db20 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Mon, 6 Mar 2023 17:22:55 +0100 Subject: [PATCH] MDL-77291 behat: Fix some behat scenarios Some behat scenarios were using labels with links to access some specific PHP files. Now that labels are also displayed in the course index, the region needs to be defined in the step to access to the expected link (otherwise, the one in the course index will be used). --- lib/editor/atto/tests/behat/customtoolbar.feature | 2 +- lib/editor/atto/tests/behat/disablecontrol.feature | 2 +- lib/editor/textarea/tests/behat/disablecontrol.feature | 2 +- lib/editor/tinymce/tests/behat/disablecontrol.feature | 2 +- lib/tests/behat/largeforms.feature | 2 +- lib/tests/behat/readonlyform.feature | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/editor/atto/tests/behat/customtoolbar.feature b/lib/editor/atto/tests/behat/customtoolbar.feature index ec282c2e9c5..dfecd22fec9 100644 --- a/lib/editor/atto/tests/behat/customtoolbar.feature +++ b/lib/editor/atto/tests/behat/customtoolbar.feature @@ -14,7 +14,7 @@ Feature: Atto editor with customised toolbar | label | L1 | FixtureLink | C1 | label1 | When I log in as "admin" And I am on "Course 1" course homepage - And I follow "FixtureLink" + And I click on "FixtureLink" "link" in the "region-main" "region" @javascript Scenario: Confirm that both editors have different toolbars but still function diff --git a/lib/editor/atto/tests/behat/disablecontrol.feature b/lib/editor/atto/tests/behat/disablecontrol.feature index 893d241b3e5..b7a6678157e 100644 --- a/lib/editor/atto/tests/behat/disablecontrol.feature +++ b/lib/editor/atto/tests/behat/disablecontrol.feature @@ -14,7 +14,7 @@ Feature: Atto with enable/disable function. | label | L1 | Control Enable/Disable Atto | C1 | label1 | And I log in as "admin" And I am on "Course 1" course homepage - And I follow "Control Enable/Disable Atto" + And I click on "Control Enable/Disable Atto" "link" in the "region-main" "region" @javascript Scenario: Check disable Atto editor. diff --git a/lib/editor/textarea/tests/behat/disablecontrol.feature b/lib/editor/textarea/tests/behat/disablecontrol.feature index 9e482056a7f..bac5635b481 100644 --- a/lib/editor/textarea/tests/behat/disablecontrol.feature +++ b/lib/editor/textarea/tests/behat/disablecontrol.feature @@ -18,7 +18,7 @@ Feature: Text area with enable/disable function. And I set the field "Text editor" to "Plain text area" And I press "Save changes" And I am on "Course 1" course homepage - And I follow "Control Enable/Disable Text area" + And I click on "Control Enable/Disable Text area" "link" in the "region-main" "region" @javascript Scenario: Check disable Text area editor. diff --git a/lib/editor/tinymce/tests/behat/disablecontrol.feature b/lib/editor/tinymce/tests/behat/disablecontrol.feature index 084738321b9..cb8b92191f6 100644 --- a/lib/editor/tinymce/tests/behat/disablecontrol.feature +++ b/lib/editor/tinymce/tests/behat/disablecontrol.feature @@ -18,7 +18,7 @@ Feature: Tinymce with enable/disable function. And I set the field "Text editor" to "TinyMCE HTML editor" And I press "Save changes" And I am on "Course 1" course homepage - And I follow "Control Enable/Disable Tinymce" + And I click on "Control Enable/Disable Tinymce" "link" in the "region-main" "region" @javascript Scenario: Check disable Tinymce editor. diff --git a/lib/tests/behat/largeforms.feature b/lib/tests/behat/largeforms.feature index 1e6223ae0c3..57e388277e6 100644 --- a/lib/tests/behat/largeforms.feature +++ b/lib/tests/behat/largeforms.feature @@ -13,7 +13,7 @@ Feature: Forms with a large number of fields | activity | name | intro | course | idnumber | | label | L1 | FixtureLink | C1 | label1 | When I am on the "C1" "Course" page logged in as "admin" - And I follow "FixtureLink" + And I click on "FixtureLink" "link" in the "region-main" "region" # Note: These tests do not actually use JavaScript but they don't work with # the headless 'browser'. diff --git a/lib/tests/behat/readonlyform.feature b/lib/tests/behat/readonlyform.feature index bcf217ab527..2c4fae6bbd4 100644 --- a/lib/tests/behat/readonlyform.feature +++ b/lib/tests/behat/readonlyform.feature @@ -13,7 +13,7 @@ Feature: Read-only forms should work | activity | name | intro | course | idnumber | | label | L1 | Fixture link | C1 | label1 | Given I am on the "C1" "Course" page logged in as "admin" - And I follow "Fixture link" + And I click on "Fixture link" "link" in the "region-main" "region" When I expand all fieldsets Then the field "Name" matches value "Important information" @@ -26,7 +26,7 @@ Feature: Read-only forms should work | activity | name | intro | course | idnumber | | label | L1 | Fixture link | C1 | label1 | Given I am on the "C1" "Course" page logged in as "admin" - And I follow "Fixture link" + And I click on "Fixture link" "link" in the "region-main" "region" When I expand all fieldsets Then the field "Name" matches value "Important information" Then the field "Other" matches value "Other information"