diff --git a/admin/tests/behat/display_short_names.feature b/admin/tests/behat/display_short_names.feature index b5d609644bf99..1b41f65dec8dd 100644 --- a/admin/tests/behat/display_short_names.feature +++ b/admin/tests/behat/display_short_names.feature @@ -17,7 +17,7 @@ Feature: Display extended course names Scenario: Courses list with extended course names Given I expand "Site administration" node And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element" - And I check "Display extended course names" + And I set the field "Display extended course names" to "1" When I press "Save changes" And I am on homepage Then I should see "C_shortname Course fullname" diff --git a/admin/tests/behat/filter_users.feature b/admin/tests/behat/filter_users.feature index 4b7f6ef796f88..1b7de06a3aae5 100644 --- a/admin/tests/behat/filter_users.feature +++ b/admin/tests/behat/filter_users.feature @@ -29,7 +29,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro @javascript Scenario: Filter user accounts by role and cohort - When I fill the moodle form with: + When I set the following fields to these values: | courserole_rl | Student | | courserole_ct | any category | | courserole | C1 | @@ -38,7 +38,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro And I should see "User Two" And I should see "User Three" And I should not see "User Four" - And I fill the moodle form with: + And I set the following fields to these values: | cohort | CH1 | And I press "Add filter" And I should not see "User One" @@ -53,14 +53,14 @@ Feature: An administrator can filter user accounts by role, cohort and other pro @javascript Scenario: Filter user accounts by confirm and authentication method - When I fill the moodle form with: + When I set the following fields to these values: | Confirmed | No | And I press "Add filter" Then I should see "User One" And I should not see "User Two" And I should not see "User Three" And I should see "User Four" - And I fill the moodle form with: + And I set the following fields to these values: | Authentication | manual | And I press "Add filter" And I should see "User One" diff --git a/admin/tests/behat/upload_users.feature b/admin/tests/behat/upload_users.feature index 5cde0e84f8555..d67085b329ce3 100644 --- a/admin/tests/behat/upload_users.feature +++ b/admin/tests/behat/upload_users.feature @@ -41,5 +41,5 @@ Feature: Upload users And I follow "Maths" And I expand "Users" node And I follow "Groups" - And I select "Section 1 (1)" from "groups" + And I set the field "groups" to "Section 1 (1)" And the "members" select box should contain "Tom Jones" diff --git a/admin/tool/behat/tests/behat/basic_actions.feature b/admin/tool/behat/tests/behat/basic_actions.feature index 83f03207a5069..4f482dc6cb737 100644 --- a/admin/tool/behat/tests/behat/basic_actions.feature +++ b/admin/tool/behat/tests/behat/basic_actions.feature @@ -11,7 +11,7 @@ Feature: Page contents assertions And I expand "Users" node And I follow "Groups" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | I'm the name | | Group description | I'm the description | And I press "Save changes" diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index b460b1a6dea2d..59e53396c39db 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -89,11 +89,11 @@ Feature: Set up contextual data for tests And I follow "Course 1" And I expand "Users" node And I follow "Permissions" - And I select "Student (1)" from "Advanced role override" - Then the "mod/forum:editanypost" field should match "1" value + And I set the field "Advanced role override" to "Student (1)" + Then "mod/forum:editanypost" capability has "Allow" permission And I press "Cancel" - And I select "Teacher (1)" from "Advanced role override" - And the "mod/forum:replynews" field should match "-1" value + And I set the field "Advanced role override" to "Teacher (1)" + And "mod/forum:replynews" capability has "Prevent" permission And I press "Cancel" Scenario: Add course enrolments @@ -249,7 +249,7 @@ Feature: Set up contextual data for tests And I follow "Groups" Then the "groups" select box should contain "Group 1 (1)" And the "groups" select box should contain "Group 2 (1)" - And I select "Group 1 (1)" from "groups" + And I set the field "groups" to "Group 1 (1)" And the "members" select box should contain "Student 1" - And I select "Group 2 (1)" from "groups" + And I set the field "groups" to "Group 2 (1)" And the "members" select box should contain "Student 2" diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index b16b0e0c8a01d..c2111ec698b45 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -25,10 +25,10 @@ Feature: Edit capabilities | moodle/grade:managesharedforms | Prevent | | moodle/course:request | Prohibit | When I follow "Edit Teacher role" - Then the "block/mnet_hosts:myaddinstance" field should match "1" value - And the "moodle/community:add" field should match "0" value - And the "moodle/grade:managesharedforms" field should match "-1" value - And the "moodle/course:request" field should match "-1000" value + Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission + And "moodle/community:add" capability has "Not set" permission + And "moodle/grade:managesharedforms" capability has "Prevent" permission + And "moodle/course:request" capability has "Prohibit" permission @javascript Scenario: Course capabilities overrides @@ -40,10 +40,10 @@ Feature: Edit capabilities | mod/forum:deleteanypost | Prohibit | | mod/forum:editanypost | Prevent | | mod/forum:addquestion | Allow | - When I select "Student (3)" from "Advanced role override" - Then the "mod/forum:deleteanypost" field should match "-1000" value - And the "mod/forum:editanypost" field should match "-1" value - And the "mod/forum:addquestion" field should match "1" value + When I set the field "Advanced role override" to "Student (3)" + Then "mod/forum:deleteanypost" capability has "Prohibit" permission + And "mod/forum:editanypost" capability has "Prevent" permission + And "mod/forum:addquestion" capability has "Allow" permission @javascript Scenario: Module capabilities overrides @@ -59,7 +59,7 @@ Feature: Edit capabilities | mod/forum:deleteanypost | Prohibit | | mod/forum:editanypost | Prevent | | mod/forum:addquestion | Allow | - When I select "Student (3)" from "Advanced role override" - Then the "mod/forum:deleteanypost" field should match "-1000" value - And the "mod/forum:editanypost" field should match "-1" value - And the "mod/forum:addquestion" field should match "1" value + When I set the field "Advanced role override" to "Student (3)" + Then "mod/forum:deleteanypost" capability has "Prohibit" permission + And "mod/forum:editanypost" capability has "Prevent" permission + And "mod/forum:addquestion" capability has "Allow" permission diff --git a/admin/tool/behat/tests/behat/get_and_set_fields.feature b/admin/tool/behat/tests/behat/get_and_set_fields.feature index 45eebe845b090..3857653a2666c 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -36,8 +36,8 @@ Feature: Verify that all form fields values can be get and set And I expand "Site administration" node And I expand "Appearance" node And I follow "Manage tags" - # Select (multi-select) - We will check "I fill in...". - And I fill in "otagsadd" with "OT1, OT2, OT3, OT4, OT5" + # Select (multi-select) - We will check "I set the field...". + And I set the field "otagsadd" to "OT1, OT2, OT3, OT4, OT5" And I press "Add official tags" And I am on homepage And I follow "Course 1" @@ -55,8 +55,8 @@ Feature: Verify that all form fields values can be get and set And the "tags[officialtags][]" select box should not contain "OT6" And the "tags[officialtags][]" select box should not contain "OT7" And the "tags[officialtags][]" select box should not contain "OT6, OT7" - # Text (textarea & editor) & Select (multi-select) - Checking "I fill the moodle form with". - When I fill the moodle form with: + # Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values". + When I set the following fields to these values: | HTML format | Student page contents to be tagged | | tags[officialtags][] | OT1, OT3, OT5 | And I press "Save" @@ -67,8 +67,8 @@ Feature: Verify that all form fields values can be get and set And I should not see "OT2" in the ".wiki-tags" "css_element" And I should not see "OT4" in the ".wiki-tags" "css_element" And I follow "Edit" - # Select (multi-select) - Checking "I select from". - And I select "OT2, OT4" from "tags[officialtags][]" + # Select (multi-select) - Checking "I set the field". + And I set the field "tags[officialtags][]" to "OT2, OT4" And I press "Save" And I should see "OT2" in the ".wiki-tags" "css_element" And I should see "OT4" in the ".wiki-tags" "css_element" @@ -76,40 +76,40 @@ Feature: Verify that all form fields values can be get and set And I should not see "OT3" in the ".wiki-tags" "css_element" And I should not see "OT5" in the ".wiki-tags" "css_element" And I follow "Edit" - # Select (multi-select) - Checking "the field should match" and "the field does not match value". - And the "tags[officialtags][]" field should match "OT2, OT4" value + # Select (multi-select) - Checking "the field matches value" and "the field does not match value". + And the field "tags[officialtags][]" matches value "OT2, OT4" And the field "tags[officialtags][]" does not match value "OT4" And the field "tags[officialtags][]" does not match value "OT2" And the field "tags[officialtags][]" does not match value "OT1, OT3, OT5" And I press "Cancel" And I follow "Edit settings" And I expand all fieldsets - # Checkbox - Checking "I check". - And I check "Display description on course page" - # Checkbox - Checking "I fill the moodle form with:". - And I fill the moodle form with: + # Checkbox - Checking "I set the field". + And I set the field "Display description on course page" to "1" + # Checkbox - Checking "I set the following fields to these values:". + And I set the following fields to these values: | Force format | 1 | - # Checkbox - Checking "the field should match" and "the field does not match value". - And the "Display description on course page" field should match "1" value + # Checkbox - Checking "the field matches value" and "the field does not match value". + And the field "Display description on course page" matches value "1" And the field "Display description on course page" does not match value "" And I press "Save and return to course" And I should see "Test this one" And I follow "Test this one" And I follow "Edit settings" - # Checkbox - Checking "the field should match" and "the following fields match these values". + # Checkbox - Checking "the field matches value" and "the following fields match these values". And the following fields match these values: | Display description on course page | 1 | | Default format | HTML | | Wiki name | Test this one | - And the "Force format" field should match "1" value - # Select (simple) - Checking "I fill the moodle form with:". - And I fill the moodle form with: + And the field "Force format" matches value "1" + # Select (simple) - Checking "I set the following fields to these values:". + And I set the following fields to these values: | Default format | NWiki | | Display description on course page | | - # Checkbox - Checking "I uncheck". - And I uncheck "Force format" - # Select (simple) - Checking "I select from". - And I select "Separate groups" from "Group mode" + # Checkbox - Checking "I set the field" to uncheck. + And I set the field "Force format" to "" + # Select (simple) - Checking "I set the field". + And I set the field "Group mode" to "Separate groups" And I press "Save and display" And I follow "Edit settings" And the following fields match these values: @@ -124,7 +124,7 @@ Feature: Verify that all form fields values can be get and set | Force format | 1 | And I press "Cancel" And I follow "Course 1" - # Radio - Checking "I check" and "the field should match". + # Radio - Checking "I set the field" and "the field matches value". And I add a "Choice" to section "1" and I fill the form with: | Choice name | Test choice name | | Description | Test choice description | @@ -133,10 +133,10 @@ Feature: Verify that all form fields values can be get and set | Option 2 | two | | Option 3 | three | And I follow "Test choice name" - And I check "one" + And I set the field "one" to "1" And I press "Save my choice" - And the "one" field should match "1" value - And the "two" field should match "" value + And the field "one" matches value "1" + And the field "two" matches value "" Scenario: with JS disabled all form fields getters and setters works as expected @@ -145,29 +145,29 @@ Feature: Verify that all form fields values can be get and set Then I follow "Course 1" And I expand "Users" node And I follow "Groups" - # Select (multi-select & AJAX) - Checking "I select from" and "select box should contain". - And I select "Group 2" from "groups" + # Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain". + And I set the field "groups" to "Group 2" And the "members" select box should contain "Student 2" And the "members" select box should contain "Student 3" And the "members" select box should not contain "Student 1" - And I select "Group 1" from "groups" + And I set the field "groups" to "Group 1" And the "members" select box should contain "Student 1" And the "members" select box should contain "Student 2" And the "members" select box should not contain "Student 3" - # Checkbox (AJAX) - Checking "I check" and "I fill the moodle form with". + # Checkbox (AJAX) - Checking "I set the field" and "I set the following fields to these values". And I follow "Course 1" And I add a "Lesson" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test lesson | | available[enabled] | 1 | - And I check "deadline[enabled]" - # Checkbox (AJAX) - Checking "field should match" before saving. - And the "available[enabled]" field should match "1" value + And I set the field "deadline[enabled]" to "1" + # Checkbox (AJAX) - Checking "the field matches value" before saving. + And the field "available[enabled]" matches value "1" And the "available[day]" "field" should be enabled - And the "deadline[enabled]" field should match "1" value + And the field "deadline[enabled]" matches value "1" And I press "Save and display" And I follow "Edit settings" - And the "available[enabled]" field should match "1" value + And the field "available[enabled]" matches value "1" And the "available[day]" "field" should be enabled - And the "deadline[enabled]" field should match "1" value + And the field "deadline[enabled]" matches value "1" And I press "Cancel" diff --git a/admin/tool/behat/tests/behat/list_steps.feature b/admin/tool/behat/tests/behat/list_steps.feature index 3fc9ce882c0fa..8061f4ed88cb9 100644 --- a/admin/tool/behat/tests/behat/list_steps.feature +++ b/admin/tool/behat/tests/behat/list_steps.feature @@ -18,14 +18,14 @@ Feature: List the system steps definitions @javascript Scenario: Filtering by type - Given I select "Then. Checkings to ensure the outcomes are the expected ones" from "Type" + Given I set the field "Type" to "Then. Checkings to ensure the outcomes are the expected ones" When I press "Filter" Then I should see "Checks, that page contains specified text." And I should not see "Opens Moodle homepage." @javascript Scenario: Filtering by keyword - Given I fill in "Contains" with "homepage" + Given I set the field "Contains" to "homepage" When I press "Filter" Then I should see "Opens Moodle homepage." diff --git a/admin/tool/behat/tests/behat/manipulate_forms.feature b/admin/tool/behat/tests/behat/manipulate_forms.feature index 664bbd67a692c..ce44fad1f34bf 100644 --- a/admin/tool/behat/tests/behat/manipulate_forms.feature +++ b/admin/tool/behat/tests/behat/manipulate_forms.feature @@ -9,14 +9,14 @@ Feature: Forms manipulation Given I log in as "admin" And I follow "Admin User" And I follow "Edit profile" - When I fill in "First name" with "Field value" - And I select "Plain text area" from "Text editor" - And I check "Unmask" - Then the "First name" field should match "Field value" value + When I set the field "First name" to "Field value" + And I set the field "Text editor" to "Plain text area" + And I set the field "Unmask" to "1" + Then the field "First name" matches value "Field value" And the "Text editor" select box should contain "Plain text area" - And the "Unmask" checkbox should be checked - And I uncheck "Unmask" - And the "Unmask" checkbox should not be checked + And the field "Unmask" matches value "1" + And I set the field "Unmask" to "" + And the field "Unmask" matches value "" And I press "Update profile" @javascript diff --git a/admin/tool/behat/tests/behat/nasty_strings.feature b/admin/tool/behat/tests/behat/nasty_strings.feature index 8ced5fda015e9..c67d6cd6c1395 100644 --- a/admin/tool/behat/tests/behat/nasty_strings.feature +++ b/admin/tool/behat/tests/behat/nasty_strings.feature @@ -14,47 +14,47 @@ Feature: Transform steps arguments And I follow "Edit profile" Scenario: Use nasty strings on steps arguments - When I fill in "Surname" with "$NASTYSTRING1" - And I fill in "Description" with "$NASTYSTRING2" - And I fill in "City/town" with "$NASTYSTRING3" + When I set the field "Surname" to "$NASTYSTRING1" + And I set the field "Description" to "$NASTYSTRING2" + And I set the field "City/town" to "$NASTYSTRING3" And I press "Update profile" And I follow "Edit profile" Then I should not see "NASTYSTRING" - And the "Surname" field should match "$NASTYSTRING1" value - And the "City/town" field should match "$NASTYSTRING3" value + And the field "Surname" matches value "$NASTYSTRING1" + And the field "City/town" matches value "$NASTYSTRING3" Scenario: Use nasty strings on table nodes - When I fill the moodle form with: + When I set the following fields to these values: | Surname | $NASTYSTRING1 | | Description | $NASTYSTRING2 | | City/town | $NASTYSTRING3 | And I press "Update profile" And I follow "Edit profile" Then I should not see "NASTYSTRING" - And the "Surname" field should match "$NASTYSTRING1" value - And the "City/town" field should match "$NASTYSTRING3" value + And the field "Surname" matches value "$NASTYSTRING1" + And the field "City/town" matches value "$NASTYSTRING3" Scenario: Use double quotes - When I fill the moodle form with: + When I set the following fields to these values: | First name | va"lue1 | | Description | va\"lue2 | - And I fill in "City/town" with "va\"lue3" + And I set the field "City/town" to "va\"lue3" And I press "Update profile" And I follow "Edit profile" Then I should not see "NASTYSTRING" - And the "First name" field should match "va\"lue1" value - And the "Description" field should match "va\\"lue2" value - And the "City/town" field should match "va\"lue3" value + And the field "First name" matches value "va\"lue1" + And the field "Description" matches value "va\\"lue2" + And the field "City/town" matches value "va\"lue3" @javascript Scenario: Nasty strings with other contents - When I fill in "First name" with "My Firstname $NASTYSTRING1" - And I fill the moodle form with: + When I set the field "First name" to "My Firstname $NASTYSTRING1" + And I set the following fields to these values: | Surname | My Surname $NASTYSTRING2 | And I press "Update profile" And I follow "Edit profile" Then I should not see "NASTYSTRING" And I should see "My Firstname" And I should see "My Surname" - And the "First name" field should match "My Firstname $NASTYSTRING1" value - And the "Surname" field should match "My Surname $NASTYSTRING2" value + And the field "First name" matches value "My Firstname $NASTYSTRING1" + And the field "Surname" matches value "My Surname $NASTYSTRING2" diff --git a/admin/tool/uploadcourse/tests/behat/create.feature b/admin/tool/uploadcourse/tests/behat/create.feature index c1bf56fb8dc93..60688091aad55 100644 --- a/admin/tool/uploadcourse/tests/behat/create.feature +++ b/admin/tool/uploadcourse/tests/behat/create.feature @@ -30,7 +30,7 @@ Feature: An admin can create courses using a CSV file @javascript Scenario: Creation of existing courses Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filemanager - And I select "Create all, increment shortname if needed" from "Upload mode" + And I set the field "Upload mode" to "Create all, increment shortname if needed" And I click on "Preview" "button" When I click on "Upload courses" "button" Then I should see "Course created" diff --git a/admin/tool/uploadcourse/tests/behat/update.feature b/admin/tool/uploadcourse/tests/behat/update.feature index 4ac4f4ef3e02c..4f115892406b3 100644 --- a/admin/tool/uploadcourse/tests/behat/update.feature +++ b/admin/tool/uploadcourse/tests/behat/update.feature @@ -16,8 +16,8 @@ Feature: An admin can update courses using a CSV file @javascript Scenario: Updating a course fullname Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filemanager - And I select "Only update existing courses" from "Upload mode" - And I select "Update with CSV data only" from "Update mode" + And I set the field "Upload mode" to "Only update existing courses" + And I set the field "Update mode" to "Update with CSV data only" And I click on "Preview" "button" When I click on "Upload courses" "button" Then I should see "Course updated" diff --git a/auth/tests/behat/behat_auth.php b/auth/tests/behat/behat_auth.php index 2ac377c5de69a..e0d623807335f 100644 --- a/auth/tests/behat/behat_auth.php +++ b/auth/tests/behat/behat_auth.php @@ -56,8 +56,8 @@ public function i_log_in_as($username) { // Generic steps (we will prefix them later expanding the navigation dropdown if necessary). $steps = array( new Given('I follow "' . get_string('login') . '"'), - new Given('I fill in "' . get_string('username') . '" with "' . $this->escape($username) . '"'), - new Given('I fill in "' . get_string('password') . '" with "'. $this->escape($username) . '"'), + new Given('I set the field "' . get_string('username') . '" to "' . $this->escape($username) . '"'), + new Given('I set the field "' . get_string('password') . '" to "'. $this->escape($username) . '"'), new Given('I press "' . get_string('login') . '"') ); diff --git a/auth/tests/behat/login.feature b/auth/tests/behat/login.feature index ed5010164ac49..eff7f6fb6b4e0 100644 --- a/auth/tests/behat/login.feature +++ b/auth/tests/behat/login.feature @@ -19,8 +19,8 @@ Feature: Authentication | testuser | testuser | Test | User | moodle@moodlemoodle.com | And I am on homepage When I follow "Log in" - And I fill in "Username" with "testuser" - And I fill in "Password" with "testuser" + And I set the field "Username" to "testuser" + And I set the field "Password" to "testuser" And I press "Log in" Then I should see "You are logged in as" @@ -30,8 +30,8 @@ Feature: Authentication | testuser | testuser | Test | User | moodle@moodlemoodle.com | And I am on homepage When I follow "Log in" - And I fill in "Username" with "testuser" - And I fill in "Password" with "unexisting" + And I set the field "Username" to "testuser" + And I set the field "Password" to "unexisting" And I press "Log in" Then I should see "Invalid login, please try again" diff --git a/backup/util/ui/tests/behat/duplicate_activities.feature b/backup/util/ui/tests/behat/duplicate_activities.feature index 3314372b482cb..8bff1de93c50b 100644 --- a/backup/util/ui/tests/behat/duplicate_activities.feature +++ b/backup/util/ui/tests/behat/duplicate_activities.feature @@ -25,12 +25,12 @@ Feature: Duplicate activities And I wait until section "1" is available And I open "Test database name" actions menu And I click on "Edit settings" "link" in the "Test database name" activity - And I fill the moodle form with: + And I set the following fields to these values: | Name | Original database name | And I press "Save and return to course" And I open "Test database name" actions menu And I click on "Edit settings" "link" in the "Test database name" activity - And I fill the moodle form with: + And I set the following fields to these values: | Name | Duplicated database name | | Description | Duplicated database description | And I press "Save and return to course" diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 8d68ffdd79da4..eb190e4e8f343 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -42,9 +42,9 @@ Feature: Restore Moodle 2 course backups And I should see "Test forum name" And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - And the "id_format" field should match "Topics format" value - And the "Number of sections" field should match "15" value - And the "Course layout" field should match "Show one section per page" value + And the field "id_format" matches value "Topics format" + And the field "Number of sections" matches value "15" + And the field "Course layout" matches value "Show one section per page" And I press "Cancel" @javascript @@ -87,8 +87,8 @@ Feature: Restore Moodle 2 course backups And I should see "Test forum name" And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - And the "id_format" field should match "Topics format" value - And I fill the moodle form with: + And the field "id_format" matches value "Topics format" + And I set the following fields to these values: | id_startdate_day | 1 | | id_startdate_month | January | | id_startdate_year | 2020 | @@ -98,14 +98,14 @@ Feature: Restore Moodle 2 course backups And I should see "Test forum name" And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - And the "id_format" field should match "Weekly format" value - And I fill the moodle form with: + And the field "id_format" matches value "Weekly format" + And I set the following fields to these values: | id_format | Social format | And I press "Save changes" And I should see "An open forum for chatting about anything you want to" And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - And the "id_format" field should match "Social format" value + And the field "id_format" matches value "Social format" And I press "Cancel" @javascript @@ -122,9 +122,9 @@ Feature: Restore Moodle 2 course backups | Overwrite course configuration | Yes | And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - Then the "id_format" field should match "Topics format" value - And the "Number of sections" field should match "15" value - And the "Course layout" field should match "Show one section per page" value + Then the field "id_format" matches value "Topics format" + And the field "Number of sections" matches value "15" + And the field "Course layout" matches value "Show one section per page" And I press "Cancel" And section "3" should be hidden And section "7" should be hidden diff --git a/badges/tests/behat/add_badge.feature b/badges/tests/behat/add_badge.feature index 737149171dbb7..37b534c79a044 100644 --- a/badges/tests/behat/add_badge.feature +++ b/badges/tests/behat/add_badge.feature @@ -13,12 +13,12 @@ Feature: Add badges to the system Given I expand "Site administration" node And I expand "Badges" node And I follow "Badges settings" - And I fill in "Default badge issuer name" with "Test Badge Site" - And I fill in "Default badge issuer contact details" with "testuser@test-badge-site.com" + And I set the field "Default badge issuer name" to "Test Badge Site" + And I set the field "Default badge issuer contact details" to "testuser@test-badge-site.com" And I press "Save changes" When I follow "Add a new badge" - Then the "issuercontact" field should match "testuser@test-badge-site.com" value - And the "issuername" field should match "Test Badge Site" value + Then the field "issuercontact" matches value "testuser@test-badge-site.com" + And the field "issuername" matches value "Test Badge Site" @javascript Scenario: Accessing the badges @@ -31,7 +31,7 @@ Feature: Add badges to the system Given I expand "Site administration" node And I expand "Badges" node And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test Badge | | Description | Test badge description | | issuername | Test Badge Site | diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 582b9fbe96f23..b6ac009ab00a9 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -10,17 +10,17 @@ Feature: Award badges And I expand "Site administration" node And I expand "Badges" node And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Profile Badge | | Description | Test badge description | | issuername | Test Badge Site | | issuercontact | testuser@test-badge-site.com | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I select "Profile completion" from "type" - And I check "First name" - And I check "Email address" - And I check "Phone" + And I set the field "type" to "Profile completion" + And I set the field "First name" to "1" + And I set the field "Email address" to "1" + And I set the field "Phone" to "1" When I press "Save" Then I should see "Profile completion" And I should see "First name" @@ -31,7 +31,7 @@ Feature: Award badges And I expand "My profile settings" node And I follow "Edit profile" And I expand all fieldsets - And I fill in "Phone" with "123456789" + And I set the field "Phone" to "123456789" And I press "Update profile" And I follow "My badges" Then I should see "Profile Badge" @@ -47,22 +47,22 @@ Feature: Award badges And I expand "Site administration" node And I expand "Badges" node And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Site Badge | | Description | Site badge description | | issuername | Tester of site badge | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I select "Manual issue by role" from "type" - And I check "Teacher" + And I set the field "type" to "Manual issue by role" + And I set the field "Teacher" to "1" And I press "Save" And I press "Enable access" And I press "Continue" And I follow "Recipients (0)" And I press "Award badge" - And I select "teacher 1 (teacher1@asd.com)" from "potentialrecipients[]" + And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@asd.com)" And I press "Award badge" - And I select "student 1 (student1@asd.com)" from "potentialrecipients[]" + And I set the field "potentialrecipients[]" to "student 1 (student1@asd.com)" And I press "Award badge" When I follow "Site Badge" Then I should see "Recipients (2)" @@ -91,22 +91,22 @@ Feature: Award badges And I follow "Course 1" And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Course Badge | | Description | Course badge description | | issuername | Tester of course badge | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I select "Manual issue by role" from "type" - And I check "Teacher" + And I set the field "type" to "Manual issue by role" + And I set the field "Teacher" to "1" And I press "Save" And I press "Enable access" And I press "Continue" And I follow "Recipients (0)" And I press "Award badge" - And I select "Student 2 (student2@asd.com)" from "potentialrecipients[]" + And I set the field "potentialrecipients[]" to "Student 2 (student2@asd.com)" And I press "Award badge" - And I select "Student 1 (student1@asd.com)" from "potentialrecipients[]" + And I set the field "potentialrecipients[]" to "Student 1 (student1@asd.com)" When I press "Award badge" And I follow "Course Badge" Then I should see "Recipients (2)" @@ -136,7 +136,7 @@ Feature: Award badges And I follow "Home" And I follow "Course 1" And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save changes" And I turn editing mode on @@ -148,14 +148,14 @@ Feature: Award badges And I follow "Course 1" And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Course Badge | | Description | Course badge description | | issuername | Tester of course badge | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I select "Activity completion" from "type" - And I check "Test assignment name" + And I set the field "type" to "Activity completion" + And I set the field "Test assignment name" to "1" And I press "Save" And I press "Enable access" When I press "Continue" @@ -191,7 +191,7 @@ Feature: Award badges And I follow "Home" And I follow "Course 1" And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save changes" And I turn editing mode on @@ -200,23 +200,23 @@ Feature: Award badges | Description | Submit your online text | | assignsubmission_onlinetext_enabled | 1 | And I follow "Course completion" - And I select "2" from "id_overall_aggregation" + And I set the field "id_overall_aggregation" to "2" And I click on "Condition: Activity completion" "link" - And I check "Assign - Test assignment name" + And I set the field "Assign - Test assignment name" to "1" And I press "Save changes" And I log out And I log in as "teacher1" And I follow "Course 1" And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" And I follow "Add a new badge" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Course Badge | | Description | Course badge description | | issuername | Tester of course badge | And I upload "badges/tests/behat/badge.png" file to "Image" filemanager And I press "Create badge" - And I select "Course completion" from "type" - And I fill the moodle form with: + And I set the field "type" to "Course completion" + And I set the following fields to these values: | grade_2 | 0 | And I press "Save" And I press "Enable access" diff --git a/blocks/tests/behat/behat_blocks.php b/blocks/tests/behat/behat_blocks.php index 056bfbdf034ec..627ab00d13fb5 100644 --- a/blocks/tests/behat/behat_blocks.php +++ b/blocks/tests/behat/behat_blocks.php @@ -46,7 +46,7 @@ class behat_blocks extends behat_base { * @param string $blockname */ public function i_add_the_block($blockname) { - $steps = new Given('I select "' . $this->escape($blockname) . '" from "bui_addblock"'); + $steps = new Given('I set the field "bui_addblock" to "' . $this->escape($blockname) . '"'); // If we are running without javascript we need to submit the form. if (!$this->running_javascript()) { diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature index 3812f69ab78f4..cf0a5c02b5225 100644 --- a/blocks/tests/behat/configure_block_throughout_site.feature +++ b/blocks/tests/behat/configure_block_throughout_site.feature @@ -20,7 +20,7 @@ Feature: Add and configure blocks throughout the site And I add the "Comments" block And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Page contexts | Display throughout the entire site | And I press "Save changes" When I follow "Course 1" @@ -29,7 +29,7 @@ Feature: Add and configure blocks throughout the site And I am on homepage And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Default weight | -10 (first) | And I press "Save changes" And I follow "Course 1" diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index 5f1189dab2723..13e23be1bed08 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -33,7 +33,7 @@ Feature: Block appearances | Name | Test book name | | Description | Test book description | And I follow "Test book name" - And I fill the moodle form with: + And I set the following fields to these values: | Chapter title | Book title | | Content | Book content test test | And I press "Save changes" @@ -44,7 +44,7 @@ Feature: Block appearances And I add the "Comments" block And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Display on page types | Any page | And I press "Save changes" @@ -55,7 +55,7 @@ Feature: Block appearances And I follow "Course 1" And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Display on page types | Any course page | And I press "Save changes" And I follow "Turn editing off" @@ -67,7 +67,7 @@ Feature: Block appearances When I follow "Test book name" And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Visible | No | And I press "Save changes" And I follow "Turn editing off" @@ -77,7 +77,7 @@ Feature: Block appearances And I follow "Turn editing on" And I open the "Comments" blocks action menu And I follow "Configure Comments block" - And I fill the moodle form with: + And I set the following fields to these values: | Visible | Yes | | Region | Right | And I press "Save changes" diff --git a/blocks/tests/behat/return_block_original_state.feature b/blocks/tests/behat/return_block_original_state.feature index af9bce2ef74f7..6a8dd03bf0b8c 100644 --- a/blocks/tests/behat/return_block_original_state.feature +++ b/blocks/tests/behat/return_block_original_state.feature @@ -17,7 +17,7 @@ Feature: The context of a block can always be returned to it's original state. And I click on "Participants" "link" in the "//li[p/span[contains(normalize-space(string(.)), 'Current course')]]" "xpath_element" And I open the "Tags" blocks action menu And I follow "Configure Tags block" - And I fill the moodle form with: + And I set the following fields to these values: | Display on page types | Any page | And I press "Save changes" And I follow "Course 1" @@ -27,7 +27,7 @@ Feature: The context of a block can always be returned to it's original state. And I follow "Assignment1" And I open the "Tags" blocks action menu And I follow "Configure Tags block" - And I fill the moodle form with: + And I set the following fields to these values: | Display on page types | Any assignment module page | And I press "Save changes" And I should see "Tags" in the "Tags" "block" @@ -43,7 +43,7 @@ Feature: The context of a block can always be returned to it's original state. And I should see "Tags" in the "Tags" "block" And I open the "Tags" blocks action menu And I follow "Configure Tags block" - And I fill the moodle form with: + And I set the following fields to these values: | Display on page types | Any page | And I press "Save changes" And I follow "Course 1" diff --git a/blog/tests/behat/comment.feature b/blog/tests/behat/comment.feature index 84501bd204538..4567026f56e0f 100644 --- a/blog/tests/behat/comment.feature +++ b/blog/tests/behat/comment.feature @@ -14,7 +14,7 @@ Feature: Comment on a blog entry And I expand "My profile" node And I expand "Blogs" node And I follow "Add a new entry" - And I fill the moodle form with: + And I set the following fields to these values: | Entry title | Blog post from user 1 | | Blog entry body | User 1 blog post content | And I press "Save changes" @@ -31,10 +31,10 @@ Feature: Comment on a blog entry And I follow "Blog post from user 1" And I should see "User 1 blog post content" And I follow "Comments (0)" - When I fill in "content" with "$My own >nasty< \"string\"!" + When I set the field "content" to "$My own >nasty< \"string\"!" And I follow "Save comment" Then I should see "$My own >nasty< \"string\"!" - And I fill in "content" with "Another $Nasty " + And I set the field "content" to "Another $Nasty " And I follow "Save comment" And I should see "Comments (2)" in the ".comment-link" "css_element" @@ -49,7 +49,7 @@ Feature: Comment on a blog entry And I follow "Blog post from user 1" And I should see "User 1 blog post content" And I follow "Comments (0)" - And I fill in "content" with "$My own >nasty< \"string\"!" + And I set the field "content" to "$My own >nasty< \"string\"!" And I follow "Save comment" When I click on ".comment-delete a" "css_element" # Waiting for the animation to finish. @@ -69,6 +69,6 @@ Feature: Comment on a blog entry And I follow "Site blogs" And I follow "Blog post from user 1" When I follow "Comments (0)" - And I fill in "content" with "$My own >nasty< \"string\"!" + And I set the field "content" to "$My own >nasty< \"string\"!" And I follow "Save comment" Then I should see "$My own >nasty< \"string\"!" diff --git a/calendar/tests/behat/behat_calendar.php b/calendar/tests/behat/behat_calendar.php index 01dc79bfb3378..82cd26a842396 100644 --- a/calendar/tests/behat/behat_calendar.php +++ b/calendar/tests/behat/behat_calendar.php @@ -54,7 +54,7 @@ public function i_create_a_calendar_event_with_form_data($data) { return array( new Given('I follow "' . get_string('monththis', 'calendar') . '"'), new Given('I click on "' . get_string('newevent', 'calendar') .'" "button"'), - new Given('I fill the moodle form with:', $data), + new Given('I set the following fields to these values:', $data), new Given('I press "' . get_string('savechanges') . '"'), new Given('I should see "' . $eventname . '"') ); diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index fc68157a72e1f..858c82616f17f 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -76,7 +76,7 @@ Feature: Perform basic calendar functionality | Event title | Really awesome event! | | Description | Come join this awesome event, sucka! | And I click on "//div[@class='commands']//a[contains(@href, 'edit')]" "xpath_element" - And I fill the moodle form with: + And I set the following fields to these values: | Event title | Mediocre event :( | | Description | Wait, this event isn't that great. | And I press "Save changes" diff --git a/cohort/tests/behat/add_cohort.feature b/cohort/tests/behat/add_cohort.feature index 2021edc289a76..b490ef5504f98 100644 --- a/cohort/tests/behat/add_cohort.feature +++ b/cohort/tests/behat/add_cohort.feature @@ -18,7 +18,7 @@ Feature: Add cohorts of users And I expand "Accounts" node And I follow "Cohorts" And I press "Add" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test cohort name | | Context | System | | Cohort ID | 333 | @@ -46,13 +46,13 @@ Feature: Add cohorts of users @javascript Scenario: Add users to a cohort using a bulk user action When I follow "Bulk user actions" - And I select "Third User" from "Available" + And I set the field "Available" to "Third User" And I press "Add to selection" - And I select "Forth User" from "Available" + And I set the field "Available" to "Forth User" And I press "Add to selection" - And I select "Add to cohort" from "id_action" + And I set the field "id_action" to "Add to cohort" And I press "Go" - And I select "Test cohort name [333]" from "Cohort" + And I set the field "Cohort" to "Test cohort name [333]" And I press "Add to cohort" And I follow "Cohorts" Then I should see "2" in the "#cohorts" "css_element" diff --git a/cohort/tests/behat/behat_cohort.php b/cohort/tests/behat/behat_cohort.php index fc0c85438d83f..adeb88b3b7709 100644 --- a/cohort/tests/behat/behat_cohort.php +++ b/cohort/tests/behat/behat_cohort.php @@ -50,7 +50,7 @@ public function i_add_user_to_cohort_members($user, $cohortidnumber) { $steps = array( new Given('I click on "' . get_string('assign', 'cohort') . '" "link" in the "' . $this->escape($cohortidnumber) . '" "table_row"'), - new Given('I select "' . $this->escape($user) . '" from "' . get_string('potusers', 'cohort') . '"'), + new Given('I set the field "' . get_string('potusers', 'cohort') . '" to "' . $this->escape($user) . '"'), new Given('I press "' . get_string('add') . '"'), new Given('I press "' . get_string('backtocohorts', 'cohort') . '"') ); diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index 98d29827e5ce5..4a240c3e05d54 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -26,7 +26,7 @@ Feature: Allow students to manually mark an activity as complete And I follow "Course 1" And I turn editing mode on And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save changes" When I add a "Forum" to section "1" and I fill the form with: diff --git a/completion/tests/behat/restrict_activity_by_date.feature b/completion/tests/behat/restrict_activity_by_date.feature index 52e7a26a96f93..fc32ad4fa8b00 100644 --- a/completion/tests/behat/restrict_activity_by_date.feature +++ b/completion/tests/behat/restrict_activity_by_date.feature @@ -30,7 +30,7 @@ Feature: Restrict activity availability through date conditions @javascript Scenario: Show activity greyed-out to students when available from date is in future Given I click on "id_availablefrom_enabled" "checkbox" - And I fill the moodle form with: + And I set the following fields to these values: | Assignment name | Test assignment 1 | | Description | This assignment is restricted by date | | assignsubmission_onlinetext_enabled | 1 | @@ -50,7 +50,7 @@ Feature: Restrict activity availability through date conditions @javascript Scenario: Show activity hidden to students when available until date is in past Given I click on "id_availableuntil_enabled" "checkbox" - And I fill the moodle form with: + And I set the following fields to these values: | Assignment name | Test assignment 2 | | Description | This assignment is restricted by date | | assignsubmission_onlinetext_enabled | 1 | diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature index 72154be52e1d9..ac2c410c55a51 100644 --- a/completion/tests/behat/restrict_activity_by_grade.feature +++ b/completion/tests/behat/restrict_activity_by_grade.feature @@ -33,7 +33,7 @@ Feature: Restrict activity availability through grade conditions And I add a "Page" to section "2" And I expand all fieldsets And I click on "id_availablefrom_enabled" "checkbox" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test page name | | Description | Restricted page, till grades in Grade assignment is at least 20% | | Page content | Test page contents | @@ -48,7 +48,7 @@ Feature: Restrict activity availability through grade conditions And "Test page name" activity should be hidden And I follow "Grade assignment" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student submission | And I press "Save changes" And I should see "Submitted for grading" @@ -58,7 +58,7 @@ Feature: Restrict activity availability through grade conditions And I follow "Grade assignment" And I follow "View/grade all submissions" And I click on "Grade Student First" "link" in the "Student First" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Grade | 21 | And I press "Save changes" And I log out diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index 50688011a0204..3bf2d7994f5cd 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -28,7 +28,7 @@ Feature: Restrict sections availability through completion or grade conditions And I follow "Course 1" And I turn editing mode on And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save changes" And I add a "Label" to section "1" and I fill the form with: @@ -76,7 +76,7 @@ Feature: Restrict sections availability through completion or grade conditions And "Test page name" activity should be hidden And I follow "Grade assignment" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student submission | And I press "Save changes" And I should see "Submitted for grading" @@ -86,7 +86,7 @@ Feature: Restrict sections availability through completion or grade conditions And I follow "Grade assignment" And I follow "View/grade all submissions" And I click on "Grade Student First" "link" in the "Student First" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Grade | 21 | And I press "Save changes" And I log out diff --git a/course/tests/behat/activities_group_icons.feature b/course/tests/behat/activities_group_icons.feature index 2fde9985cd6d8..16b9d55f44402 100644 --- a/course/tests/behat/activities_group_icons.feature +++ b/course/tests/behat/activities_group_icons.feature @@ -22,7 +22,7 @@ Feature: Toggle activities groups mode from the course page | Forum name | Test forum name | | Description | Test forum description | And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Group mode | No groups | | Force group mode | No | When I press "Save changes" diff --git a/course/tests/behat/add_activities.feature b/course/tests/behat/add_activities.feature index de34b8483c00a..a452a210d8d19 100644 --- a/course/tests/behat/add_activities.feature +++ b/course/tests/behat/add_activities.feature @@ -32,9 +32,9 @@ Feature: Add activities to courses And I follow "Test name" And I click on "Edit settings" "link" in the "Administration" "block" And I expand all fieldsets - And the "Name" field should match "Test name" value - And the "Entries required for completion" field should match "9" value - And the "Allow comments on entries" field should match "Yes" value + And the field "Name" matches value "Test name" + And the field "Entries required for completion" matches value "9" + And the field "Allow comments on entries" matches value "Yes" @javascript Scenario: Add an activity without the required fields @@ -54,12 +54,12 @@ Feature: Add activities to courses And I should see "Add an activity to section 'Topic 3'" And I add a "Label" to section "2" And I should see "Adding a new Label to Topic 2" - And I fill the moodle form with: + And I set the following fields to these values: | Label text | I'm a label | And I press "Save and return to course" And I add a "Database" to section "3" And I should see "Adding a new Database to Topic 3" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test database name | | Description | Test database description | And I press "Save and return to course" diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index 08d1e2db35435..e1751e059a022 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -102,10 +102,10 @@ public function i_create_a_course_with(TableNode $table) { // Adding a forced wait until editors are loaded as otherwise selenium sometimes tries clicks on the // format field when the editor is being rendered and the click misses the field coordinates. $steps[] = new Given('I expand all fieldsets'); - $steps[] = new Given('I select "' . $formatvalue . '" from "' . $formatfield . '"'); - $steps[] = new Given('I fill the moodle form with:', $table); + $steps[] = new Given('I set the field "' . $formatfield . '" to "' . $formatvalue . '"'); + $steps[] = new Given('I set the following fields to these values:', $table); } else { - $steps[] = new Given('I fill the moodle form with:', $table); + $steps[] = new Given('I set the following fields to these values:', $table); } $steps[] = new Given('I press "' . get_string('savechanges') . '"'); @@ -141,7 +141,7 @@ public function i_add_to_section_and_i_fill_the_form_with($activity, $section, T return array( new Given('I add a "' . $this->escape($activity) . '" to section "' . $this->escape($section) . '"'), - new Given('I fill the moodle form with:', $data), + new Given('I set the following fields to these values:', $data), new Given('I press "' . get_string('savechangesandreturntocourse') . '"') ); } @@ -288,7 +288,7 @@ public function i_edit_the_section_and_i_fill_the_form_with($sectionnumber, Tabl return array( new Given('I edit the section "' . $sectionnumber . '"'), - new Given('I fill the moodle form with:', $data), + new Given('I set the following fields to these values:', $data), new Given('I press "' . get_string('savechanges') . '"') ); } @@ -577,7 +577,7 @@ public function i_change_activity_name_to($activityname, $newactivityname) { $activity = $this->escape($activityname); return array( new Given('I click on "' . get_string('edittitle') . '" "link" in the "' . $activity .'" activity'), - new Given('I fill in "title" with "' . $this->escape($newactivityname) . chr(10) . '"') + new Given('I set the field "title" to "' . $this->escape($newactivityname) . chr(10) . '"') ); } @@ -783,7 +783,7 @@ public function i_duplicate_activity_editing_the_new_copy_with($activityname, Ta $steps[] = new Given('I press "' . get_string('continue') .'"'); $steps[] = new Given('I press "' . get_string('duplicatecontedit') . '"'); } - $steps[] = new Given('I fill the moodle form with:', $data); + $steps[] = new Given('I set the following fields to these values:', $data); $steps[] = new Given('I press "' . get_string('savechangesandreturntocourse') . '"'); return $steps; } @@ -1185,7 +1185,7 @@ public function i_unselect_course_in_the_management_interface($name) { public function i_move_category_to_top_level_in_the_management_interface($name) { $this->i_select_category_in_the_management_interface($name); return array( - new Given('I select "' . coursecat::get(0)->get_formatted_name() . '" from "menumovecategoriesto"'), + new Given('I set the field "menumovecategoriesto" to "' . coursecat::get(0)->get_formatted_name() . '"'), new Given('I press "bulkmovecategories"'), ); } diff --git a/course/tests/behat/category_management.feature b/course/tests/behat/category_management.feature index baed279b41251..18a0b09fa8444 100644 --- a/course/tests/behat/category_management.feature +++ b/course/tests/behat/category_management.feature @@ -33,7 +33,7 @@ Feature: Test category management actions # Redirect And I should see "Edit category settings" And I should see "Cat 1" - And I fill the moodle form with: + And I set the following fields to these values: | Category name | Category 1 (edited) | | Category ID number | CAT1e | And I press "Save changes" @@ -88,7 +88,7 @@ Feature: Test category management actions And I click on "delete" action for "Cat 3" in management category listing # Redirect And I should see "Delete category: Cat 3" - And I fill the moodle form with: + And I set the following fields to these values: | What to do | Move contents to another category | | Move into | Cat 1 | And I press "Delete" @@ -187,7 +187,7 @@ Feature: Test category management actions And I click on "Create new category" "link" in the ".category-listing-actions" "css_element" # Redirect. And I should see "Add new category" - And I fill the moodle form with: + And I set the following fields to these values: | Category name | Test category 2 | | Category ID number | TC2 | And I press "Create category" @@ -199,7 +199,7 @@ Feature: Test category management actions And I click on "createnewsubcategory" action for "Test category 2" in management category listing # Redirect And I should see "Add new category" - And I fill the moodle form with: + And I set the following fields to these values: | Category name | Test category 3 | | Category ID number | TC3 | And I press "Create category" @@ -225,7 +225,7 @@ Feature: Test category management actions And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" And I select category "Cat 2" in the management interface And I select category "Cat 3" in the management interface - And I select "Cat 1" from "menumovecategoriesto" + And I set the field "menumovecategoriesto" to "Cat 1" When I press "bulkmovecategories" # Redirect And I click on category "Cat 1" in the management interface @@ -257,7 +257,7 @@ Feature: Test category management actions And the "movecategoriesto" "select" should be disabled And the "resortcategoriesby" "select" should be disabled And the "resortcoursesby" "select" should be disabled - When I select "allcategories" from "selectsortby" + When I set the field "selectsortby" to "allcategories" Then the "resortcategoriesby" "select" should be enabled And the "resortcoursesby" "select" should be enabled And the "movecategoriesto" "select" should be disabled @@ -265,7 +265,7 @@ Feature: Test category management actions And the "movecategoriesto" "select" should be enabled And the "resortcategoriesby" "select" should be enabled And the "resortcoursesby" "select" should be enabled - And I select "selectedcategories" from "selectsortby" + And I set the field "selectsortby" to "selectedcategories" And the "movecategoriesto" "select" should be enabled And the "resortcategoriesby" "select" should be enabled And the "resortcoursesby" "select" should be enabled diff --git a/course/tests/behat/category_resort.feature b/course/tests/behat/category_resort.feature index 5795413949a20..06deffd3e29b6 100644 --- a/course/tests/behat/category_resort.feature +++ b/course/tests/behat/category_resort.feature @@ -15,8 +15,8 @@ Feature: Test we can resort categories in the management interface. And I log in as "admin" And I go to the courses management page And I should see the "Course categories" management page - And I select "All categories" from "menuselectsortby" - And I select from "menuresortcategoriesby" + And I set the field "menuselectsortby" to "All categories" + And I set the field "menuresortcategoriesby" to And I press "Sort" # Redirect. And I should see the "Course categories" management page @@ -42,8 +42,8 @@ Feature: Test we can resort categories in the management interface. And I click on "Test category" "link" # Redirect. And I should see the "Course categories and courses" management page - And I select "This category" from "menuselectsortby" - And I select from "menuresortcategoriesby" + And I set the field "menuselectsortby" to "This category" + And I set the field "menuresortcategoriesby" to And I press "Sort" # Redirect. And I should see the "Course categories and courses" management page diff --git a/course/tests/behat/course_category_management_listing.feature b/course/tests/behat/course_category_management_listing.feature index d7a96a1f18d4c..2c9d842e36962 100644 --- a/course/tests/behat/course_category_management_listing.feature +++ b/course/tests/behat/course_category_management_listing.feature @@ -245,8 +245,8 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page And I should see the "Course categories" management page - And I select "All categories" from "menuselectsortby" - And I select from "menuresortcategoriesby" + And I set the field "menuselectsortby" to "All categories" + And I set the field "menuresortcategoriesby" to And I press "Sort" # Redirect. And I should see the "Course categories" management page diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 90a911e9967b6..60cd9760fce81 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -58,7 +58,7 @@ Feature: Course activity controls works as expected And I click on "Edit settings" "link" in the "Test forum name 1" activity And I should see "Updating Forum" And I should see "Display description on course page" - And I fill the moodle form with: + And I set the following fields to these values: | Forum name | Just to check that I can edit the name | | Description | Just to check that I can edit the description | | Display description on course page | 1 | diff --git a/course/tests/behat/create_delete_course.feature b/course/tests/behat/create_delete_course.feature index 30999a9932358..f45ca9c5a9c6e 100644 --- a/course/tests/behat/create_delete_course.feature +++ b/course/tests/behat/create_delete_course.feature @@ -18,7 +18,7 @@ Feature: Test we can both create and delete a course. And I should see "Cat 1" in the "#category-listing" "css_element" And I should see "No courses in this category" in the "#course-listing" "css_element" And I click on "Create new course" "link" in the ".course-listing-actions" "css_element" - And I fill the moodle form with: + And I set the following fields to these values: | Course full name | Test course: create a course | | Course short name | TCCAC | | Course ID number | TC3401 | diff --git a/course/tests/behat/edit_settings.feature b/course/tests/behat/edit_settings.feature index f2a811586fa69..68e2ee8878ee5 100644 --- a/course/tests/behat/edit_settings.feature +++ b/course/tests/behat/edit_settings.feature @@ -18,7 +18,7 @@ Feature: Edit course settings And I log in as "teacher1" And I follow "Course 1" When I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Course full name | Edited course fullname | | Course short name | Edited course shortname | | Course summary | Edited course summary | @@ -29,8 +29,8 @@ Feature: Edit course settings And I should see "Edited course fullname" And I should see "Edited course shortname" And I click on "Edit settings" "link" in the "Administration" "block" - And the "Course full name" field should match "Edited course fullname" value - And the "Course short name" field should match "Edited course shortname" value - And the "Course summary" field should match "Edited course summary" value + And the field "Course full name" matches value "Edited course fullname" + And the field "Course short name" matches value "Edited course shortname" + And the field "Course summary" matches value "Edited course summary" And I am on homepage And I should see "Edited course fullname" diff --git a/course/tests/behat/force_group_mode.feature b/course/tests/behat/force_group_mode.feature index 0964f83fd47b9..70e3eac104470 100644 --- a/course/tests/behat/force_group_mode.feature +++ b/course/tests/behat/force_group_mode.feature @@ -24,7 +24,7 @@ Feature: Force group mode in a course @javascript Scenario: Forced group mode using separate groups - Given I fill the moodle form with: + Given I set the following fields to these values: | Group mode | Separate groups | | Force group mode | Yes | When I press "Save changes" @@ -33,7 +33,7 @@ Feature: Force group mode in a course @javascript Scenario: Forced group mode using visible groups - Given I fill the moodle form with: + Given I set the following fields to these values: | Group mode | Visible groups | | Force group mode | Yes | And I press "Save changes" @@ -42,7 +42,7 @@ Feature: Force group mode in a course @javascript Scenario: Forced group mode without groups - Given I fill the moodle form with: + Given I set the following fields to these values: | Group mode | No groups | | Force group mode | Yes | And I press "Save changes" diff --git a/course/tests/behat/max_number_sections.feature b/course/tests/behat/max_number_sections.feature index cb6060ef4c69e..af4edb67b7da6 100644 --- a/course/tests/behat/max_number_sections.feature +++ b/course/tests/behat/max_number_sections.feature @@ -18,9 +18,9 @@ Feature: The maximum number of weeks/topics in a course can be configured @javascript Scenario: The number of sections can be increased and the limits are applied to courses - Given I fill in "Maximum number of sections" with "100" + Given I set the field "Maximum number of sections" to "100" When I press "Save changes" - Then the "Maximum number of sections" field should match "100" value + Then the field "Maximum number of sections" matches value "100" And the "Number of sections" select box should contain "100" And I log out And I log in as "manager1" @@ -34,9 +34,9 @@ Feature: The maximum number of weeks/topics in a course can be configured @javascript Scenario: The number of sections can be reduced to 0 and the limits are applied to courses - Given I fill in "Maximum number of sections" with "0" + Given I set the field "Maximum number of sections" to "0" When I press "Save changes" - Then the "Maximum number of sections" field should match "0" value + Then the field "Maximum number of sections" matches value "0" And the "Number of sections" select box should contain "0" And the "Number of sections" select box should not contain "52" And I log out diff --git a/course/tests/behat/move_activities.feature b/course/tests/behat/move_activities.feature index 4ebee75b625f5..e5115392957ca 100644 --- a/course/tests/behat/move_activities.feature +++ b/course/tests/behat/move_activities.feature @@ -20,7 +20,7 @@ Feature: Activities can be moved between sections And I follow "Delete Recent activity block" And I press "Yes" And I follow "Configure Navigation block" - And I fill the moodle form with: + And I set the following fields to these values: | Visible | Yes | And I press "Save changes" And I add a "Forum" to section "1" and I fill the form with: @@ -34,7 +34,7 @@ Feature: Activities can be moved between sections Scenario: Move activities in the course home with Javascript disabled using paged mode Given I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save changes" When I move "Test forum name" activity to section "2" @@ -43,7 +43,7 @@ Feature: Activities can be moved between sections Scenario: Move activities in a course section with Javascript disabled using paged mode Given I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save changes" And I add a "Forum" to section "1" and I fill the form with: diff --git a/course/tests/behat/move_sections.feature b/course/tests/behat/move_sections.feature index 00574b0698682..8250bf4a07799 100644 --- a/course/tests/behat/move_sections.feature +++ b/course/tests/behat/move_sections.feature @@ -29,7 +29,7 @@ Feature: Sections can be moved Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode Given I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save changes" And I add a "Forum" to section "1" and I fill the form with: @@ -42,7 +42,7 @@ Feature: Sections can be moved Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode Given I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save changes" And I add a "Forum" to section "2" and I fill the form with: diff --git a/course/tests/behat/rename_roles.feature b/course/tests/behat/rename_roles.feature index 7e32a9edbb4f2..9ec9df894d91e 100644 --- a/course/tests/behat/rename_roles.feature +++ b/course/tests/behat/rename_roles.feature @@ -22,7 +22,7 @@ Feature: Rename roles within a course And I log in as "teacher1" And I follow "Course 1" When I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Your word for 'Non-editing teacher' | Tutor | | Your word for 'Student' | Learner | And I press "Save changes" @@ -34,7 +34,7 @@ Feature: Rename roles within a course And the "roleid" select box should contain "Learner" And the "roleid" select box should not contain "Student" And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Your word for 'Non-editing teacher' | | | Your word for 'Student' | | And I press "Save changes" diff --git a/enrol/guest/tests/behat/guest_access.feature b/enrol/guest/tests/behat/guest_access.feature index 24ac17f570c57..67948db02b9e4 100644 --- a/enrol/guest/tests/behat/guest_access.feature +++ b/enrol/guest/tests/behat/guest_access.feature @@ -25,7 +25,7 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al @javascript Scenario: Allow guest access without password - Given I fill the moodle form with: + Given I set the following fields to these values: | Allow guest access | Yes | And I press "Save changes" And I log out @@ -36,7 +36,7 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al @javascript Scenario: Allow guest access with password - Given I fill the moodle form with: + Given I set the following fields to these values: | Allow guest access | Yes | | Password | moodle_rules | And I press "Save changes" @@ -44,7 +44,7 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al And I log in as "student1" When I follow "Course 1" Then I should see "Guest access" - And I fill the moodle form with: + And I set the following fields to these values: | Password | moodle_rules | And I press "Submit" And I should see "Test forum name" diff --git a/enrol/self/tests/behat/self_enrolment.feature b/enrol/self/tests/behat/self_enrolment.feature index 7921ec7322ddd..74d299b2120be 100644 --- a/enrol/self/tests/behat/self_enrolment.feature +++ b/enrol/self/tests/behat/self_enrolment.feature @@ -39,7 +39,7 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe And I log out And I log in as "student1" And I follow "Course 1" - And I fill the moodle form with: + And I set the following fields to these values: | Enrolment key | moodle_rules | And I press "Enrol me" Then I should see "Topic 1" @@ -62,14 +62,14 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe | Use group enrolment keys | Yes | And I follow "Groups" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group 1 | | Enrolment key | testgroupenrolkey | And I press "Save changes" And I log out And I log in as "student1" And I follow "Course 1" - And I fill the moodle form with: + And I set the following fields to these values: | Enrolment key | testgroupenrolkey | And I press "Enrol me" Then I should see "Topic 1" diff --git a/enrol/tests/behat/behat_enrol.php b/enrol/tests/behat/behat_enrol.php index 7e751d517aaba..f3a99ec3e2b31 100644 --- a/enrol/tests/behat/behat_enrol.php +++ b/enrol/tests/behat/behat_enrol.php @@ -52,8 +52,8 @@ public function i_add_enrolment_method_with($enrolmethod, TableNode $table) { return array( new Given('I expand "' . get_string('users', 'admin') . '" node'), new Given('I follow "' . get_string('type_enrol_plural', 'plugin') . '"'), - new Given('I select "' . $this->escape($enrolmethod) . '" from "' . get_string('addinstance', 'enrol') . '"'), - new Given('I fill the moodle form with:', $table), + new Given('I set the field "' . get_string('addinstance', 'enrol') . '" to "' . $this->escape($enrolmethod) . '"'), + new Given('I set the following fields to these values:', $table), new Given('I press "' . get_string('addinstance', 'enrol') . '"') ); } diff --git a/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php b/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php index bef83f91ba60f..4ab11d2158466 100644 --- a/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php +++ b/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php @@ -317,7 +317,7 @@ public function i_grade_by_filling_the_rubric_with(TableNode $rubric) { // First we need to get the textarea name, then we can set the value. $textarea = $this->get_node_in_container('css_element', 'textarea', 'table_row', $name); - $steps[] = new Given('I fill in "' . $textarea->getAttribute('name') . '" with "' . $criterion[1] . '"'); + $steps[] = new Given('I set the field "' . $textarea->getAttribute('name') . '" to "' . $criterion[1] . '"'); } return $steps; diff --git a/grade/grading/form/rubric/tests/behat/edit_rubric.feature b/grade/grading/form/rubric/tests/behat/edit_rubric.feature index 2ff3a9ae3f4ec..7963273ef61d4 100644 --- a/grade/grading/form/rubric/tests/behat/edit_rubric.feature +++ b/grade/grading/form/rubric/tests/behat/edit_rubric.feature @@ -25,7 +25,7 @@ Feature: Rubrics can be created and edited | Grading method | Rubric | When I go to "Test assignment 1 name" advanced grading definition page # Defining a rubric. - And I fill the moodle form with: + And I set the following fields to these values: | Name | Assignment 1 rubric | | Description | Rubric test description | And I define the following rubric: @@ -89,7 +89,7 @@ Feature: Rubrics can be created and edited And I replace "Level 11" rubric level with "Level 11 edited" in "Criterion 1" criterion And I press "Save" And I should see "You are about to save changes to a rubric that has already been used for grading." - And I select "Do not mark for regrade" from "menurubricregrade" + And I set the field "menurubricregrade" to "Do not mark for regrade" And I press "Continue" And I log out # Check that the student still sees the grade. @@ -135,13 +135,13 @@ Feature: Rubrics can be created and edited And I log in as "teacher1" And I follow "Course 1" And I go to "Test assignment 1 name" advanced grading definition page - And I uncheck "Allow users to preview rubric used in the module (otherwise rubric will only become visible after grading)" - And I uncheck "Display rubric description during evaluation" - And I uncheck "Display rubric description to those being graded" - And I uncheck "Display points for each level during evaluation" - And I uncheck "Display points for each level to those being graded" + And I set the field "Allow users to preview rubric used in the module (otherwise rubric will only become visible after grading)" to "" + And I set the field "Display rubric description during evaluation" to "" + And I set the field "Display rubric description to those being graded" to "" + And I set the field "Display points for each level during evaluation" to "" + And I set the field "Display points for each level to those being graded" to "" And I press "Save" - And I select "Do not mark for regrade" from "menurubricregrade" + And I set the field "menurubricregrade" to "Do not mark for regrade" And I press "Continue" And I log out # Students should not see anything. diff --git a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature index 302a12f867a02..582d96f430d9e 100644 --- a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature +++ b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature @@ -25,7 +25,7 @@ Feature: Publish rubrics as templates And I log in as "manager1" And I follow "Course 1" And I go to "Test assignment 1 name" advanced grading definition page - And I fill the moodle form with: + And I set the following fields to these values: | Name | Assignment 1 rubric | | Description | Assignment 1 description | And I define the following rubric: @@ -45,12 +45,12 @@ Feature: Publish rubrics as templates @javascript Scenario: Create a rubric template and reuse it as a teacher, with Javascript enabled - Then the "Description" field should match "

Assignment 1 description

" value + Then the field "Description" matches value "

Assignment 1 description

" And I should see "Criterion 1" And I press "Cancel" Scenario: Create a rubric template and reuse it as a teacher, with Javascript disabled - Then the "Description" field should match "Assignment 1 description" value + Then the field "Description" matches value "Assignment 1 description" # Trying to avoid pointing by id or name as the code internals may change. And "//table[@class='criteria']//textarea[text()='Criterion 1']" "xpath_element" should exists And I press "Cancel" diff --git a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature index 0c3799cccdccf..2769889398f87 100644 --- a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature +++ b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature @@ -22,7 +22,7 @@ Feature: Reuse my rubrics in other activities | Description | Test assignment 1 description | | Grading method | Rubric | And I go to "Test assignment 1 name" advanced grading definition page - And I fill the moodle form with: + And I set the following fields to these values: | Name | Assignment 1 rubric | | Description | Assignment 1 description | And I define the following rubric: diff --git a/grade/grading/tests/behat/behat_grading.php b/grade/grading/tests/behat/behat_grading.php index 3c60cd6c060c4..06fe060d00673 100644 --- a/grade/grading/tests/behat/behat_grading.php +++ b/grade/grading/tests/behat/behat_grading.php @@ -144,7 +144,7 @@ public function i_set_activity_to_use_grading_form($activityname, $templatename) return array( new Given('I go to "' . $this->escape($activityname) . '" advanced grading page'), new Given('I follow "' . $this->escape(get_string('manageactionclone', 'grading')) . '"'), - new Given('I check "' . get_string('searchownforms', 'grading') . '"'), + new Given('I set the field "' . get_string('searchownforms', 'grading') . '" to "1"'), new Given('I click on "' . get_string('search') . '" "button" in the "region-main" "region"'), new Given('I click on "' . $this->escape($usetemplatexpath) . '" "xpath_element" ' . 'in the "' . $this->escape($templatexpath) . '" "xpath_element"'), @@ -174,7 +174,7 @@ public function i_save_the_advanced_grading_form() { */ public function i_complete_the_advanced_grading_form_with_these_values(TableNode $data) { return array( - new Given('I fill the moodle form with:', $data), + new Given('I set the following fields to these values:', $data), new Given('I save the advanced grading form') ); } diff --git a/grade/tests/behat/behat_grade.php b/grade/tests/behat/behat_grade.php index 19b1c3e62f9b7..d410bd602ae25 100644 --- a/grade/tests/behat/behat_grade.php +++ b/grade/tests/behat/behat_grade.php @@ -44,6 +44,6 @@ public function i_give_the_grade($grade, $userfullname, $itemname) { $gradelabel = $userfullname . ' ' . $itemname; $fieldstr = get_string('useractivitygrade', 'gradereport_grader', $gradelabel); - return new Given('I fill in "' . $this->escape($fieldstr) . '" with "' . $grade . '"'); + return new Given('I set the field "' . $this->escape($fieldstr) . '" to "' . $grade . '"'); } } diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 24e54580b87e7..63364570fdb53 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -29,7 +29,7 @@ Feature: We can enter in grades and view reports from the gradebook And I follow "Course 1" And I follow "Test assignment name" When I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | This is a submission | And I press "Save changes" Then I should see "Submitted for grading" @@ -43,7 +43,7 @@ Feature: We can enter in grades and view reports from the gradebook @javascript Scenario: Grade a grade item and ensure the results display correctly in the gradebook - When I select "User report" from "Grade report" + When I set the field "Grade report" to "User report" And the "Grade report" select box should contain "Grader report" And the "Grade report" select box should contain "Outcomes report" And the "Grade report" select box should contain "User report" @@ -53,19 +53,19 @@ Feature: We can enter in grades and view reports from the gradebook And I follow "Course 1" And I follow "Grades" And I should see "80.00" in the "Test assignment name" "table_row" - And I select "Overview report" from "Grade report" + And I set the field "Grade report" to "Overview report" And I should see "80.00" in the "overview-grade" "table" @javascript Scenario: We can add a weighting to a grade item and it is displayed properly in the user report - When I select "Full view" from "Grade report" - And I select "Weighted mean of grades" from "Aggregation" - And I fill the moodle form with: + When I set the field "Grade report" to "Full view" + And I set the field "Aggregation" to "Weighted mean of grades" + And I set the following fields to these values: | Extra credit value for Test assignment name | 0.72 | And I press "Save changes" - And I select "User report" from "Grade report" + And I set the field "Grade report" to "User report" And I follow "Course grade settings" - And I fill the moodle form with: + And I set the following fields to these values: | Show weightings | Show | And I press "Save changes" And I log out diff --git a/group/tests/behat/auto_creation.feature b/group/tests/behat/auto_creation.feature index 9b442a2b25986..081620107e6a6 100644 --- a/group/tests/behat/auto_creation.feature +++ b/group/tests/behat/auto_creation.feature @@ -43,7 +43,7 @@ Feature: Automatic creation of groups @javascript Scenario: Split automatically the course users in groups and add the groups to a new grouping - Given I fill the moodle form with: + Given I set the following fields to these values: | Auto create based on | Number of groups | | Group/member count | 2 | | Grouping of auto-created groups | New grouping | @@ -64,7 +64,7 @@ Feature: Automatic creation of groups @javascript Scenario: Split automatically the course users in groups based on group member count - Given I fill the moodle form with: + Given I set the following fields to these values: | Auto create based on | Members per group | | Group/member count | 4 | | Grouping of auto-created groups | New grouping | @@ -78,7 +78,7 @@ Feature: Automatic creation of groups And I should see "4" in the "Group A" "table_row" And I should see "4" in the "Group B" "table_row" And I should see "2" in the "Group C" "table_row" - And I check "Prevent last small group" + And I set the field "Prevent last small group" to "1" And I press "Preview" And I should see "Group A" in the ".generaltable" "css_element" And I should see "Group B" in the ".generaltable" "css_element" diff --git a/group/tests/behat/create_groups.feature b/group/tests/behat/create_groups.feature index e2ce5920772b8..a9cb6a76f70de 100644 --- a/group/tests/behat/create_groups.feature +++ b/group/tests/behat/create_groups.feature @@ -28,31 +28,31 @@ Feature: Organize students into groups And I expand "Users" node And I follow "Groups" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group 1 | And I press "Save changes" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group 2 | And I press "Save changes" When I add "Student 0 (student0@asd.com)" user to "Group 1" group members And I add "Student 1 (student1@asd.com)" user to "Group 1" group members And I add "Student 2 (student2@asd.com)" user to "Group 2" group members And I add "Student 3 (student3@asd.com)" user to "Group 2" group members - Then I select "Group 1 (2)" from "groups" + Then I set the field "groups" to "Group 1 (2)" And the "members" select box should contain "Student 0" And the "members" select box should contain "Student 1" And the "members" select box should not contain "Student 2" - And I select "Group 2 (2)" from "groups" + And I set the field "groups" to "Group 2 (2)" And the "members" select box should contain "Student 2" And the "members" select box should contain "Student 3" And the "members" select box should not contain "Student 0" And I follow "Participants" - And I select "Group 1" from "Separate groups" + And I set the field "Separate groups" to "Group 1" And I should see "Student 0" And I should see "Student 1" And I should not see "Student 2" - And I select "Group 2" from "Separate groups" + And I set the field "Separate groups" to "Group 2" And I should see "Student 2" And I should see "Student 3" And I should not see "Student 0" @@ -78,14 +78,14 @@ Feature: Organize students into groups And I follow "Groups" When I press "Create group" Then the "idnumber" "field" should be readonly - And I fill the moodle form with: + And I set the following fields to these values: | Group name | The greatest group that never existed | And I press "Save changes" And I should see "The greatest group that never existed" And I follow "Groupings" And I press "Create grouping" And the "idnumber" "field" should be readonly - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Not the greatest grouping, but it's ok! | And I press "Save changes" And I should see "Not the greatest grouping, but it's ok!" diff --git a/group/tests/behat/delete_groups.feature b/group/tests/behat/delete_groups.feature index 239e577402509..e4707839bf5ed 100644 --- a/group/tests/behat/delete_groups.feature +++ b/group/tests/behat/delete_groups.feature @@ -19,21 +19,21 @@ Feature: Automatic deletion of groups and groupings And I expand "Users" node And I follow "Groups" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group (without ID) | And I press "Save changes" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group (with ID) | | Group ID number | An ID | And I press "Save changes" And I follow "Groupings" And I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping (without ID) | And I press "Save changes" And I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping (with ID) | | Grouping ID number | An ID | And I press "Save changes" @@ -41,11 +41,11 @@ Feature: Automatic deletion of groups and groupings @javascript Scenario: Delete groups and groupings with and without ID numbers - Given I select "Group (without ID) (0)" from "groups" + Given I set the field "groups" to "Group (without ID) (0)" And I press "Delete selected group" And I press "Yes" Then the "groups" select box should not contain "Group (without ID) (0)" - And I select "Group (with ID) (0)" from "groups" + And I set the field "groups" to "Group (with ID) (0)" And I press "Delete selected group" And I press "Yes" And the "groups" select box should not contain "Group (with ID) (0)" @@ -68,9 +68,9 @@ Feature: Automatic deletion of groups and groupings And I follow "Course 1" And I expand "Users" node And I follow "Groups" - When I select "Group (with ID) (0)" from "groups" + When I set the field "groups" to "Group (with ID) (0)" Then the "Delete selected group" "button" should be disabled - And I select "Group (without ID) (0)" from "groups" + And I set the field "groups" to "Group (without ID) (0)" And I press "Delete selected group" And I press "Yes" And I should not see "Group (without ID)" diff --git a/group/tests/behat/groups_import.feature b/group/tests/behat/groups_import.feature index fef297a610b7d..d4130bced72a8 100644 --- a/group/tests/behat/groups_import.feature +++ b/group/tests/behat/groups_import.feature @@ -56,25 +56,25 @@ Feature: Importing of groups and groupings And I should see "Group group-noid-1 added successfully" And I should see "Group group-noid-2 added successfully" And I press "Continue" - And I select "group-id-1" from "groups" + And I set the field "groups" to "group-id-1" And I press "Edit group settings" - And the "id_idnumber" field should match "group-id-1" value + And the field "id_idnumber" matches value "group-id-1" And I press "Cancel" - And I select "group-id-2" from "groups" + And I set the field "groups" to "group-id-2" And I press "Edit group settings" - And the "id_idnumber" field should match "group-id-2" value + And the field "id_idnumber" matches value "group-id-2" And I press "Cancel" - And I select "group-id-1-duplicate" from "groups" + And I set the field "groups" to "group-id-1-duplicate" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-noid-1" from "groups" + And I set the field "groups" to "group-noid-1" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-noid-2" from "groups" + And I set the field "groups" to "group-noid-2" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" @javascript @@ -94,23 +94,23 @@ Feature: Importing of groups and groupings When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filemanager And I press "Import groups" And I press "Continue" - Then I select "group-id-1" from "groups" + Then I set the field "groups" to "group-id-1" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-id-2" from "groups" + And I set the field "groups" to "group-id-2" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-id-1-duplicate" from "groups" + And I set the field "groups" to "group-id-1-duplicate" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-noid-1" from "groups" + And I set the field "groups" to "group-noid-1" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" - And I select "group-noid-2" from "groups" + And I set the field "groups" to "group-noid-2" And I press "Edit group settings" - And the "id_idnumber" field should match "" value + And the field "id_idnumber" matches value "" And I press "Cancel" diff --git a/group/tests/behat/id_uniqueness.feature b/group/tests/behat/id_uniqueness.feature index 8c109dfa95409..ee4712430f918 100644 --- a/group/tests/behat/id_uniqueness.feature +++ b/group/tests/behat/id_uniqueness.feature @@ -22,22 +22,22 @@ Feature: Uniqueness of Group ID number @javascript Scenario: Group ID number uniqueness Given I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group 1 | | Group ID number | G1 | And I press "Save changes" When I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group 2 | | Group ID number | G1 | And I press "Save changes" Then I should see "This ID number is already taken" - And I fill the moodle form with: + And I set the following fields to these values: | Group ID number | G2 | And I press "Save changes" - And I select "Group 1 (0)" from "groups" + And I set the field "groups" to "Group 1 (0)" And I press "Edit group settings" - And I fill the moodle form with: + And I set the following fields to these values: | Group ID number | G2 | And I press "Save changes" And I should see "This ID number is already taken" @@ -47,21 +47,21 @@ Feature: Uniqueness of Group ID number Scenario: Grouping ID number uniqueness Given I follow "Groupings" And I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping 1 | | Grouping ID number | GG1 | And I press "Save changes" When I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping 2 | | Grouping ID number | GG1 | And I press "Save changes" Then I should see "This ID number is already taken" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping ID number | GG2 | And I press "Save changes" And I click on "Edit" "link" in the "Grouping 1" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping ID number | GG2 | And I press "Save changes" And I should see "This ID number is already taken" diff --git a/group/tests/behat/update_groups.feature b/group/tests/behat/update_groups.feature index eb927439cd9f8..e3e072f4d5f9f 100644 --- a/group/tests/behat/update_groups.feature +++ b/group/tests/behat/update_groups.feature @@ -19,21 +19,21 @@ Feature: Automatic updating of groups and groupings And I expand "Users" node And I follow "Groups" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group (without ID) | And I press "Save changes" And I press "Create group" - And I fill the moodle form with: + And I set the following fields to these values: | Group name | Group (with ID) | | Group ID number | An ID | And I press "Save changes" And I follow "Groupings" And I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping (without ID) | And I press "Save changes" And I press "Create grouping" - And I fill the moodle form with: + And I set the following fields to these values: | Grouping name | Grouping (with ID) | | Grouping ID number | An ID | And I press "Save changes" @@ -41,28 +41,28 @@ Feature: Automatic updating of groups and groupings @javascript Scenario: Update groups and groupings with ID numbers - Given I select "Group (with ID)" from "groups" + Given I set the field "groups" to "Group (with ID)" And I press "Edit group settings" - And the "idnumber" field should match "An ID" value - And I fill the moodle form with: + And the field "idnumber" matches value "An ID" + And I set the following fields to these values: | Group name | Group (with ID) (updated) | | Group ID number | An ID (updated) | When I press "Save changes" Then I should see "Group (with ID) (updated)" - And I select "Group (with ID) (updated)" from "groups" + And I set the field "groups" to "Group (with ID) (updated)" And I press "Edit group settings" - And the "idnumber" field should match "An ID (updated)" value + And the field "idnumber" matches value "An ID (updated)" And I press "Save changes" And I follow "Groupings" And I click on "Edit" "link" in the "Grouping (with ID)" "table_row" - And the "idnumber" field should match "An ID" value - And I fill the moodle form with: + And the field "idnumber" matches value "An ID" + And I set the following fields to these values: | Grouping name | Grouping (with ID) (updated) | | Grouping ID number | An ID (updated) | And I press "Save changes" And I should see "Grouping (with ID) (updated)" And I click on "Edit" "link" in the "Grouping (with ID) (updated)" "table_row" - And the "idnumber" field should match "An ID (updated)" value + And the field "idnumber" matches value "An ID (updated)" @javascript Scenario: Update groups and groupings with ID numbers without the 'moodle/course:changeidnumber' capability @@ -75,28 +75,28 @@ Feature: Automatic updating of groups and groupings And I follow "Course 1" And I expand "Users" node And I follow "Groups" - And I select "Group (with ID)" from "groups" + And I set the field "groups" to "Group (with ID)" When I press "Edit group settings" Then the "idnumber" "field" should be readonly - And the "idnumber" field should match "An ID" value - And I fill the moodle form with: + And the field "idnumber" matches value "An ID" + And I set the following fields to these values: | Group name | Group (with ID) (updated) | And I press "Save changes" And I should see "Group (with ID) (updated)" - And I select "Group (with ID) (updated)" from "groups" + And I set the field "groups" to "Group (with ID) (updated)" And I press "Edit group settings" And the "idnumber" "field" should be readonly - And the "idnumber" field should match "An ID" value + And the field "idnumber" matches value "An ID" And I press "Save changes" And I follow "Groupings" And I click on "Edit" "link" in the "Grouping (with ID)" "table_row" And the "idnumber" "field" should be readonly - And the "idnumber" field should match "An ID" value - And I fill the moodle form with: + And the field "idnumber" matches value "An ID" + And I set the following fields to these values: | Grouping name | Grouping (with ID) (updated) | And I press "Save changes" And I should see "Grouping (with ID) (updated)" And I click on "Edit" "link" in the "Grouping (with ID) (updated)" "table_row" And the "idnumber" "field" should be readonly - And the "idnumber" field should match "An ID" value + And the field "idnumber" matches value "An ID" diff --git a/message/tests/behat/behat_message.php b/message/tests/behat/behat_message.php index eeb619bcba510..7d042f4100042 100644 --- a/message/tests/behat/behat_message.php +++ b/message/tests/behat/behat_message.php @@ -61,7 +61,7 @@ public function i_send_message_to_user($messagecontent, $userfullname) { '" to "' . $this->escape($userfullname) . '"'); $steps[] = new Given('I press "' . get_string('searchcombined', 'message') . '"'); $steps[] = new Given('I follow "' . $this->escape(get_string('sendmessageto', 'message', $userfullname)) . '"'); - $steps[] = new Given('I fill in "id_message" with "' . $this->escape($messagecontent) . '"'); + $steps[] = new Given('I set the field "id_message" to "' . $this->escape($messagecontent) . '"'); $steps[] = new Given('I press "' . get_string('sendmessage', 'message') . '"'); return $steps; diff --git a/message/tests/behat/block_users.feature b/message/tests/behat/block_users.feature index d998f29915ffc..20acd28267843 100644 --- a/message/tests/behat/block_users.feature +++ b/message/tests/behat/block_users.feature @@ -13,17 +13,17 @@ Feature: Block users from contacting me And I log in as "user1" And I expand "My profile" node And I follow "Messages" - And I fill in "Search people and messages" with "User Two" + And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" When I click on "Block contact" "link" in the "User Two" "table_row" Then the "Message navigation:" select box should contain "Blocked users (1)" - And I select "Blocked users (1)" from "Message navigation:" + And I set the field "Message navigation:" to "Blocked users (1)" And I should see "User Two" And I log out And I log in as "user2" And I expand "My profile" node And I follow "Messages" - And I fill in "Search people and messages" with "User One" + And I set the field "Search people and messages" to "User One" And I press "Search people and messages" And I follow "Send message to User One" And I should see "This user has blocked you from sending messages to them" diff --git a/message/tests/behat/display_history.feature b/message/tests/behat/display_history.feature index 8fb9a7cf9a3f3..054fc84f42031 100644 --- a/message/tests/behat/display_history.feature +++ b/message/tests/behat/display_history.feature @@ -24,7 +24,7 @@ Feature: Message history displays correctly Scenario: View sent messages When I expand "My profile" node And I click on "Messages" "link" in the "Navigation" "block" - And I fill in "Search people and messages" with "User Two" + And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" And I click on "Message history" "link" in the "User Two" "table_row" # The message history link shows all messages. diff --git a/message/tests/behat/manage_contacts.feature b/message/tests/behat/manage_contacts.feature index 268576314a7dc..d3c8ca3bc9278 100644 --- a/message/tests/behat/manage_contacts.feature +++ b/message/tests/behat/manage_contacts.feature @@ -14,7 +14,7 @@ Feature: Manage contacts And I send "Message 2 from user1 to user2" message to "User Two" user And I expand "My profile" node And I click on "Messages" "link" in the "Navigation" "block" - And I fill in "Search people and messages" with "User Two" + And I set the field "Search people and messages" to "User Two" And I press "Search people and messages" When I click on "Add contact" "link" in the "User Two" "table_row" Then I should see "Message 1 from user1 to user2" diff --git a/message/tests/behat/message_participants.feature b/message/tests/behat/message_participants.feature index feeb42b0a50c5..8c41d209100b8 100644 --- a/message/tests/behat/message_participants.feature +++ b/message/tests/behat/message_participants.feature @@ -24,15 +24,15 @@ Feature: An user can message course participants And I follow "Participants" When I click on "input[type='checkbox']" "css_element" in the "Teacher 1" "table_row" And I click on "input[type='checkbox']" "css_element" in the "Student 1" "table_row" - And I select "Send a message" from "With selected users..." - And I fill the moodle form with: + And I set the field "With selected users..." to "Send a message" + And I set the following fields to these values: | messagebody | Here it is, the message content | And I press "Preview" And I press "Send message" And I follow "Home" And I expand "My profile" node And I follow "Messages" - And I select "Recent conversations" from "Message navigation:" + And I set the field "Message navigation:" to "Recent conversations" Then I should see "Here it is, the message content" And I should see "Student 1" And I click on "this conversation" "link" in the "//div[@class='singlemessage'][contains(., 'Teacher 1')]" "xpath_element" diff --git a/message/tests/behat/search_history.feature b/message/tests/behat/search_history.feature index acfa6d467a5bf..49eeaf80b7be0 100644 --- a/message/tests/behat/search_history.feature +++ b/message/tests/behat/search_history.feature @@ -13,7 +13,7 @@ Feature: Users can search their message history When I send "Give me your biscuits" message to "User Two" user And I expand "My profile" node And I click on "Messages" "link" in the "Navigation" "block" - And I fill in "Search people and messages" with "your biscuits" + And I set the field "Search people and messages" to "your biscuits" And I press "Search people and messages" Then I should see "User Two" And I click on "context" "link" in the "User Two" "table_row" diff --git a/mod/assign/tests/behat/allow_another_attempt.feature b/mod/assign/tests/behat/allow_another_attempt.feature index eeaf5f07b7514..3b611ccace31e 100644 --- a/mod/assign/tests/behat/allow_another_attempt.feature +++ b/mod/assign/tests/behat/allow_another_attempt.feature @@ -31,7 +31,7 @@ Feature: In an assignment, students start a new attempt based on their previous And I follow "Course 1" And I follow "Test assignment name" When I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student first submission | And I press "Save changes" And I log out @@ -40,7 +40,7 @@ Feature: In an assignment, students start a new attempt based on their previous And I follow "Test assignment name" And I follow "View/grade all submissions" And I click on "Grade Student 1" "link" in the "Student 1" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Allow another attempt | 1 | And I press "Save changes" And I log out diff --git a/mod/assign/tests/behat/comment_inline.feature b/mod/assign/tests/behat/comment_inline.feature index 0de4a80f82c70..1c7ba3e505763 100644 --- a/mod/assign/tests/behat/comment_inline.feature +++ b/mod/assign/tests/behat/comment_inline.feature @@ -32,7 +32,7 @@ Feature: In an assignment, teachers can edit a students submission inline And I follow "Course 1" And I follow "Test assignment name" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student first submission | And I press "Save changes" And I log out diff --git a/mod/assign/tests/behat/edit_previous_feedback.feature b/mod/assign/tests/behat/edit_previous_feedback.feature index 81f5bfd16cafa..f86ffebb82943 100644 --- a/mod/assign/tests/behat/edit_previous_feedback.feature +++ b/mod/assign/tests/behat/edit_previous_feedback.feature @@ -33,7 +33,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su And I follow "Course 1" And I follow "Test assignment name" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student first submission | And I press "Save changes" And I log out @@ -42,7 +42,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su And I follow "Test assignment name" And I follow "View/grade all submissions" And I click on "Grade Student 2" "link" in the "Student 2" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Grade | 49 | | Feedback comments | I'm the teacher first feedback | | Allow another attempt | Yes | @@ -61,7 +61,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su And I click on "Grade Student 2" "link" in the "Student 2" "table_row" And I click on ".mod-assign-history-link" "css_element" And I follow "Edit the grade and feedback for attempt number 1" - And I fill the moodle form with: + And I set the following fields to these values: | Grade | 50 | | Feedback comments | I'm the teacher second feedback | And I press "Save changes" diff --git a/mod/assign/tests/behat/group_submission.feature b/mod/assign/tests/behat/group_submission.feature index 14872845122dc..1313c3bb61343 100644 --- a/mod/assign/tests/behat/group_submission.feature +++ b/mod/assign/tests/behat/group_submission.feature @@ -41,11 +41,11 @@ Feature: Group assignment submissions And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exists And "//tr[contains(., 'Student 3')][contains(., 'Default group')]" "xpath_element" should exists And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Group mode | Separate groups | And I press "Save and return to course" And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Group mode | Separate groups | And I press "Save changes" And I expand "Users" node @@ -58,7 +58,7 @@ Feature: Group assignment submissions And "//tr[contains(., 'Student 0')][contains(., 'Group 1')]" "xpath_element" should exists And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exists And I should not see "Student 2" - And I select "All participants" from "Separate groups" + And I set the field "Separate groups" to "All participants" And "//tr[contains(., 'Student 0')][contains(., 'Group 1')]" "xpath_element" should exists And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exists And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exists diff --git a/mod/assign/tests/behat/online_submissions.feature b/mod/assign/tests/behat/online_submissions.feature index f66fffc747be2..87d587eed955e 100644 --- a/mod/assign/tests/behat/online_submissions.feature +++ b/mod/assign/tests/behat/online_submissions.feature @@ -30,14 +30,14 @@ Feature: In an assignment, students can add and edit text online And I follow "Course 1" And I follow "Test assignment name" When I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student first submission | And I press "Save changes" Then I should see "Submitted for grading" And I should see "I'm the student first submission" And I should see "Not graded" And I press "Edit submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student second submission | And I press "Save changes" Then I should see "Submitted for grading" diff --git a/mod/assign/tests/behat/prevent_submission_changes.feature b/mod/assign/tests/behat/prevent_submission_changes.feature index e08d86ca10a4f..93fb4846f653f 100644 --- a/mod/assign/tests/behat/prevent_submission_changes.feature +++ b/mod/assign/tests/behat/prevent_submission_changes.feature @@ -30,11 +30,11 @@ Feature: Prevent or allow assignment submission changes And I follow "Course 1" And I follow "Test assignment name" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student submission | And I press "Save changes" And I press "Edit submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student submission and he/she edited me | And I press "Save changes" And I log out @@ -65,7 +65,7 @@ Feature: Prevent or allow assignment submission changes And I follow "Test assignment name" And I should not see "This assignment is not accepting submissions" And I press "Edit submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student submission edited again | And I press "Save changes" And I should see "I'm the student submission edited again" diff --git a/mod/assign/tests/behat/quickgrading.feature b/mod/assign/tests/behat/quickgrading.feature index 41907675345f5..3208f457905f1 100644 --- a/mod/assign/tests/behat/quickgrading.feature +++ b/mod/assign/tests/behat/quickgrading.feature @@ -29,7 +29,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I follow "Edit outcomes" And I press "Add a new outcome" And I press "Continue" - And I fill the moodle form with: + And I set the following fields to these values: | Name | 1337dom scale | | Scale | Noob, Nub, 1337, HaXor | And I press "Save changes" @@ -37,7 +37,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I follow "Outcomes" And I follow "Edit outcomes" And I press "Add a new outcome" - And I fill the moodle form with: + And I set the following fields to these values: | Full name | M8d skillZ! | | Short name | skillZ! | | Scale | 1337dom scale | @@ -55,7 +55,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I follow "Course 1" And I follow "Test assignment name" And I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student1 submission | And I press "Save changes" And I log out @@ -63,7 +63,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I follow "Course 1" And I follow "Test assignment name" When I press "Add submission" - And I fill the moodle form with: + And I set the following fields to these values: | Online text | I'm the student2 submission | And I press "Save changes" And I log out @@ -72,14 +72,14 @@ Feature: In an assignment, teachers grade multiple students on one page And I follow "Test assignment name" And I follow "View/grade all submissions" And I click on "Grade Student 1" "link" in the "Student 1" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Grade out of 100 | 50.0 | | M8d skillZ! | 1337 | | Feedback comments | I'm the teacher first feedback | And I press "Save changes" And I press "Continue" Then I click on "Quick grading" "checkbox" - And I fill in "User grade" with "60.0" + And I set the field "User grade" to "60.0" And I press "Save all quick grading changes" And I should see "The grade changes were saved" And I press "Continue" diff --git a/mod/choice/tests/behat/behat_mod_choice.php b/mod/choice/tests/behat/behat_mod_choice.php index 1cc714c72e265..71598e6934691 100644 --- a/mod/choice/tests/behat/behat_mod_choice.php +++ b/mod/choice/tests/behat/behat_mod_choice.php @@ -51,7 +51,7 @@ public function I_choose_option_from_activity($option, $choiceactivity) { // Escaping again the strings as backslashes have been removed by the automatic transformation. return array( new Given('I follow "' . $this->escape($choiceactivity) . '"'), - new Given('I select "' . $this->escape($option) . '" radio button'), + new Given('I set the field "' . $this->escape($option) . '" to "1"'), new Given('I press "' . get_string('savemychoice', 'choice') . '"') ); } diff --git a/mod/choice/tests/behat/change_response.feature b/mod/choice/tests/behat/change_response.feature index 42c3f0e074749..c373f48c1ade5 100644 --- a/mod/choice/tests/behat/change_response.feature +++ b/mod/choice/tests/behat/change_response.feature @@ -38,7 +38,7 @@ Feature: Teacher can choose whether to allow students to change their choice res And I follow "Course 1" And I follow "Choice name" And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Allow choice to be updated | Yes | And I press "Save and display" And I log out @@ -48,7 +48,7 @@ Feature: Teacher can choose whether to allow students to change their choice res And I should see "Your selection: Option 1" And "Save my choice" "button" should exists And "Remove my choice" "link" should exists - And I select "Option 2" radio button + And I set the field "Option 2" to "1" And I press "Save my choice" And I should see "Your choice has been saved" And I should see "Your selection: Option 2" diff --git a/mod/choice/tests/behat/publish_results.feature b/mod/choice/tests/behat/publish_results.feature index 37bceea269329..4faf35f2887fb 100644 --- a/mod/choice/tests/behat/publish_results.feature +++ b/mod/choice/tests/behat/publish_results.feature @@ -77,7 +77,7 @@ Feature: A teacher can choose one of 4 options for publishing choice results And I follow "Choice 1" And I follow "Edit settings" And I expand all fieldsets - And I fill the moodle form with: + And I set the following fields to these values: | Restrict answering to this time period | 1 | | timeclose[year] | 2010 | And I press "Save and return to course" diff --git a/mod/forum/tests/behat/behat_mod_forum.php b/mod/forum/tests/behat/behat_mod_forum.php index 55b3f61bb897b..95ddeca526d4e 100644 --- a/mod/forum/tests/behat/behat_mod_forum.php +++ b/mod/forum/tests/behat/behat_mod_forum.php @@ -52,7 +52,7 @@ public function i_add_a_forum_discussion_to_forum_with($forumname, TableNode $ta return array( new Given('I follow "' . $this->escape($forumname) . '"'), new Given('I press "' . get_string('addanewdiscussion', 'forum') . '"'), - new Given('I fill the moodle form with:', $table), + new Given('I set the following fields to these values:', $table), new Given('I press "' . get_string('posttoforum', 'forum') . '"'), new Given('I wait to be redirected') ); @@ -72,7 +72,7 @@ public function i_reply_post_from_forum_with($postsubject, $forumname, TableNode new Given('I follow "' . $this->escape($forumname) . '"'), new Given('I follow "' . $this->escape($postsubject) . '"'), new Given('I follow "' . get_string('reply', 'forum') . '"'), - new Given('I fill the moodle form with:', $table), + new Given('I set the following fields to these values:', $table), new Given('I press "' . get_string('posttoforum', 'forum') . '"'), new Given('I wait to be redirected') ); diff --git a/mod/forum/tests/behat/completion_condition_number_discussions.feature b/mod/forum/tests/behat/completion_condition_number_discussions.feature index 94e3daa805745..edca4a5586604 100644 --- a/mod/forum/tests/behat/completion_condition_number_discussions.feature +++ b/mod/forum/tests/behat/completion_condition_number_discussions.feature @@ -26,7 +26,7 @@ Feature: Set a certain number of discussions as a completion condition for a for And I follow "Course 1" And I turn editing mode on And I click on "Edit settings" "link" in the "Administration" "block" - And I fill the moodle form with: + And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save changes" When I add a "Forum" to section "1" and I fill the form with: diff --git a/mod/forum/tests/behat/discussion_display.feature b/mod/forum/tests/behat/discussion_display.feature index a6309f6860c48..c0178dc5d3222 100644 --- a/mod/forum/tests/behat/discussion_display.feature +++ b/mod/forum/tests/behat/discussion_display.feature @@ -41,13 +41,13 @@ Feature: Students can choose from 4 discussion display options and their choice Given I reply "Discussion 1" post from "Test forum name" forum with: | Subject | Reply 2 to discussion 1 | | Message | Discussion contents 1, third message | - When I select "Display replies flat, with oldest first" from "mode" + When I set the field "mode" to "Display replies flat, with oldest first" Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 1, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" And I reply "Discussion 2" post from "Test forum name" forum with: | Subject | Reply 2 to discussion 2 | | Message | Discussion contents 2, third message | - And the "Display mode" field should match "Display replies flat, with oldest first" value + And the field "Display mode" matches value "Display replies flat, with oldest first" And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" @@ -56,13 +56,13 @@ Feature: Students can choose from 4 discussion display options and their choice Given I reply "Discussion 1" post from "Test forum name" forum with: | Subject | Reply 2 to discussion 1 | | Message | Discussion contents 1, third message | - When I select "Display replies flat, with newest first" from "mode" + When I set the field "mode" to "Display replies flat, with newest first" Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 1, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" And I reply "Discussion 2" post from "Test forum name" forum with: | Subject | Reply 2 to discussion 2 | | Message | Discussion contents 2, third message | - And the "Display mode" field should match "Display replies flat, with newest first" value + And the field "Display mode" matches value "Display replies flat, with newest first" And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" @@ -70,12 +70,12 @@ Feature: Students can choose from 4 discussion display options and their choice Scenario: Display replies in threaded form Given I follow "Test forum name" And I follow "Discussion 1" - When I select "Display replies in threaded form" from "mode" + When I set the field "mode" to "Display replies in threaded form" Then I should see "Discussion contents 1, first message" And I should see "Reply 1 to discussion 1" in the "span.forumthread" "css_element" And I follow "Test forum name" And I follow "Discussion 2" - And the "Display mode" field should match "Display replies in threaded form" value + And the field "Display mode" matches value "Display replies in threaded form" And I should see "Discussion contents 2, first message" And I should see "Reply 1 to discussion 2" in the "span.forumthread" "css_element" @@ -83,11 +83,11 @@ Feature: Students can choose from 4 discussion display options and their choice Scenario: Display replies in nested form Given I follow "Test forum name" And I follow "Discussion 1" - When I select "Display replies in nested form" from "mode" + When I set the field "mode" to "Display replies in nested form" Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element" And I follow "Test forum name" And I follow "Discussion 2" - And the "Display mode" field should match "Display replies in nested form" value + And the field "Display mode" matches value "Display replies in nested form" And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" And I should see "Discussion contents 2, second message" in the "div.indent div.forumpost" "css_element" diff --git a/mod/forum/tests/behat/edit_post_student.feature b/mod/forum/tests/behat/edit_post_student.feature index 4b3afcd72a7a7..0d1ce9b9ea277 100644 --- a/mod/forum/tests/behat/edit_post_student.feature +++ b/mod/forum/tests/behat/edit_post_student.feature @@ -18,7 +18,7 @@ Feature: Students can edit or delete their forum posts within a set time limit And I expand "Site administration" node And I expand "Security" node And I follow "Site policies" - And I select "1 minutes" from "Maximum time to edit posts" + And I set the field "Maximum time to edit posts" to "1 minutes" And I press "Save changes" And I am on homepage And I follow "Course 1" @@ -37,7 +37,7 @@ Feature: Students can edit or delete their forum posts within a set time limit Scenario: Edit forum post When I follow "Forum post subject" And I follow "Edit" - And I fill the moodle form with: + And I set the following fields to these values: | Subject | Edited post subject | | Message | Edited post body | And I press "Save changes" diff --git a/mod/forum/tests/behat/edit_post_teacher.feature b/mod/forum/tests/behat/edit_post_teacher.feature index c9e1d57d8977d..d9f98bcb53718 100644 --- a/mod/forum/tests/behat/edit_post_teacher.feature +++ b/mod/forum/tests/behat/edit_post_teacher.feature @@ -52,7 +52,7 @@ Feature: Teachers can edit or delete any forum post And I follow "Test forum name" And I follow "Teacher post subject" And I click on "Edit" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element" - And I fill the moodle form with: + And I set the following fields to these values: | Subject | Edited student subject | And I press "Save changes" And I wait to be redirected diff --git a/mod/glossary/tests/behat/behat_mod_glossary.php b/mod/glossary/tests/behat/behat_mod_glossary.php index b1c9de89b00cf..a4b904c09f5a9 100644 --- a/mod/glossary/tests/behat/behat_mod_glossary.php +++ b/mod/glossary/tests/behat/behat_mod_glossary.php @@ -49,7 +49,7 @@ class behat_mod_glossary extends behat_base { public function i_add_a_glossary_entry_with_the_following_data(TableNode $data) { return array( new Given('I press "' . get_string('addentry', 'mod_glossary') . '"'), - new Given('I fill the moodle form with:', $data), + new Given('I set the following fields to these values:', $data), new Given('I press "' . get_string('savechanges') . '"') ); } @@ -66,7 +66,7 @@ public function i_add_a_glossary_entries_category_named($categoryname) { new Given('I follow "' . get_string('categoryview', 'mod_glossary') . '"'), new Given('I press "' . get_string('editcategories', 'mod_glossary') . '"'), new Given('I press "' . get_string('add').' '.get_string('category', 'glossary') . '"'), - new Given('I fill in "name" with "' . $this->escape($categoryname) . '"'), + new Given('I set the field "name" to "' . $this->escape($categoryname) . '"'), new Given('I press "' . get_string('savechanges') . '"'), new Given('I press "' . get_string('back', 'mod_glossary') . '"') ); diff --git a/mod/glossary/tests/behat/prevent_duplicate_entries.feature b/mod/glossary/tests/behat/prevent_duplicate_entries.feature index ce9d5ec20487c..1eea3a9cdc53c 100644 --- a/mod/glossary/tests/behat/prevent_duplicate_entries.feature +++ b/mod/glossary/tests/behat/prevent_duplicate_entries.feature @@ -27,7 +27,7 @@ Feature: A teacher can choose whether to allow duplicate entries in a glossary | Concept | Unique concept | | Definition | I'm the definition of an unique concept | When I press "Add a new entry" - And I fill the moodle form with: + And I set the following fields to these values: | Concept | Unique concept | | Definition | There is no definition restriction | And I press "Save changes" diff --git a/mod/glossary/tests/behat/search_entries.feature b/mod/glossary/tests/behat/search_entries.feature index 222692f30cb05..42d81601ce7de 100644 --- a/mod/glossary/tests/behat/search_entries.feature +++ b/mod/glossary/tests/behat/search_entries.feature @@ -44,7 +44,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date @javascript Scenario: Search by keyword and browse by alphabet - When I fill in "hook" with "cucumber" + When I set the field "hook" to "cucumber" And I press "Search" Then I should see "Sweet cucumber" And I should see "Search: cucumber" @@ -59,10 +59,10 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date @javascript Scenario: Browse by category When I follow "Browse by category" - And I select "The ones I like" from "Categories" + And I set the field "Categories" to "The ones I like" Then I should see "Sweet cucumber" And I should not see "Sour eggplants" - And I select "All for you" from "Categories" + And I set the field "Categories" to "All for you" And I should see "Sour eggplants" And I should not see "Sweet cucumber" diff --git a/mod/lesson/tests/behat/date_availability.feature b/mod/lesson/tests/behat/date_availability.feature index a69e1e7072f99..345520aa95dc9 100644 --- a/mod/lesson/tests/behat/date_availability.feature +++ b/mod/lesson/tests/behat/date_availability.feature @@ -25,7 +25,7 @@ Feature: A teacher can set available from and deadline dates to access a lesson Given I add a "Lesson" to section "1" And I expand all fieldsets And I click on "id_available_enabled" "checkbox" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test lesson | | available[day] | 1 | | available[month] | January | @@ -35,7 +35,7 @@ Feature: A teacher can set available from and deadline dates to access a lesson And I press "Save and display" And I follow "Test lesson" And I follow "Add a content page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | Description | The first one | @@ -52,7 +52,7 @@ Feature: A teacher can set available from and deadline dates to access a lesson Given I add a "Lesson" to section "1" And I expand all fieldsets And I click on "id_deadline_enabled" "checkbox" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test lesson | | deadline[day] | 1 | | deadline[month] | January | @@ -62,7 +62,7 @@ Feature: A teacher can set available from and deadline dates to access a lesson And I press "Save and display" And I follow "Test lesson" And I follow "Add a content page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | Description | The first one | diff --git a/mod/lesson/tests/behat/lesson_navigation.feature b/mod/lesson/tests/behat/lesson_navigation.feature index 0630bfe03b4f9..66e2208fe8ca3 100644 --- a/mod/lesson/tests/behat/lesson_navigation.feature +++ b/mod/lesson/tests/behat/lesson_navigation.feature @@ -24,14 +24,14 @@ Feature: In a lesson activity, students can navigate through a series of pages i | Name | Test lesson name | And I follow "Test lesson name" And I follow "Add a content page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | id_answer_editor_0 | Next page | | id_jumpto_0 | Next page | And I press "Save page" - And I select "Add a content page" from "qtype" - And I fill the moodle form with: + And I set the field "qtype" to "Add a content page" + And I set the following fields to these values: | Page title | Second page name | | Page contents | Second page contents | | id_answer_editor_0 | Previous page | @@ -41,9 +41,9 @@ Feature: In a lesson activity, students can navigate through a series of pages i And I press "Save page" And I follow "Expanded" And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" - And I select "Numerical" from "Select a question type" + And I set the field "Select a question type" to "Numerical" And I press "Add a question page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | Hardest question ever | | Page contents | 1 + 1? | | id_answer_editor_0 | 2 | @@ -70,7 +70,7 @@ Feature: In a lesson activity, students can navigate through a series of pages i And I should see "Second page contents" And I press "Next page" And I should see "1 + 1?" - And I fill the moodle form with: + And I set the following fields to these values: | Your answer | 1 | And I press "Submit" And I should see "Incorrect answer" @@ -78,7 +78,7 @@ Feature: In a lesson activity, students can navigate through a series of pages i And I should see "Second page name" And I press "Next page" And I should see "1 + 1?" - And I fill the moodle form with: + And I set the following fields to these values: | Your answer | 2 | And I press "Submit" And I should see "Correct answer" diff --git a/mod/lesson/tests/behat/password_protection.feature b/mod/lesson/tests/behat/password_protection.feature index c4c077aba8f6a..5bf65a278de58 100644 --- a/mod/lesson/tests/behat/password_protection.feature +++ b/mod/lesson/tests/behat/password_protection.feature @@ -26,7 +26,7 @@ Feature: A teacher can password protect a lesson | id_password | moodle_rules | And I follow "Test lesson" And I follow "Add a content page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | First page name | | Page contents | First page contents | | Description | The first one | @@ -37,10 +37,10 @@ Feature: A teacher can password protect a lesson When I follow "Test lesson" Then I should see "Test lesson is a password protected lesson" And I should not see "First page contents" - And I fill in "userpassword" with "moodle" + And I set the field "userpassword" to "moodle" And I press "Continue" And I should see "Login failed, please try again..." And I should see "Test lesson is a password protected lesson" - And I fill in "userpassword" with "moodle_rules" + And I set the field "userpassword" to "moodle_rules" And I press "Continue" And I should see "First page contents" diff --git a/mod/lesson/tests/behat/time_limit.feature b/mod/lesson/tests/behat/time_limit.feature index 853fc3526843f..77853ec704cbe 100644 --- a/mod/lesson/tests/behat/time_limit.feature +++ b/mod/lesson/tests/behat/time_limit.feature @@ -26,7 +26,7 @@ Feature: A teacher can set a time limit for a lesson | maxtime | 1 | And I follow "Test lesson" And I follow "Add a content page" - And I fill the moodle form with: + And I set the following fields to these values: | Page title | Lesson page name | | Page contents | Single lesson page contents | | Description | Single button | diff --git a/mod/scorm/tests/behat/add_scorm.feature b/mod/scorm/tests/behat/add_scorm.feature index cd4a089e91f4f..46df99340c382 100644 --- a/mod/scorm/tests/behat/add_scorm.feature +++ b/mod/scorm/tests/behat/add_scorm.feature @@ -21,7 +21,7 @@ Feature: Add scorm activity And I follow "Course 1" And I turn editing mode on And I add a "SCORM package" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Awesome SCORM package | | Description | Description | And I upload "mod/scorm/tests/packages/singlesco_scorm12.zip" file to "Package file" filemanager diff --git a/mod/survey/tests/behat/survey_types.feature b/mod/survey/tests/behat/survey_types.feature index 6bf6afab3730e..6e4b4d6f642ce 100644 --- a/mod/survey/tests/behat/survey_types.feature +++ b/mod/survey/tests/behat/survey_types.feature @@ -24,12 +24,12 @@ Feature: A teacher can set three types of survey activity And I follow "Test survey name" Then I should see "Attitudes Towards Thinking and Learning" And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Survey type | Critical incidents | And I press "Save and display" And I should see "At what moment in class were you most engaged as a learner?" And I follow "Edit settings" - And I fill the moodle form with: + And I set the following fields to these values: | Survey type | COLLES (Preferred and Actual) | And I press "Save and display" And I should see "In this online unit..." diff --git a/mod/wiki/tests/behat/collaborative_individual.feature b/mod/wiki/tests/behat/collaborative_individual.feature index 6cd258c28cad1..d0d133f13168c 100644 --- a/mod/wiki/tests/behat/collaborative_individual.feature +++ b/mod/wiki/tests/behat/collaborative_individual.feature @@ -29,7 +29,7 @@ Feature: A teacher can set a wiki to be collaborative or individual | Wiki mode | Collaborative wiki | And I follow "Collaborative wiki name" And I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Collaborative teacher1 edition | And I press "Save" And I follow "Course 1" @@ -40,7 +40,7 @@ Feature: A teacher can set a wiki to be collaborative or individual | Wiki mode | Individual wiki | And I follow "Individual wiki name" And I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Individual teacher1 edition | And I press "Save" And I log out @@ -49,7 +49,7 @@ Feature: A teacher can set a wiki to be collaborative or individual When I follow "Collaborative wiki name" Then I should see "Collaborative teacher1 edition" And I follow "Edit" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Collaborative student1 edition | And I press "Save" And I should not see "Collaborative teacher1 edition" @@ -58,7 +58,7 @@ Feature: A teacher can set a wiki to be collaborative or individual And I follow "Individual wiki name" And I should not see "Individual teacher1 edition" And I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Individual student1 edition | And I press "Save" And I log out @@ -68,7 +68,7 @@ Feature: A teacher can set a wiki to be collaborative or individual And I should not see "Individual teacher1 edition" And I should not see "Individual student1 edition" And I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Individual student2 edition | And I press "Save" And I log out @@ -80,10 +80,10 @@ Feature: A teacher can set a wiki to be collaborative or individual And I follow "Individual wiki name" And I should see "Individual teacher1 edition" And I should not see "Individual student1 edition" - And I select "Student 1" from "uid" + And I set the field "uid" to "Student 1" And I should see "Individual student1 edition" And I should not see "Individual teacher1 edition" - And I select "Student 2" from "uid" + And I set the field "uid" to "Student 2" And I should see "Individual student2 edition" And I should not see "Individual teacher1 edition" diff --git a/mod/wiki/tests/behat/page_history.feature b/mod/wiki/tests/behat/page_history.feature index 7a7a6a7d11d21..a15bc565fdb96 100644 --- a/mod/wiki/tests/behat/page_history.feature +++ b/mod/wiki/tests/behat/page_history.feature @@ -29,7 +29,7 @@ Feature: A history of each wiki page is available | Wiki mode | Collaborative wiki | And I follow "Test wiki name" And I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | First edition | And I press "Save" And I log out @@ -37,7 +37,7 @@ Feature: A history of each wiki page is available And I follow "Course 1" And I follow "Test wiki name" And I follow "Edit" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Second edition | And I press "Save" And I log out @@ -45,7 +45,7 @@ Feature: A history of each wiki page is available And I follow "Course 1" And I follow "Test wiki name" And I follow "Edit" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Third edition | And I press "Save" And I follow "History" diff --git a/mod/wiki/tests/behat/preview_page.feature b/mod/wiki/tests/behat/preview_page.feature index ce26e8d658fd1..0dfec42c90829 100644 --- a/mod/wiki/tests/behat/preview_page.feature +++ b/mod/wiki/tests/behat/preview_page.feature @@ -29,7 +29,7 @@ Feature: Edited wiki pages may be previewed before saving And I follow "Course 1" And I follow "Test wiki name" When I press "Create page" - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | Student page contents to be previewed | And I press "Preview" Then I expand all fieldsets @@ -41,9 +41,9 @@ Feature: Edited wiki pages may be previewed before saving @javascript Scenario: Page contents preview before saving with Javascript enabled - Then the "HTML format" field should match "

Student page contents to be previewed

" value + Then the field "HTML format" matches value "

Student page contents to be previewed

" And I press "Cancel" Scenario: Page contents preview before saving with Javascript disabled - Then the "HTML format" field should match "Student page contents to be previewed" value + Then the field "HTML format" matches value "Student page contents to be previewed" And I press "Cancel" diff --git a/mod/wiki/tests/behat/wiki_formats.feature b/mod/wiki/tests/behat/wiki_formats.feature index 5d95aabcc3440..035865130fdf5 100644 --- a/mod/wiki/tests/behat/wiki_formats.feature +++ b/mod/wiki/tests/behat/wiki_formats.feature @@ -25,7 +25,7 @@ Feature: There is a choice of formats for editing a wiki page @javascript Scenario: Creole format - When I fill the moodle form with: + When I set the following fields to these values: | Creole format | 1 | And I press "Create page" Then "div.wikieditor-toolbar" "css_element" should exists @@ -33,7 +33,7 @@ Feature: There is a choice of formats for editing a wiki page And I click on "//div[@class='wikieditor-toolbar']/descendant::a[1]" "xpath_element" And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element" And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element" - And the "newcontent" field should match "**Bold text**//Italic text//[[Internal link]]" value + And the field "newcontent" matches value "**Bold text**//Italic text//[[Internal link]]" And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element" And I press "Save" And I should see "Bold textItalic textInternal link" @@ -45,14 +45,14 @@ Feature: There is a choice of formats for editing a wiki page @javascript Scenario: NWiki format - When I fill the moodle form with: + When I set the following fields to these values: | NWiki format | 1 | And I press "Create page" Then "div.wikieditor-toolbar" "css_element" should exists # Click on italic, interal link and H1 And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element" And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element" - And the "newcontent" field should match "'''Italic text'''[[Internal link]]" value + And the field "newcontent" matches value "'''Italic text'''[[Internal link]]" And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element" And I press "Save" And I should see "Italic textInternal link" @@ -64,12 +64,12 @@ Feature: There is a choice of formats for editing a wiki page @javascript Scenario: HTML format - When I fill the moodle form with: + When I set the following fields to these values: | HTML format | 1 | And I press "Create page" Then "#id_newcontent_editor_tbl" "css_element" should exists And ".mce_bold" "css_element" should exists - And I fill the moodle form with: + And I set the following fields to these values: | HTML format | I'm a text | And I press "Save" And I should see "I'm a text" diff --git a/question/tests/behat/behat_question.php b/question/tests/behat/behat_question.php index 540cfc4943f5e..35b2da43fe129 100644 --- a/question/tests/behat/behat_question.php +++ b/question/tests/behat/behat_question.php @@ -61,7 +61,7 @@ public function i_add_a_question_filling_the_form_with($questiontypename, TableN new Given('I press "' . get_string('createnewquestion', 'question') . '"'), new Given('I click on "' . $this->escape($questiontypexpath) . '" "xpath_element"'), new Given('I click on "#chooseqtype_submit" "css_element"'), - new Given('I fill the moodle form with:', $questiondata), + new Given('I set the following fields to these values:', $questiondata), new Given('I press "' . get_string('savechanges') . '"') ); } diff --git a/question/tests/behat/copy_questions.feature b/question/tests/behat/copy_questions.feature index 5de7fa928729c..e529566114a8b 100644 --- a/question/tests/behat/copy_questions.feature +++ b/question/tests/behat/copy_questions.feature @@ -25,7 +25,7 @@ Feature: A teacher can duplicate questions in the question bank And I follow "Course 1" And I follow "Question bank" When I click on "Duplicate" "link" in the "Test question to be copied" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Question name | Duplicated question name | | Question text | Write a lot about duplicating questions | And I press "Save changes" @@ -34,7 +34,7 @@ Feature: A teacher can duplicate questions in the question bank And I should see "Teacher 1" in the ".categoryquestionscontainer tbody tr.r0 .creatorname" "css_element" And I should see "Admin User" in the ".categoryquestionscontainer tbody tr.r1 .creatorname" "css_element" And I click on "Duplicate" "link" in the "Duplicated question name" "table_row" - And the "Question name" field should match "Duplicated question name (copy)" value + And the field "Question name" matches value "Duplicated question name (copy)" And I press "Cancel" Then I should see "Duplicated question name" And I should see "Test question to be copied" diff --git a/question/tests/behat/edit_questions.feature b/question/tests/behat/edit_questions.feature index 9a8d625fc8e40..702ed90cfd1b1 100644 --- a/question/tests/behat/edit_questions.feature +++ b/question/tests/behat/edit_questions.feature @@ -25,7 +25,7 @@ Feature: A teacher can edit questions in the question bank And I follow "Course 1" And I follow "Question bank" When I click on "Edit" "link" in the "Test question to be edited" "table_row" - And I fill the moodle form with: + And I set the following fields to these values: | Question name | Edited question name | | Question text | Write a lot about what you want | And I press "Save changes" @@ -34,7 +34,7 @@ Feature: A teacher can edit questions in the question bank And I should see "Admin User" in the ".categoryquestionscontainer tbody .creatorname" "css_element" And I should see "Teacher 1" in the ".categoryquestionscontainer tbody .modifiername" "css_element" And I click on "Edit" "link" in the "Edited question name" "table_row" - And the "Question name" field should match "Edited question name" value + And the field "Question name" matches value "Edited question name" And I press "Cancel" And I click on "Preview" "link" in the "Edited question name" "table_row" And I switch to "questionpreview" window diff --git a/question/tests/behat/preview_question.feature b/question/tests/behat/preview_question.feature index 17a75856ac867..0923ce4dc7dd2 100644 --- a/question/tests/behat/preview_question.feature +++ b/question/tests/behat/preview_question.feature @@ -26,21 +26,21 @@ Feature: A teacher can preview questions in the question bank | fraction[1] | None | When I click on "Preview" "link" in the "Test question to be previewed" "table_row" And I switch to "questionpreview" window - And I fill the moodle form with: + And I set the following fields to these values: | Whether correct | Shown | | How questions behave | Deferred feedback | And I press "Start again with these options" Then I should see "Not yet answered" - And I fill in "Answer:" with "2" + And I set the field "Answer:" to "2" And I press "Submit and finish" And the state of "How much is 1 + 1" question is shown as "Correct" And I press "Start again" And the state of "How much is 1 + 1" question is shown as "Not yet answered" - And I fill in "Answer:" with "1" + And I set the field "Answer:" to "1" And I press "Submit and finish" And the state of "How much is 1 + 1" question is shown as "Incorrect" And I press "Start again" And I press "Fill in correct responses" - And the "Answer:" field should match "2" value + And the field "Answer:" matches value "2" And I press "Close preview" And I switch to the main window diff --git a/question/tests/behat/question_categories.feature b/question/tests/behat/question_categories.feature index 3d6afe41857c6..3517ecd2a09bb 100644 --- a/question/tests/behat/question_categories.feature +++ b/question/tests/behat/question_categories.feature @@ -19,11 +19,11 @@ Feature: A teacher can put questions in categories in the question bank # Add 2 test categories. And I follow "Question bank" And I follow "Categories" - And I fill the moodle form with: + And I set the following fields to these values: | Name | New Category 1 | | Parent category | Top | And I press "id_submitbutton" - And I fill the moodle form with: + And I set the following fields to these values: | Name | New Category 2 | | Parent category | Top | And I press "id_submitbutton" @@ -35,9 +35,9 @@ Feature: A teacher can put questions in categories in the question bank @javascript Scenario: Move a question between categories via the question page - When I select "New Category 1 (1)" from "category" + When I set the field "category" to "New Category 1 (1)" And I click on "my test question" "checkbox" in the "my test question" "table_row" - And I select "New Category 2" from "menucategory" + And I set the field "menucategory" to "New Category 2" And I press "Move to >>" Then I should see "my test question" And the "category" select box should contain "New Category 2 (1)" @@ -48,7 +48,7 @@ Feature: A teacher can put questions in categories in the question bank Scenario: Move a question between categories via the question settings page When I click on "Edit" "link" in the "my test question" "table_row" And I click on "Use this category" "checkbox" - And I select "New Category 2" from "Save in category" + And I set the field "Save in category" to "New Category 2" And I press "Save changes" Then I should see "my test question" And the "category" select box should contain "New Category 2 (1)" diff --git a/repository/recent/tests/behat/add_recent.feature b/repository/recent/tests/behat/add_recent.feature index 2c4d7ed8a33b0..e11ca44f708f9 100644 --- a/repository/recent/tests/behat/add_recent.feature +++ b/repository/recent/tests/behat/add_recent.feature @@ -19,7 +19,7 @@ Feature: Recent files repository lists the recently used files And I follow "Course 1" And I turn editing mode on When I add a "Folder" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Folder name | | Description | Folder description | And I add "empty.txt" file from "Recent files" to "Files" filemanager diff --git a/repository/tests/behat/cancel_add_file.feature b/repository/tests/behat/cancel_add_file.feature index 682ce59276f03..bb2160307f3ff 100644 --- a/repository/tests/behat/cancel_add_file.feature +++ b/repository/tests/behat/cancel_add_file.feature @@ -18,7 +18,7 @@ Feature: A selected file can be cancelled And I follow "Course 1" And I turn editing mode on When I add a "Folder" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Folder name | | Description | Folder description | And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager diff --git a/repository/tests/behat/create_folders.feature b/repository/tests/behat/create_folders.feature index f7f8938044a18..6f03db2a0fae8 100644 --- a/repository/tests/behat/create_folders.feature +++ b/repository/tests/behat/create_folders.feature @@ -13,7 +13,7 @@ Feature: Create folders in the file manager And I follow "Course 1" And I turn editing mode on And I add a "Folder" to section "0" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Folder resource | | Description | The description | And I create "Folder 1" folder in "Files" filemanager diff --git a/repository/tests/behat/create_shortcut.feature b/repository/tests/behat/create_shortcut.feature index e1a4cec0ead72..e7b2961f70a27 100644 --- a/repository/tests/behat/create_shortcut.feature +++ b/repository/tests/behat/create_shortcut.feature @@ -25,7 +25,7 @@ Feature: Create shortcuts And I follow "Course 1" And I turn editing mode on And I add a "Folder" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test folder | | Description | Test folder description | And I add "empty.txt" file from "Private files" to "Files" filemanager diff --git a/repository/tests/behat/overwrite_file.feature b/repository/tests/behat/overwrite_file.feature index 7338271b8e736..9e528c8a3f7ca 100644 --- a/repository/tests/behat/overwrite_file.feature +++ b/repository/tests/behat/overwrite_file.feature @@ -33,7 +33,7 @@ Feature: Overwrite file feature And I follow "Course 1" And I turn editing mode on And I add a "Folder" to section "1" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Test folder | | Description | Test folder description | And I add "empty.txt" file from "Private files" to "Files" filemanager diff --git a/repository/tests/behat/zip_and_unzip.feature b/repository/tests/behat/zip_and_unzip.feature index aee975350bd1b..b3963c6a112a4 100644 --- a/repository/tests/behat/zip_and_unzip.feature +++ b/repository/tests/behat/zip_and_unzip.feature @@ -13,7 +13,7 @@ Feature: Zip folders and unzip compressed files And I follow "Course 1" And I turn editing mode on And I add a "Folder" to section "0" - And I fill the moodle form with: + And I set the following fields to these values: | Name | Folder resource | | Description | The description | And I create "Folder 1" folder in "Files" filemanager diff --git a/user/tests/behat/edituserpassword.feature b/user/tests/behat/edituserpassword.feature index 706bdd0a1d59e..8bff06662f068 100644 --- a/user/tests/behat/edituserpassword.feature +++ b/user/tests/behat/edituserpassword.feature @@ -13,9 +13,9 @@ Feature: Enable/disable password field based on authentication selected. And I expand "Accounts" node When I follow "Add a new user" Then the "newpassword" "field" should be enabled - And I select "Web services authentication" from "auth" + And I set the field "auth" to "Web services authentication" And the "newpassword" "field" should be disabled - And I select "Email-based self-registration" from "auth" + And I set the field "auth" to "Email-based self-registration" And the "newpassword" "field" should be enabled # We need to cancel/submit a form that has been modified. And I press "Create user"