Skip to content

Commit

Permalink
MDL-72875 course: Update behat test to use the tertiary nav
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Dias committed Dec 2, 2021
1 parent e0d7dbd commit 3cddee1
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 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 @@ -61,7 +61,7 @@ Feature: Set up contextual data for tests
And I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
And I should see "Group 2"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should see "Grouping 1"
And I should see "Grouping 2"

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 @@ -42,7 +42,7 @@ Feature: Edit capabilities
| mod/forum:editanypost | Prevent |
| mod/forum:addquestion | Allow |
When I set the field "Advanced role override" to "Student (3)"
And I press "Go"
And I click on "Go" "button" in the "div.advancedoverride" "css_element"
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Feature: Basic recycle bin functionality
And I should see "Course 2" in the "#course-listing" "css_element"
And I am on "Course 2" course homepage
And I navigate to "Users > Groups" in current page administration
And I follow "Overview"
And I select "Overview" from the "jump" singleselect
And "Student 1" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group A" "table_row"
And "Student 2" "text" should exist in the "Group B" "table_row"
Expand Down
2 changes: 1 addition & 1 deletion backup/util/ui/tests/behat/import_course.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: Import course's contents into another course
And I navigate to "Users > Permissions" in current page administration
Then I should see "Non-editing teacher (1)"
And I set the field "Advanced role override" to "Non-editing teacher (1)"
And I press "Go"
And I click on "Go" "button" in the "div.advancedoverride" "css_element"
And "enrol/manual:enrol" capability has "Allow" permission

Scenario: Import process without permission option
Expand Down
4 changes: 2 additions & 2 deletions backup/util/ui/tests/behat/import_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Option to include groups and groupings when importing a course to anoth
When I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
And I should see "Group 2"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should see "Grouping 1"
And I should see "Grouping 2"

Expand All @@ -43,6 +43,6 @@ Feature: Option to include groups and groupings when importing a course to anoth
When I navigate to "Users > Groups" in current page administration
Then I should not see "Group 1"
And I should not see "Group 2"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should not see "Grouping 1"
And I should not see "Grouping 2"
2 changes: 1 addition & 1 deletion course/tests/behat/category_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Feature: Test category management actions
# Redirect
And I should see "Assign roles in Category: Cat 1"
And I should see "Please choose a role to assign"
And I click on "Back to Category: Cat 1" "link"
And I click on "Back" "button"
# Redirect
And I should see the "Course categories and courses" management page
And "Cat 1" "link" should exist in the "#category-listing" "css_element"
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/auto_creation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Feature: Automatic creation of groups
And I should see "No" in the "Group messaging" "select"
And I press "Cancel"
# Check groupings.
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should see "Grouping name"
And I click on "Show groups in grouping" "link" in the "Grouping name" "table_row"
And the "removeselect" select box should contain "Group A"
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/create_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Feature: Organize students into groups
| 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 select "Groupings" from the "jump" singleselect
And I press "Create grouping"
And the "idnumber" "field" should be readonly
And I set the following fields to these values:
Expand Down
4 changes: 2 additions & 2 deletions group/tests/behat/custom_fields.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Feature: Custom profile fields in groups
And I navigate to "Users > Groups" in current page administration

# Check the Overview page.
And I follow "Overview"
And I select "Overview" from the "jump" singleselect
And "Robin Hood (user1, fox)" "text" should exist in the "Canines" "table_row"
And "Little John (user2, bear)" "text" should exist in the "No group" "table_row"

# Check the groups page.
And I follow "Groups"
And I select "Groups" from the "jump" singleselect
And I set the field "groups" to "Canines"
And I should see "Robin Hood (user1, fox)"
And I should not see "Little John (user2, bear)"
Expand Down
8 changes: 4 additions & 4 deletions group/tests/behat/delete_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Automatic deletion of groups and groupings
| Group name | Group (with ID) |
| Group ID number | An ID |
And I press "Save changes"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping (without ID) |
Expand All @@ -36,7 +36,7 @@ Feature: Automatic deletion of groups and groupings
| Grouping name | Grouping (with ID) |
| Grouping ID number | An ID |
And I press "Save changes"
And I follow "Groups"
And I select "Groups" from the "jump" singleselect

@javascript
Scenario: Delete groups and groupings with and without ID numbers
Expand All @@ -48,7 +48,7 @@ Feature: Automatic deletion of groups and groupings
And I press "Delete selected group"
And I press "Yes"
And the "groups" select box should not contain "Group (with ID) (0)"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I click on "Delete" "link" in the "Grouping (without ID)" "table_row"
And I press "Yes"
And I should not see "Grouping (without ID)"
Expand All @@ -72,7 +72,7 @@ Feature: Automatic deletion of groups and groupings
And I press "Delete selected group"
And I press "Yes"
And I should not see "Group (without ID)"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And "Delete" "link" should not exist in the "Grouping (with ID)" "table_row"
And I click on "Delete" "link" in the "Grouping (without ID)" "table_row"
And I press "Yes"
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/groups_import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Importing of groups and groupings
And I should see "No" in the "Group messaging" "select"
And I press "Cancel"
# Check groupings
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I should see "Grouping-1"
And I should see "Grouping-2"
And I should see "Grouping-3"
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/id_uniqueness.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Uniqueness of Group ID number
And I press "Cancel"

Scenario: Grouping ID number uniqueness
Given I follow "Groupings"
Given I select "Groupings" from the "jump" singleselect
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping 1 |
Expand Down
2 changes: 1 addition & 1 deletion group/tests/behat/overview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Feature: Group overview
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Users > Groups" in current page administration
And I follow "Overview"
And I select "Overview" from the "jump" singleselect

# Grouping All and Group All filter
When I select "All" from the "Grouping" singleselect
Expand Down
8 changes: 4 additions & 4 deletions group/tests/behat/update_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Automatic updating of groups and groupings
| Group name | Group (with ID) |
| Group ID number | An ID |
And I press "Save changes"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I press "Create grouping"
And I set the following fields to these values:
| Grouping name | Grouping (without ID) |
Expand All @@ -36,7 +36,7 @@ Feature: Automatic updating of groups and groupings
| Grouping name | Grouping (with ID) |
| Grouping ID number | An ID |
And I press "Save changes"
And I follow "Groups"
And I select "Groups" from the "jump" singleselect

@javascript
Scenario: Update groups and groupings with ID numbers
Expand All @@ -52,7 +52,7 @@ Feature: Automatic updating of groups and groupings
And I press "Edit group settings"
And the field "idnumber" matches value "An ID (updated)"
And I press "Save changes"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I click on "Edit" "link" in the "Grouping (with ID)" "table_row"
And the field "idnumber" matches value "An ID"
And I set the following fields to these values:
Expand Down Expand Up @@ -86,7 +86,7 @@ Feature: Automatic updating of groups and groupings
And the "idnumber" "field" should be readonly
And the field "idnumber" matches value "An ID"
And I press "Save changes"
And I follow "Groupings"
And I select "Groupings" from the "jump" singleselect
And I click on "Edit" "link" in the "Grouping (with ID)" "table_row"
And the "idnumber" "field" should be readonly
And the field "idnumber" matches value "An ID"
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/behat/behat_permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function i_override_the_system_permissions_of_role_with($rolename, $table
);

if (!$this->running_javascript()) {
$this->execute("behat_general::i_click_on_in_the", [get_string('go'), 'button', 'region-main', 'region']);
$this->execute("behat_general::i_click_on_in_the", [get_string('go'), 'button', "div.advancedoverride", 'css_element']);
}

$this->execute("behat_permissions::i_fill_the_capabilities_form_with_the_following_permissions", $table);
Expand Down

0 comments on commit 3cddee1

Please sign in to comment.