Skip to content

Commit

Permalink
MDL-80221 lang: Use fixed strings in the tests, too
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Dec 1, 2023
1 parent de4f02d commit 7f67a96
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions admin/tool/uploadcourse/tests/behat/meta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Feature: An admin can create courses with meta enrolments using a CSV file
Given I upload "admin/tool/uploadcourse/tests/fixtures/enrolment_meta.csv" file to "File" filemanager
And I click on "Preview" "button"
And I should see "Unknown meta course shortname"
And I should see "You can not meta link course to itself"
And I should see "You can't add a meta link to the same course."
When I click on "Upload courses" "button"
And I should see "Unknown meta course shortname"
And I should see "You can not meta link course to itself"
And I should see "You can't add a meta link to the same course."
And I should see "Courses created: 1"
And I should see "Courses updated: 0"
And I should see "Courses errors: 2"
Expand Down
2 changes: 1 addition & 1 deletion course/tests/behat/course_request.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: Users can request and approve courses
| Course short name | Mynewcourse |
| Supporting information | pretty please |
And I press "Request a course"
And I should see "Your course request has been saved successfully."
And I should see "Course request submitted."
And I press "Continue"
And I am on course index
And I should not see "My new course"
Expand Down
2 changes: 1 addition & 1 deletion enrol/self/tests/self_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ public function test_edit_instance_validation_group_enrolment_key(): void {
] + (array) $instance, [], $instance, $context);

$this->assertArrayHasKey('password', $errors);
$this->assertEquals('Enrolment key matches an existing group enrolment key', $errors['password']);
$this->assertEquals('This enrolment key is already used as a group enrolment key.', $errors['password']);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions group/tests/behat/backup_restore_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Feature: Backup and restore a course containing groups
| teacher1 | C1 | editingteacher |
And the following "groups" exist:
| name | course | idnumber | visibility | participation |
| Visible to everyone/Participation | C1 | VP | 0 | 1 |
| Visible/Participation | C1 | VP | 0 | 1 |
| Only visible to members/Participation | C1 | MP | 1 | 1 |
| Only see own membership | C1 | O | 2 | 0 |
| Not visible | C1 | N | 3 | 0 |
| Visible to everyone/Non-Participation | C1 | VN | 0 | 0 |
| Visible/Non-Participation | C1 | VN | 0 | 0 |
| Only visible to members/Non-Participation | C1 | MN | 1 | 0 |
And I log in as "admin"
And I backup "Course 1" course using this options:
Expand All @@ -40,9 +40,9 @@ Feature: Backup and restore a course containing groups

Examples:
| group | idnumber | visibility | participation |
| Visible to everyone/Participation | VP | 0 | 1 |
| Visible/Participation | VP | 0 | 1 |
| Only visible to members/Participation | MP | 1 | 1 |
| Only see own membership | O | 2 | 0 |
| Not visible | N | 3 | 0 |
| Visible to everyone/Non-Participation | VN | 0 | 0 |
| Visible/Non-Participation | VN | 0 | 0 |
| Only visible to members/Non-Participation | MN | 1 | 0 |
40 changes: 20 additions & 20 deletions group/tests/behat/private_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Feature: Private groups
| student8 | C1 | student |
And the following "groups" exist:
| name | course | idnumber | visibility | participation |
| Visible to everyone/Participation | C1 | VP | 0 | 1 |
| Visible/Participation | C1 | VP | 0 | 1 |
| Only visible to members/Participation | C1 | MP | 1 | 1 |
| Only see own membership | C1 | O | 2 | 0 |
| Not visible | C1 | N | 3 | 0 |
| Visible to everyone/Non-Participation | C1 | VN | 0 | 0 |
| Visible/Non-Participation | C1 | VN | 0 | 0 |
| Only visible to members/Non-Participation | C1 | MN | 1 | 0 |
And the following "group members" exist:
| user | group |
Expand All @@ -53,54 +53,54 @@ Feature: Private groups
| student7 | O |
| student8 | N |

Scenario: Participants in "Visible to everyone" groups see their membership and other members:
Scenario: Participants in "Visible" groups see their membership and other members:
Given I am on the "C1" "enrolled users" page logged in as "student1"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | No groups |
| Student 3 | No groups |
| Student 4 | No groups |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | No groups |
| Student 7 | No groups |
| Student 8 | No groups |

Scenario: Participants in "Only visible to members" groups see their membership and other members, plus "Visible to everyone"
Scenario: Participants in "Only visible to members" groups see their membership and other members, plus "Visible"
Given I am on the "C1" "enrolled users" page logged in as "student2"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation |
| Student 3 | No groups |
| Student 4 | No groups |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | Only visible to members/Non-Participation, Only visible to members/Participation |
| Student 7 | No groups |
| Student 8 | No groups |

Scenario: Participants in "Only see own membership" groups see their membership but not other members, plus "Visible to everyone"
Scenario: Participants in "Only see own membership" groups see their membership but not other members, plus "Visible"
Given I am on the "C1" "enrolled users" page logged in as "student3"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | No groups |
| Student 3 | Only see own membership |
| Student 4 | No groups |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | No groups |
| Student 7 | No groups |
| Student 8 | No groups |

Scenario: Participants in "Not visible" groups do not see that group, do see "Visible to everyone"
Scenario: Participants in "Not visible" groups do not see that group, do see "Visible"
Given I am on the "C1" "enrolled users" page logged in as "student4"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | No groups |
| Student 3 | No groups |
| Student 4 | No groups |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | No groups |
| Student 7 | No groups |
| Student 8 | No groups |
Expand All @@ -109,11 +109,11 @@ Feature: Private groups
Given I am on the "C1" "enrolled users" page logged in as "teacher1"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation |
| Student 3 | Only see own membership |
| Student 4 | Not visible |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | Only visible to members/Non-Participation, Only visible to members/Participation |
| Student 7 | Only see own membership |
| Student 8 | Not visible |
Expand Down Expand Up @@ -154,10 +154,10 @@ Feature: Private groups
And I click on "Apply filters" "button"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 2 | No groups |
| Student 4 | No groups |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
| Student 6 | No groups |
| Student 7 | No groups |
| Student 8 | No groups |
Expand All @@ -171,6 +171,6 @@ Feature: Private groups
And I click on "Apply filters" "button"
Then the following should exist in the "participants" table:
| First name / Surname | Groups |
| Student 1 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 1 | Visible/Non-Participation, Visible/Participation |
| Student 3 | Only see own membership |
| Student 5 | Visible to everyone/Non-Participation, Visible to everyone/Participation |
| Student 5 | Visible/Non-Participation, Visible/Participation |
4 changes: 2 additions & 2 deletions group/tests/behat/update_groups.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ Feature: Automatic updating of groups and groupings
Given I set the field "groups" to "Group (with ID)"
And I press "Edit group settings"
And "visibility" "select" should exist
And the field "Group membership visibility" matches value "Visible to everyone"
And the field "Group membership visibility" matches value "Visible"
And the "participation" "checkbox" should be enabled
And the field "Show group in dropdown menu for activities in group mode" matches value "1"
When the following "group members" exist:
| user | group |
| teacher1 | An ID |
And I reload the page
Then "visibility" "select" should not exist
And "Visible to everyone" "text" should exist
And "Visible" "text" should exist
And the "participation" "checkbox" should be disabled
And the field "Show group in dropdown menu for activities in group mode" matches value "1"
2 changes: 1 addition & 1 deletion group/tests/reportbuilder/datasource/groups_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function test_datasource_non_default_columns(): void {
$this->assertEquals('G101', $groupidnumber);
$this->assertEquals(format_text($group->description), $groupdescription);
$this->assertEquals('S', $groupenrolmentkey);
$this->assertEquals('Visible to everyone', $groupvisibility);
$this->assertEquals('Visible', $groupvisibility);
$this->assertEquals('Yes', $groupparticipation);
$this->assertEmpty($grouppicture);
$this->assertNotEmpty($grouptimecreated);
Expand Down
4 changes: 2 additions & 2 deletions mod/assign/tests/behat/grading_status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ Feature: View the grading status of an assignment
| Online text | I'm the student's second submission |
And I press "Save changes"
And I log out
# Teacher marks the submission again after noticing the 'Graded - follow-up submission received'.
# Teacher marks the submission again after noticing the 'Graded - resubmitted'.
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I should see "Graded - follow-up submission received" in the "Student 1" "table_row"
And I should see "Graded - resubmitted" in the "Student 1" "table_row"
And I wait "10" seconds
And I click on "Grade" "link" in the "Student 1" "table_row"
And I should see "1 of 1"
Expand Down
4 changes: 2 additions & 2 deletions mod/label/tests/behat/label_name.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Feature: Set label name
And I am on "Test" course homepage
And "Intro Text" activity should be visible
And I am on the "Intro Text" "label activity editing" page logged in as teacher
And I should see "Name" in the "General" "fieldset"
And I set the field "Name" to "Test Label 1"
And I should see "Title in course index" in the "General" "fieldset"
And I set the field "Title in course index" to "Test Label 1"
And I press "Save and return to course"
And I am on "Test" course homepage
Then "Test Label 1" activity should be visible
2 changes: 1 addition & 1 deletion my/tests/behat/welcome.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Feature: Welcome message
And I log out
And I should see "You are not logged in" in the "page-footer" "region"
And I log in as "admin"
Then I should see "Welcome back, Admin!" in the "page-header" "region"
Then I should see "Hi, Admin!" in the "page-header" "region"

0 comments on commit 7f67a96

Please sign in to comment.