Skip to content

Commit

Permalink
MDL-76739 behat: Replace occurrences of "surname" in Behat tests
Browse files Browse the repository at this point in the history
Replace occurrences of "surname" in Behat tests with "last name"
  • Loading branch information
junpataleta committed Jan 12, 2023
1 parent 50ba9dc commit 5166c72
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions grade/report/grader/tests/behat/tertiary_name_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: Within the grader report, test that we can open our generic filter drop
Given I should see "Filter by name"
When I press "Filter by name"
Then I should see "27" node occurrences of type "input" in the "First name" "core_grades > initials bar"
And I should see "27" node occurrences of type "input" in the "Surname" "core_grades > initials bar"
And I should see "27" node occurrences of type "input" in the "Last name" "core_grades > initials bar"
And "input[data-action=cancel]" "css_element" should exist
And "input[data-action=save]" "css_element" should exist

Expand All @@ -61,7 +61,7 @@ Feature: Within the grader report, test that we can open our generic filter drop
# Business logic: If all is selected, we will not show it i.e. First (D) and NOT First (D) Last (All)
And I press "First (D)"
And I select "All" in the "First name" "core_grades > initials bar"
And I select "M" in the "Surname" "core_grades > initials bar"
And I select "M" in the "Last name" "core_grades > initials bar"
And I press "Apply"
And I wait to be redirected
# We should only have one user that matches the "T" first name
Expand All @@ -79,7 +79,7 @@ Feature: Within the grader report, test that we can open our generic filter drop
# Test filtering on first && last name
And I press "Last (M)"
And I select "U" in the "First name" "core_grades > initials bar"
And I select "T" in the "Surname" "core_grades > initials bar"
And I select "T" in the "Last name" "core_grades > initials bar"
And I press "Apply"
And I wait to be redirected
# We should only have one user that matches the "T" first name
Expand Down
4 changes: 2 additions & 2 deletions lib/tests/behat/alpha_chooser.feature
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I select "A" in the "Surname" "core_grades > initials bar"
And I select "A" in the "Last name" "core_grades > initials bar"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
Expand Down Expand Up @@ -177,7 +177,7 @@ Feature: Initials bar
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I press "Last (A)"
And I select "All" in the "Surname" "core_grades > initials bar"
And I select "All" in the "Last name" "core_grades > initials bar"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
Expand Down
8 changes: 4 additions & 4 deletions mod/workshop/tests/behat/workshop_activity_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: View work shop activity submissions report.
| activity | name | intro | course |
| workshop | Music history | Test workshop description | C1 |

Scenario Outline: Filter submissions report by surname/first name
Scenario Outline: Filter submissions report by last name/first name
Given I am on the "Music history" "workshop activity" page logged in as teacher1
When I change phase in workshop "Music history" to "<phase>"
Then ".firstinitial" "css_element" should exist
Expand All @@ -38,7 +38,7 @@ Feature: View work shop activity submissions report.
| Grading evaluation phase |
| Closed |

Scenario: Filter submissions report by surname/first name is hidden in the Setup phase.
Scenario: Filter submissions report by last name/first name is hidden in the Setup phase.
When I am on the "Music history" "workshop activity" page logged in as teacher1
Then ".firstinitial" "css_element" should not exist
And ".lastinitial" "css_element" should not exist
Expand All @@ -52,15 +52,15 @@ Feature: View work shop activity submissions report.
And I should see "Beth Velvet" in the "grading-report" "table"
And I should not see "Vinnie Money" in the "grading-report" "table"

Scenario: Filter submissions report by surname name as a teacher.
Scenario: Filter submissions report by last name name as a teacher.
Given I am on the "Music history" "workshop activity" page logged in as teacher1
And I change phase in workshop "Music history" to "Submission phase"
When I click on "V" "link" in the ".lastinitial" "css_element"
Then I should see "Beth Velvet" in the "grading-report" "table"
And I should not see "Beth Moe" in the "grading-report" "table"
And I should not see "Vinnie Money" in the "grading-report" "table"

Scenario: Filter submissions report by first name and surname as a teacher.
Scenario: Filter submissions report by first name and last name as a teacher.
Given I am on the "Music history" "workshop activity" page logged in as teacher1
And I change phase in workshop "Music history" to "Submission phase"
When I click on "V" "link" in the ".firstinitial" "css_element"
Expand Down
2 changes: 1 addition & 1 deletion search/tests/behat/search_by_user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Feature: Select users when searching for user-created content
And I search for "frogs" using the header global search box
And I expand all fieldsets
When I expand the "Users" autocomplete
# Alphabetical surname order.
# Alphabetical last name order.
Then "Anne Additional" "text" should appear before "Anne Ditin" "text" in the "Users" "autocomplete"
And "Anne Ditin" "text" should appear before "Anne Other" "text" in the "Users" "autocomplete"

Expand Down
10 changes: 5 additions & 5 deletions user/tests/behat/name_fields.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@core @core_user
Feature: Both first name and surname are always available for every user
Feature: Both first name and last name are always available for every user
In order to easily identify and display users on Moodle pages
As any user
I need to rely on both first name and surname are always available
I need to rely on both first name and last name are always available

Scenario: Attempting to self-register as a new user with empty names
Given the following config values are set as admin:
Expand All @@ -20,7 +20,7 @@ Feature: Both first name and surname are always available for every user
And I set the field "Last name" to " "
And I press "Create my new account"
Then I should see "Missing given name"
And I should see "Missing surname"
And I should see "Missing last name"

Scenario: Attempting to change own names to whitespace
Given the following "users" exist:
Expand All @@ -44,7 +44,7 @@ Feature: Both first name and surname are always available for every user
And I set the field "Last name" to " "
And I click on "Update profile" "button"
Then I should see "Missing given name"
And I should see "Missing surname"
And I should see "Missing last name"

Scenario: Attempting to change someone else's names to whitespace
Given the following "users" exist:
Expand All @@ -65,4 +65,4 @@ Feature: Both first name and surname are always available for every user
And I set the field "Last name" to " "
And I click on "Update profile" "button"
Then I should see "Missing given name"
And I should see "Missing surname"
And I should see "Missing last name"

0 comments on commit 5166c72

Please sign in to comment.