From 476474da69e1667e7b5d924d2e6d8b868e5839cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20D=C3=A9niz?= Date: Wed, 23 Nov 2022 00:24:50 +0000 Subject: [PATCH] MDL-76395 lang: Use fixed strings in tests --- .../availability_completion_previous.feature | 16 ++++++++-------- .../grade/tests/behat/availability_grade.feature | 2 +- .../condition/grade/tests/condition_test.php | 6 +++--- .../tests/behat/edit_availability.feature | 4 ++-- .../behat/activity_completion_criteria.feature | 2 +- .../behat/restrict_activity_by_grade.feature | 4 ++-- .../behat/restrict_section_availability.feature | 4 ++-- .../tests/behat/bulk_insert_grades.feature | 10 +++++----- .../singleview/tests/behat/singleview.feature | 10 +++++----- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/availability/condition/completion/tests/behat/availability_completion_previous.feature b/availability/condition/completion/tests/behat/availability_completion_previous.feature index bf3848f319b..d80acaab947 100644 --- a/availability/condition/completion/tests/behat/availability_completion_previous.feature +++ b/availability/condition/completion/tests/behat/availability_completion_previous.feature @@ -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" diff --git a/availability/condition/grade/tests/behat/availability_grade.feature b/availability/condition/grade/tests/behat/availability_grade.feature index 74e5915633c..662f068cafc 100644 --- a/availability/condition/grade/tests/behat/availability_grade.feature +++ b/availability/condition/grade/tests/behat/availability_grade.feature @@ -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" diff --git a/availability/condition/grade/tests/condition_test.php b/availability/condition/grade/tests/condition_test.php index 0cf0cd27a2e..28c0b35b0e0 100644 --- a/availability/condition/grade/tests/condition_test.php +++ b/availability/condition/grade/tests/condition_test.php @@ -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). diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index 7ae4b195bcb..d88bd12c33a 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -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" diff --git a/completion/tests/behat/activity_completion_criteria.feature b/completion/tests/behat/activity_completion_criteria.feature index 2f4a31e9d6c..7c6079370a8 100644 --- a/completion/tests/behat/activity_completion_criteria.feature +++ b/completion/tests/behat/activity_completion_criteria.feature @@ -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 | diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature index 196bbfa814b..ff1aad546fb 100644 --- a/completion/tests/behat/restrict_activity_by_grade.feature +++ b/completion/tests/behat/restrict_activity_by_grade.feature @@ -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" diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index 308beac0fce..216c3411cde 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -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" diff --git a/grade/report/singleview/tests/behat/bulk_insert_grades.feature b/grade/report/singleview/tests/behat/bulk_insert_grades.feature index bf135cf64c6..3b87b92c457 100644 --- a/grade/report/singleview/tests/behat/bulk_insert_grades.feature +++ b/grade/report/singleview/tests/behat/bulk_insert_grades.feature @@ -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" diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index c3ceb4d29be..a6fe348d759 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -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"