From b784c144f8d2e069db1adbfb6361affb2b62d876 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 30 Oct 2024 13:02:57 +0000 Subject: [PATCH] MDL-80689 form behat: move fixture file to the expected place --- lib/form/tests/behat/disabledif.feature | 9 +++++---- .../fixtures/filemanager_hideif_disabledif_form.php | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) rename lib/form/tests/{behat => }/fixtures/filemanager_hideif_disabledif_form.php (95%) diff --git a/lib/form/tests/behat/disabledif.feature b/lib/form/tests/behat/disabledif.feature index 97bcdabde4c..d4f33ad9607 100644 --- a/lib/form/tests/behat/disabledif.feature +++ b/lib/form/tests/behat/disabledif.feature @@ -4,11 +4,11 @@ Feature: disabledIf functionality in forms As a user If I trigger the disabledIf condition then the form elements will be disabled - Background: - Given I log in as "admin" + # Note: if you are looking for the Behat tests for the filepicker widget, + # you will find them in repository/tests/behat. Scenario: The file manager is disabled when disabledIf conditions are met - Given I am on fixture page "/lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php" + Given I am on the "filemanager_hideif_disabledif_form" "core_form > Fixture" page logged in as "admin" When I click on "Disable" "radio" # Test standard file manager. Then the "disabled" attribute of "input#id_some_filemanager" "css_element" should contain "true" @@ -16,7 +16,8 @@ Feature: disabledIf functionality in forms And the "disabled" attribute of "input#id_filemanager_group_some_filemanager_group" "css_element" should contain "true" Scenario: The static element is disabled when 'eq' disabledIf conditions are met - Given I am on fixture page "/lib/form/tests/behat/fixtures/static_hideif_disabledif_form.php" + Given I log in as "admin" + And I am on fixture page "/lib/form/tests/behat/fixtures/static_hideif_disabledif_form.php" And I should see "Static with form elements" When I click on "Disable" "radio" And the "class" attribute of "#fitem_id_some_static" "css_element" should contain "text-muted" diff --git a/lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php b/lib/form/tests/fixtures/filemanager_hideif_disabledif_form.php similarity index 95% rename from lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php rename to lib/form/tests/fixtures/filemanager_hideif_disabledif_form.php index fd4ab05f884..342f12d813b 100644 --- a/lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php +++ b/lib/form/tests/fixtures/filemanager_hideif_disabledif_form.php @@ -14,13 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -require_once(__DIR__ . '/../../../../../config.php'); +require_once(__DIR__ . '/../../../../config.php'); defined('BEHAT_SITE_RUNNING') || die(); global $CFG, $PAGE, $OUTPUT; require_once($CFG->libdir . '/formslib.php'); -$PAGE->set_url('/lib/form/tests/behat/fixtures/filemanager_hideif_disabledif_form.php'); +$PAGE->set_url('/lib/form/tests/fixtures/filemanager_hideif_disabledif_form.php'); $PAGE->add_body_class('limitedwidth'); require_login(); $PAGE->set_context(core\context\system::instance());