MDL-76395 lang: Use fixed strings in tests

This commit is contained in:
Víctor Déniz
2022-11-23 12:45:54 +00:00
parent 0487f8ed9a
commit 476474da69
9 changed files with 29 additions and 29 deletions
@@ -32,7 +32,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save and return to course"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -58,7 +58,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save and return to course"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -83,7 +83,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save and return to course"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -112,7 +112,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save changes"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -138,7 +138,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
Then the "Activity or resource" select box should not contain "Previous activity with completion"
# Set Page2 restriction to Previous Activity with completion and delete Page1.
@@ -148,7 +148,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save and return to course"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -170,7 +170,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save changes"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -184,7 +184,7 @@ Feature: Confirm that availability_completion works with previous activity setti
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I click on "Displayed greyed-out if user does not meet this condition • Click to hide" "link"
And I click on "Displayed if student doesn't meet this condition • Click to hide" "link"
And I set the field "Activity or resource" to "Previous activity with completion"
And I press "Save changes"
Then I should see "Not available unless: The previous activity with completion" in the "region-main" "region"
@@ -159,5 +159,5 @@ Feature: availability_grade
# Student sees information about no access to group, with group name in correct language.
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Not available unless: You achieve a required score in A-One"
Then I should see "Not available unless: You achieve higher than a certain score in A-One"
And I should not see "A-Un"
@@ -77,7 +77,7 @@ class condition_test extends \advanced_testcase {
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertMatchesRegularExpression('~achieve a required score.*Test!~', $information);
$this->assertMatchesRegularExpression('~achieve higher than.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
// Min grade (success).
@@ -95,7 +95,7 @@ class condition_test extends \advanced_testcase {
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertMatchesRegularExpression('~get an appropriate score.*Test!~', $information);
$this->assertMatchesRegularExpression('~achieve lower than a certain score in.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
// Max grade (success).
@@ -113,7 +113,7 @@ class condition_test extends \advanced_testcase {
$this->assertFalse($cond->is_available(false, $info, true, $user->id));
$information = $cond->get_description(false, false, $info);
$information = \core_availability\info::format_info($information, $course);
$this->assertMatchesRegularExpression('~get a particular score.*Test!~', $information);
$this->assertMatchesRegularExpression('~achieve a score within a certain range.*Test!~', $information);
$this->assertTrue($cond->is_available(true, $info, true, $user->id));
// Still fail (other end).
@@ -86,13 +86,13 @@ Feature: edit_availability
And I should see "Date" in the "Restrict access" "fieldset"
And ".availability-item .availability-eye img" "css_element" should be visible
And ".availability-item .availability-delete img" "css_element" should be visible
And the "alt" attribute of ".availability-item .availability-eye img" "css_element" should contain "Displayed greyed-out"
And the "alt" attribute of ".availability-item .availability-eye img" "css_element" should contain "Displayed if student"
# Toggle the eye icon.
When I click on ".availability-item .availability-eye img" "css_element"
Then the "alt" attribute of ".availability-item .availability-eye img" "css_element" should contain "Hidden entirely"
When I click on ".availability-item .availability-eye img" "css_element"
Then the "alt" attribute of ".availability-item .availability-eye img" "css_element" should contain "Displayed greyed-out"
Then the "alt" attribute of ".availability-item .availability-eye img" "css_element" should contain "Displayed if student"
# Click the delete button.
When I click on ".availability-item .availability-delete img" "css_element"
@@ -135,7 +135,7 @@ Feature: Allow to mark course as completed without cron for activity completion
And I am on "Completion course" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I follow "Single view"
And I select "Student First" from the "View all the grades of a single user" singleselect
And I select "Student First" from the "Select a user above to view all their grades" singleselect
And I set the field "Override for Test assignment name" to "1"
When I set the following fields to these values:
| Grade for Test assignment name | 10.00 |
@@ -43,7 +43,7 @@ Feature: Restrict activity availability through grade conditions
And I log out
When I am on the "Course 1" course page logged in as student1
Then I should see "Not available unless: You achieve a required score in Grade assignment"
Then I should see "Not available unless: You achieve higher than a certain score in Grade assignment"
And I should see "Test page name"
And "Test page name" "link" should not exist in the "region-main" "region"
And I am on the "Grade assignment" "assign activity" page
@@ -65,4 +65,4 @@ Feature: Restrict activity availability through grade conditions
And I am on the "Course 1" course page logged in as student1
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
And I should not see "Not available unless: You achieve higher than a certain score in Grade assignment"
@@ -78,7 +78,7 @@ Feature: Restrict sections availability through completion or grade conditions
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should see "Not available unless: You achieve a required score in Grade assignment"
Then I should see "Not available unless: You achieve higher than a certain score in Grade assignment"
And "Test page name" activity should be hidden
And I am on the "Grade assignment" "assign activity" page
And I press "Add submission"
@@ -97,4 +97,4 @@ Feature: Restrict sections availability through completion or grade conditions
And I log out
And I am on the "Course 1" Course page logged in as student1
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
And I should not see "Not available unless: You achieve higher than a certain score in Grade assignment"
@@ -42,7 +42,7 @@ Feature: We can bulk insert grades for students in a course
Then the field "Grade for Student 1" matches value "50.00"
And the field "Override for Student 1" matches value "0"
And I set the field "Perform bulk insert" to "1"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I press "Save"
And the field "Grade for Student 1" matches value "50.00"
And the field "Override for Student 1" matches value "0"
@@ -54,7 +54,7 @@ Feature: We can bulk insert grades for students in a course
And the field "Override for Student 4" matches value "1"
And I set the field "For" to "All grades"
And I set the field "Perform bulk insert" to "1"
And I set the field "Insert value" to "2.0"
And I set the field "Insert new grade" to "2.0"
And I press "Save"
And the field "Grade for Student 1" matches value "2.00"
And the field "Override for Student 1" matches value "1"
@@ -77,12 +77,12 @@ Feature: We can bulk insert grades for students in a course
# And I click on "input[title='Dock Navigation block']" "css_element"
# And I click on "input[title='Dock Administration block']" "css_element"
And I follow "Single view for Test assignment two"
And I select "Student 1" from the "View all the grades of a single user" singleselect
And I select "Student 1" from the "Select a user above to view all their grades" singleselect
Then the field "Grade for Test assignment two" matches value "50.00"
And the field "Override for Test assignment two" matches value "0"
And I set the field "For" to "Empty grades"
And I set the field "Perform bulk insert" to "1"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I press "Save"
And the field "Grade for Test assignment two" matches value "50.00"
And the field "Override for Test assignment two" matches value "0"
@@ -98,7 +98,7 @@ Feature: We can bulk insert grades for students in a course
And I navigate to "View > Grader report" in the course gradebook
And I follow "Single view for Test assignment one"
And I set the field "Perform bulk insert" to "1"
When I set the field "Insert value" to "-1"
When I set the field "Insert new grade" to "-1"
And I press "Save"
Then I should see "The grade entered for Test assignment one for Student 1 is less than the minimum allowed"
And I should see "The grade entered for Test assignment one for Student 2 is less than the minimum allowed"
@@ -60,7 +60,7 @@ Feature: We can use Single view
@javascript
Scenario: I can update grades, add feedback and exclude grades.
Given I navigate to "View > Single view" in the course gradebook
And I select "Student" from the "View all the grades of a single user" singleselect
And I select "Student" from the "Select a user above to view all their grades" singleselect
And I set the field "Override for Test assignment one" to "1"
When I set the following fields to these values:
| Grade for Test assignment one | 10.00 |
@@ -86,7 +86,7 @@ Feature: We can use Single view
Then I should see "Grades were set for 2 items"
And the field "Grade for Ann, Jill, Grainne, Beauchamp" matches value "12.05"
And the field "Exclude for Jane, Nina, Niamh, Cholmondely" matches value "1"
And I select "new grade item 1" from the "View a single grade item" singleselect
And I select "new grade item 1" from the "Select a grade item above" singleselect
And I set the field "Grade for Ann, Jill, Grainne, Beauchamp" to "Very good"
And I press "Save"
Then I should see "Grades were set for 1 items"
@@ -97,7 +97,7 @@ Feature: We can use Single view
And I log in as "teacher2"
And I am on "Course 1" course homepage
Given I navigate to "View > Single view" in the course gradebook
And I select "Student" from the "View all the grades of a single user" singleselect
And I select "Student" from the "Select a user above to view all their grades" singleselect
And the "Exclude for Test assignment one" "checkbox" should be disabled
And the "Override for Test assignment one" "checkbox" should be enabled
@@ -112,7 +112,7 @@ Feature: We can use Single view
Given I follow "Single view for Ann, Jill, Grainne, Beauchamp"
Then I should see "Gronya,Beecham"
When I set the field "For" to "All grades"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I set the field "Perform bulk insert" to "1"
And I press "Save"
Then I should see "Grades were set for 6 items"
@@ -124,7 +124,7 @@ Feature: We can use Single view
And I follow "Single view for Ann, Jill, Grainne, Beauchamp"
And I should see "Gronya,Beecham"
When I set the field "For" to "All grades"
And I set the field "Insert value" to "1#25"
And I set the field "Insert new grade" to "1#25"
And I set the field "Perform bulk insert" to "1"
And I press "Save"
Then I should see "Grades were set for 6 items"