MDL-76395 lang: Use fixed strings in tests

This commit is contained in:
Víctor Déniz
2022-11-23 17:03:58 +00:00
parent 74828e8149
commit d4de7b630e
15 changed files with 59 additions and 59 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"
@@ -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"
@@ -67,7 +67,7 @@ Feature: We can bulk insert grades for students in a course
And I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "Empty grades" "radio"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And the field "Grade for Student 1" matches value "50.00"
And the field "Override for Student 1" matches value "0"
@@ -82,7 +82,7 @@ Feature: We can bulk insert grades for students in a course
When I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "All grades" "radio"
And I set the field "Insert value" to "2.0"
And I set the field "Insert new grade" to "2.0"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And the field "Grade for Student 1" matches value "2.00"
And the field "Override for Student 1" matches value "1"
@@ -109,7 +109,7 @@ Feature: We can bulk insert grades for students in a course
When I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "Empty grades" "radio"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And the field "Grade for Test assignment two" matches value "50.00"
And the field "Override for Test assignment two" matches value "0"
@@ -127,7 +127,7 @@ Feature: We can bulk insert grades for students in a course
When I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "Empty grades" "radio"
And I set the field "Insert value" to "-1"
And I set the field "Insert new grade" to "-1"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
And 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"
@@ -120,7 +120,7 @@ Feature: We can use Single view
And I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "All grades" "radio"
And I set the field "Insert value" to "1.0"
And I set the field "Insert new grade" to "1.0"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
Then I should see "Grades were set for 6 items"
@@ -135,7 +135,7 @@ Feature: We can use Single view
And I click on "Bulk insert" "link"
And I click on "I understand that my unsaved changes will be lost." "checkbox"
And I click on "All grades" "radio"
And I set the field "Insert value" to "1#25"
And I set the field "Insert new grade" to "1#25"
And I click on "Save" "button" in the ".modal-dialog" "css_element"
Then I should see "Grades were set for 6 items"
# Custom scale, cast to int
@@ -32,11 +32,11 @@ Feature: Guest access allows external users to connect to a meeting
When I am on the "RoomRecordings" "bigbluebuttonbn activity editing" page logged in as "admin"
Then I should see "Guest access"
Then I click on "Expand all" "link"
Then I should see "Allow guest access in the meeting"
Then I should see "Allow guest access"
And I should not see "Meeting link"
And I should not see "Meeting password"
When I set the field "Allow guest access in the meeting" to "1"
Then I should see "User must be approved by moderators"
When I set the field "Allow guest access" to "1"
Then I should see "Guests joining must be admitted by a moderator"
And I should see "Meeting link"
And I should see "Meeting password"
And I should see "Copy link"
@@ -54,10 +54,10 @@ Feature: Guest access allows external users to connect to a meeting
And I should see "Meeting password"
And I should see "Copy link"
And I should see "Copy password"
When I set the field "Add guests emails" to "123"
When I set the field "Guest emails" to "123"
When I click on "OK" "button" in the "Add guests to this meeting" "dialogue"
Then I should see "The email 123 is invalid, please correct it."
When I set the field "Add guests emails" to "testuser@email.com"
Then I should see "Invalid email: 123"
When I set the field "Guest emails" to "testuser@email.com"
When I click on "OK" "button" in the "Add guests to this meeting" "dialogue"
Then I should see "An invitation will be sent to guest(s) testuser@email.com via email."
Then I should see "An invitation will be sent to testuser@email.com."
Then I log out
@@ -57,7 +57,7 @@ class send_guest_emails_test extends advanced_testcase {
$messages = $emailsink->get_messages();
$this->assertCount(2, $messages);
$this->assertEquals('You have been invited to the session BigBlueButton 1 on Test course 1 !', $messages[0]->subject);
$this->assertEquals('Invitation: BigBlueButton 1 session in Test course 1', $messages[0]->subject);
$this->assertEquals('[email protected]', $messages[0]->from);
$this->assertEquals('[email protected]', $messages[0]->to);
$this->assertEquals('[email protected]', $messages[1]->to);
+11 -11
View File
@@ -92,13 +92,13 @@ Feature: Users can view and manage data presets
And I follow "Templates"
When I click on "Actions" "button"
And I choose "Publish preset on this site" in the open action menu
Then I should see "Name" in the "Save all fields and templates as preset" "dialogue"
And I should see "Description" in the "Save all fields and templates as preset" "dialogue"
Then I should see "Name" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "Description" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And "Replace existing preset with this name and overwrite its contents" "checkbox" should not be visible
# Teacher should be able to save preset.
And I set the field "Name" to "New saved preset"
And I set the field "Description" to "My funny description goes here."
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "Preset saved."
And I follow "Presets"
And I should see "New saved preset"
@@ -108,20 +108,20 @@ Feature: Users can view and manage data presets
And I click on "Actions" "button"
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "Saved preset 1"
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "A preset with this name already exists. Choose a different name."
And "Replace existing preset with this name and overwrite its contents" "checkbox" should not be visible
# Teacher can overwrite existing presets created by them, but they are not overwritten if the checkbox is not marked.
And I set the field "Name" to "New saved preset"
And I set the field "Description" to "This is a new description that shouldn't be saved."
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "A preset with this name already exists."
And "Replace existing preset with this name and overwrite its contents" "checkbox" should be visible
# Confirm the checkbox is still displayed and nothing happens if it's not checked and no change is done in the name.
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "A preset with this name already exists."
And "Replace existing preset with this name and overwrite its contents" "checkbox" should be visible
And I click on "Cancel" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Cancel" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I follow "Presets"
And I should see "New saved preset"
And I should see "My funny description goes here." in the "New saved preset" "table_row"
@@ -132,11 +132,11 @@ Feature: Users can view and manage data presets
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "New saved preset"
And I set the field "Description" to "This is a new description that will be overwritten."
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "A preset with this name already exists."
And "Replace existing preset with this name and overwrite its contents" "checkbox" should be visible
And I click on "Replace existing preset with this name and overwrite its contents" "checkbox" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Replace existing preset with this name and overwrite its contents" "checkbox" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "Preset saved."
And I follow "Presets"
And I should see "New saved preset"
@@ -282,7 +282,7 @@ Feature: Users can view and manage data presets
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "New saved preset"
And I set the field "Description" to "My funny description goes here."
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
And I should see "Preset saved"
When I click on "Preview preset" "link"
Then I should see "Preview"
+7 -7
View File
@@ -24,7 +24,7 @@ Feature: Users can import presets
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
Then I should not see "Fields mappings"
Then I should not see "Field mappings"
And I should see "Image" in the "image" "table_row"
Scenario: Teacher can import from preset page on a database with fields
@@ -36,7 +36,7 @@ Feature: Users can import presets
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
Then I should see "Fields mappings"
Then I should see "Field mappings"
And I should see "image"
And I should see "Create a new field" in the "image" "table_row"
@@ -59,7 +59,7 @@ Feature: Users can import presets
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
Then I should see "Fields mappings"
Then I should see "Field mappings"
And I should see "image"
And I should see "Create a new field" in the "image" "table_row"
@@ -82,7 +82,7 @@ Feature: Users can import presets
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
Then I should see "Fields mappings"
Then I should see "Field mappings"
And I should see "title"
And I should see "Create a new field" in the "title" "table_row"
# We map existing field to keep the entry data
@@ -96,7 +96,7 @@ Feature: Users can import presets
And I click on "Import a preset" "button"
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
Then I should not see "Fields mappings"
Then I should not see "Field mappings"
And I should see "Image" in the "image" "table_row"
Scenario: Importing a preset could create new fields
@@ -152,14 +152,14 @@ Feature: Users can import presets
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
When I click on "Import preset and apply" "button"
And I should see "Fields mappings"
And I should see "Field mappings"
And I click on "Continue" "button"
And I should see "Preset applied"
And I follow "Presets"
And I choose the "Import preset" item in the "Action" action menu
And I upload "mod/data/tests/fixtures/image_gallery_preset.zip" file to "Preset file" filemanager
And I click on "Import preset and apply" "button"
Then I should not see "Fields mappings"
Then I should not see "Field mappings"
And I should see "Preset applied"
Scenario: Teacher can import from field page on a non-empty database and previous fields will be removed
+3 -3
View File
@@ -34,7 +34,7 @@ Feature: Users can preview presets
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "Saved preset by teacher1"
And I set the field "Description" to "Behat test preset"
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
When I follow "Presets"
And I click on "Saved preset by teacher1" "link"
# Check list template preview fields.
@@ -82,7 +82,7 @@ Feature: Users can preview presets
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "Saved preset by teacher1"
And I set the field "Description" to "Behat test preset"
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
When I follow "Presets"
And I click on "Saved preset by teacher1" "link"
And I set the field "Templates tertiary navigation" to "Single view template"
@@ -157,7 +157,7 @@ Feature: Users can preview presets
And I choose "Publish preset on this site" in the open action menu
And I set the field "Name" to "Saved preset by teacher1"
And I set the field "Description" to "Behat test preset"
And I click on "Save" "button" in the "Save all fields and templates as preset" "dialogue"
And I click on "Save" "button" in the "Save all fields and templates and publish as preset on this site" "dialogue"
When I follow "Presets"
And I click on "Saved preset by teacher1" "link"
And I click on "Use this preset" "button"
+5 -5
View File
@@ -35,7 +35,7 @@ Feature: Users can use predefined presets
And I click on "Use this preset" "button"
And I should see "Apply preset Image gallery"
And I click on "Map fields" "button"
And I should see "Fields mappings"
And I should see "Field mappings"
When I click on "Continue" "button"
And I should see "Preset applied"
Then I should see "title"
@@ -80,7 +80,7 @@ Feature: Users can use predefined presets
When I click on "Use this preset" "button"
And I should see "Apply preset Image gallery"
And I click on "Map fields" "button"
Then I should see "Fields mappings"
Then I should see "Field mappings"
And I should see "title"
And I should see "Create a new field" in the "title" "table_row"
# We map existing field to keep the entry data
@@ -166,7 +166,7 @@ Feature: Users can use predefined presets
When I click on "Use this preset" "button"
And I should see "Apply preset Image gallery"
And I click on "Map fields" "button"
Then I should see "Fields mappings"
Then I should see "Field mappings"
And I should see "title"
And I should see "Create a new field" in the "title" "table_row"
# We map existing field to keep the entry data
@@ -186,14 +186,14 @@ Feature: Users can use predefined presets
When I click on "Use this preset" "button"
And I should see "Apply preset Image gallery"
And I click on "Map fields" "button"
And I should see "Fields mappings"
And I should see "Field mappings"
And I set the field "id_title" to "Map to Test field name"
And I click on "Continue" "button"
And I should see "Preset applied"
And I follow "Presets"
And I click on "Image gallery" "link"
And I click on "Use this preset" "button"
Then I should not see "Fields mappings"
Then I should not see "Field mappings"
And I should see "Preset applied"
Scenario: Apply preset dialogue should show helpful information to the user
+1 -1
View File
@@ -63,5 +63,5 @@ Feature: Zero state page (no fields created)
And I click on "fullname" "radio" in the "Image gallery" "table_row"
And the "Use this preset" "button" should be enabled
Then I click on "Use this preset" "button"
And I should not see "Fields mappings"
And I should not see "Field mappings"
And I should see "Image" in the "image" "table_row"