Skip to content

Commit

Permalink
MDL-72093 navigation: Update behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Sep 14, 2021
1 parent ecf8e77 commit 7d82108
Show file tree
Hide file tree
Showing 138 changed files with 314 additions and 313 deletions.
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/data_generators.feature
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Feature: Set up contextual data for tests
And I should see "Test assignment description"
And I am on "Course 1" course homepage
And I follow "Test assignment name with scale"
And I follow "Edit settings"
And I follow "Settings"
And the field "Type" matches value "Scale"

@javascript
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/behat/tests/behat/edit_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Feature: Edit capabilities
@javascript
Scenario: Edit permissions escapes role names correctly
When I am on the "C1" "Course" page logged in as "admin"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Your word for 'Teacher' | Teacher >= editing |
| Your word for 'Non-editing teacher' | Teacher < "editing" |
Expand Down
18 changes: 9 additions & 9 deletions admin/tool/behat/tests/behat/get_and_set_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ Feature: Verify that all form fields values can be get and set
And I press "Save"
Then I should see "Student page contents" in the "region-main" "region"
# Select (multi-select) - Checking "I set the field".
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
And the field "Force format" does not match value ""
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
And the field "Force format" does not match value "1"
Expand All @@ -79,7 +79,7 @@ Feature: Verify that all form fields values can be get and set
| Force format | 1 |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
| Force format | 1 |
Expand All @@ -90,7 +90,7 @@ Feature: Verify that all form fields values can be get and set
| Force format | |
And I press "Save and return to course"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
| Force format | |
Expand All @@ -102,7 +102,7 @@ Feature: Verify that all form fields values can be get and set
# 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 navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And the following fields match these values:
| Default format | NWiki |
| Group mode | Separate groups |
Expand Down Expand Up @@ -135,12 +135,12 @@ Feature: Verify that all form fields values can be get and set
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
And the field with xpath "//input[@name='idnumber']" does not match value ""
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And the field "Course ID number" matches value "Course id number"

Scenario: with JS disabled all form fields getters and setters works as expected
Expand Down Expand Up @@ -171,7 +171,7 @@ Feature: Verify that all form fields values can be get and set
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And the field "available[enabled]" matches value "1"
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Behat steps for interacting with form work
When I log in as "admin"
And I am on "Course 1" course homepage
# Just get to any form.
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the field "Course full name" in the "General" "fieldset" to "Frog"
And I set the following fields in the "Appearance" "fieldset" to these values:
| Show activity reports | Yes |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Confirm that conditions on completion no longer cause a bug
# Set up course.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Enable completion tracking" to "Yes"
And I press "Save and display"
Expand Down
6 changes: 3 additions & 3 deletions availability/tests/behat/edit_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: edit_availability
| intro | pageintro |
And I am on "Course 1" course homepage with editing mode on
And I follow "Page1"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
Then "Restrict access" "fieldset" should not exist

Given I am on "Course 1" course homepage
Expand All @@ -60,7 +60,7 @@ Feature: edit_availability
| intro | pageintro |
And I am on "Course 1" course homepage
And I follow "Page2"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
Then "Restrict access" "fieldset" should exist

Given I am on "Course 1" course homepage
Expand Down Expand Up @@ -220,7 +220,7 @@ Feature: edit_availability

# Check the button still works after saving and editing.
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the "Add group/grouping access restriction" "button" should be disabled
And I should see "Grouping" in the "Restrict access" "fieldset"
Expand Down
18 changes: 9 additions & 9 deletions backup/util/ui/tests/behat/restore_moodle2_courses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Restore Moodle 2 course backups
And I should see "Test forum name"
And I should see "Topic 15"
And I should not see "Topic 16"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "id_format" matches value "Topics format"
And I press "Cancel"
Expand Down Expand Up @@ -82,7 +82,7 @@ Feature: Restore Moodle 2 course backups
When I restore "test_backup.mbz" backup into a new course using this options:
Then I should see "Topic 1"
And I should see "Test forum name"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "id_format" matches value "Topics format"
And I set the following fields to these values:
Expand All @@ -94,14 +94,14 @@ Feature: Restore Moodle 2 course backups
And I press "Save and display"
And I should see "1 January - 7 January"
And I should see "Test forum name"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
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 and display"
And I should see "An open forum for chatting about anything you want to"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "id_format" matches value "Social format"
And I press "Cancel"
Expand All @@ -118,7 +118,7 @@ Feature: Restore Moodle 2 course backups
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
| Schema | Overwrite course configuration | Yes |
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Course layout" matches value "Show one section per page"
Expand All @@ -144,7 +144,7 @@ Feature: Restore Moodle 2 course backups
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
| Schema | Overwrite course configuration | No |
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Course short name" matches value "C2"
Expand Down Expand Up @@ -173,7 +173,7 @@ Feature: Restore Moodle 2 course backups
And I navigate to "Restore" in current page administration
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Overwrite course configuration | Yes |
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Course layout" matches value "Show one section per page"
Expand Down Expand Up @@ -202,7 +202,7 @@ Feature: Restore Moodle 2 course backups
And I navigate to "Restore" in current page administration
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Overwrite course configuration | No |
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Course short name" matches value "C2"
Expand Down Expand Up @@ -231,7 +231,7 @@ Feature: Restore Moodle 2 course backups
And I navigate to "Restore" in current page administration
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Overwrite course configuration | No |
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Course short name" matches value "C4"
Expand Down
4 changes: 2 additions & 2 deletions badges/tests/behat/award_badge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Feature: Award badges
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Enable completion tracking | Yes |
And I press "Save and display"
Expand Down Expand Up @@ -261,7 +261,7 @@ Feature: Award badges
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Enable completion tracking | Yes |
And I press "Save and display"
Expand Down
2 changes: 1 addition & 1 deletion badges/tests/behat/award_badge_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: Award badges with separate groups
| teacher2 | CA |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Group mode" to "Separate groups"
And I press "Save and display"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: The activity results block doesn't display student scores for unsupport
| id_config_nameformat | Display full names |
And I press "Save changes"
When I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: The activity results block displays students high scores in group as sc
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: The activity results block displays student in group high scores as sca
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| assignsubmission_file_enabled | 0 |
| id_grade_modgrade_type | Scale |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: The activity results block displays student in visible groups scores
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Group mode | Visible groups |
And I press "Save and return to course"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: The activity results block displays student low scores as scales
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Feature: The activity results block displays students in groups low scores as sc
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Feature: Enable the calendar block in a course and test it's functionality
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_groupmode | Separate groups |
| id_groupmodeforce | Yes |
Expand Down Expand Up @@ -159,7 +159,7 @@ Feature: Enable the calendar block in a course and test it's functionality
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| id_groupmode | Separate groups |
| id_groupmodeforce | Yes |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Enable Block Completion in a course
Scenario: Add the block to a the course where completion is disabled
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Enable completion tracking | No |
And I press "Save and display"
Expand All @@ -40,7 +40,7 @@ Feature: Enable Block Completion in a course
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Enable Block Completion in a course using activity completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
Expand All @@ -45,7 +45,7 @@ Feature: Enable Block Completion in a course using activity completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Feature: Random glossary entry block linking to global glossary
And I log in as "admin"
And I am on "Course 2" course homepage
And I follow "Tips and Tricks"
And I follow "Edit settings"
And I follow "Settings"
And I set the field "globalglossary" to "0"
And I press "Save and return to course"
And I am on "Course 1" course homepage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Course overview block show users their progress on courses

Scenario: User complete activity and verify his progress
Given I am on the "Test choice 1" "choice activity" page logged in as teacher1
And I navigate to "Edit settings" in current page administration
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| id_completionview | 1 |
Expand Down
Loading

0 comments on commit 7d82108

Please sign in to comment.