Skip to content

Commit

Permalink
MDL-80907 various: fixes to incorrect column selectors in behat
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed May 7, 2024
1 parent 8f2d505 commit 49ab83c
Show file tree
Hide file tree
Showing 24 changed files with 114 additions and 121 deletions.
12 changes: 6 additions & 6 deletions admin/tests/behat/browse_users.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: An administrator can browse user accounts
When I navigate to "Users > Accounts > Browse list of users" in site administration
# Name field always present, email field is default for showidentity.
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
# Should not see other identity fields or non-default name fields.
Expand All @@ -34,7 +34,7 @@ Feature: An administrator can browse user accounts
| alternativefullnameformat | firstnamephonetic lastname |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name - phonetic / Last name | Email address |
| First name - phonetic | Email address |
| Yewzer One | one@example.com |
| Yoozare Two | two@example.com |

Expand All @@ -43,7 +43,7 @@ Feature: An administrator can browse user accounts
| showuseridentity | department,profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Favourite frog | Department |
| First name | Favourite frog | Department |
| User One | Kermit | Attack |
| User Two | Tree | Defence |
And I should not see "Email address" in the "table" "css_element"
Expand Down Expand Up @@ -103,7 +103,7 @@ Feature: An administrator can browse user accounts
| user3 | User | Three | three@example.com | Glass |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
| User Three | three@example.com |
Expand Down Expand Up @@ -137,7 +137,7 @@ Feature: An administrator can browse user accounts
| user2 | C1 | student |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
And I click on "Filters" "button"
Expand Down Expand Up @@ -166,7 +166,7 @@ Feature: An administrator can browse user accounts
| user1 | coursecreator | system | |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
| User Three | three@example.com |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Feature: In a report, admin can see logstore visibility changes
And I click on "Enable" "icon" in the "External database log" "table_row"
And I navigate to "Reports > Config changes" in site administration
Then the following should exist in the "reportbuilder-table" table:
| User | Plugin | Setting | New value | Original value |
| First name | Plugin | Setting | New value | Original value |
| Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 |
| Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |
4 changes: 2 additions & 2 deletions admin/tool/task/tests/behat/manage_tasks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Feature: Manage scheduled tasks
And I press "Save changes"
Then I should see "Changes saved"
And the following should not exist in the "admintable" table:
| Name | Component | Minute | Hour | Day | Day of week | Month |
| Log table cleanup | Standard log | */5 | 1 | 2 | 4 | 3 |
| Name | Minute | Hour | Day | Day of week | Month |
| Log table cleanup | */5 | 1 | 2 | 4 | 3 |
And I should see "Log table cleanup" in the "tr.table-primary" "css_element"

Scenario: Disabled plugin's tasks are labelled as disabled too
Expand Down
2 changes: 1 addition & 1 deletion comment/tests/behat/manage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: Manage comments made by users
Scenario: View and filter site comments
When I navigate to "Reports > Comments" in site administration
And the following should exist in the "reportbuilder-table" table:
| -0- | Content | Context URL |
| First name | Content | Context URL |
| Admin User | Uno | Course: Course 1 |
| Admin User | Dos | Course: Course 1 |
| Admin User | Tres | Course: Course 1 |
Expand Down
4 changes: 2 additions & 2 deletions enrol/cohort/tests/behat/enrolcohorts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ Feature: Cohort enrolment management
And I navigate to course participants
# Verifies students 1 and 4 are in the cohort and student 2 is not any more.
And the following should exist in the "participants" table:
| First name / Last name | Email address | Roles | Groups |
| First name | Email address | Roles | Groups |
| Sandra Cole | s1@example.com | Student | Alpha1 cohort |
| Jane Doe | s4@example.com | Student | Alpha1 cohort |
And the following should not exist in the "participants" table:
| First name / Last name | Email address | Roles | Groups |
| First name | Email address | Roles | Groups |
| John Smith | s2@example.com | Student | Alpha1 cohort |

@javascript
Expand Down
12 changes: 6 additions & 6 deletions grade/report/grader/tests/behat/switch_views.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Feature: We can change what we are viewing on the grader report
And I should see "Manual grade"
And I should see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- | -5- | -6- |
| -1- | -2- | -3- | -4- | -5- | -6- |
| Student 1 | student1@example.com | 80 | 90 | 30 | 170 |
And I click on grade item menu "Course 1" of type "course" on "grader" page
And I choose "Show totals only" in the open action menu
Expand All @@ -57,7 +57,7 @@ Feature: We can change what we are viewing on the grader report
And I should not see "Manual grade"
And I should see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | 170 |
And I click on grade item menu "Course 1" of type "course" on "grader" page
And I click on "Show grades only" "link"
Expand All @@ -66,7 +66,7 @@ Feature: We can change what we are viewing on the grader report
And I should see "Manual grade"
And I should not see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- | -5- |
| -1- | -2- | -3- | -4- | -5- |
| Student 1 | student1@example.com | 80 | 90 | 30 |

@javascript @skip_chrome_zerosize
Expand All @@ -83,7 +83,7 @@ Feature: We can change what we are viewing on the grader report
And I should see "Manual grade"
And I should see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- | -5- | -6- |
| -1- | -2- | -3- | -4- | -5- | -6- |
| Student 1 | student1@example.com | 80 | - | 30 | 105.71 |
And I click on grade item menu "Course 1" of type "course" on "grader" page
And I choose "Show totals only" in the open action menu
Expand All @@ -92,7 +92,7 @@ Feature: We can change what we are viewing on the grader report
And I should not see "Manual grade"
And I should see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | 105.71 |
And I click on grade item menu "Course 1" of type "course" on "grader" page
When I click on "Show grades only" "link"
Expand All @@ -101,5 +101,5 @@ Feature: We can change what we are viewing on the grader report
And I should see "Manual grade"
And I should not see "Course total"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- | -5- |
| -1- | -2- | -3- | -4- | -5- |
| Student 1 | student1@example.com | 80 | - | 30 |
14 changes: 7 additions & 7 deletions grade/report/grader/tests/behat/tertiary_name_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ Feature: Within the grader report, test that we can open our generic filter drop
When I press "Apply"
And the field "Search users" matches value "Student 1"
Then the following should exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | - |
And the following should not exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Teacher 1 | teacher1@example.com | - |
| Dummy User | student2@example.com | - |
| User Example | student3@example.com | - |
Expand All @@ -169,7 +169,7 @@ Feature: Within the grader report, test that we can open our generic filter drop
And I select "M" in the "First name" "core_grades > initials bar"
And I press "Apply"
And the following should not exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | - |
| Teacher 1 | teacher1@example.com | - |
| Dummy User | student2@example.com | - |
Expand All @@ -181,23 +181,23 @@ Feature: Within the grader report, test that we can open our generic filter drop
Given I set the field "Search users" to "User"
And I click on "View all results (3)" "option_role"
And the following should exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| User Example | student3@example.com | - |
| User Test | student4@example.com | - |
| Dummy User | student2@example.com | - |
And the following should not exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | - |
| Teacher 1 | teacher1@example.com | - |
| Turtle Manatee | student5@example.com | - |
When I click on "Filter by name" "combobox"
And I select "E" in the "Last name" "core_grades > initials bar"
And I press "Apply"
Then the following should exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| User Example | student3@example.com | - |
And the following should not exist in the "user-grades" table:
| -1- | -1- | -3- |
| -1- | -2- | -3- |
| Student 1 | student1@example.com | - |
| Teacher 1 | teacher1@example.com | - |
| Dummy User | student2@example.com | - |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ Feature: Within the grader report, test that we can search for users
And I press the up key
And I press the enter key
And I wait to be redirected
# Sometimes with behat we get unattached nodes causing spurious failures.
And I wait "1" seconds
And the following should exist in the "user-grades" table:
| -1- |
| Dummy User |
Expand All @@ -284,6 +286,13 @@ Feature: Within the grader report, test that we can search for users
| Teacher 1 |
| Student 1 |
| Turtle Manatee |
And I set the field "Search users" to "ABC"
And I wait until "Turtle Manatee" "option_role" exists
And I press the tab key
And the focused element is "Clear search input" "button"
And I press the enter key
And I wait until the page is ready
And I confirm "Turtle Manatee" in "user" search within the gradebook widget does not exist

Scenario: Once a teacher searches, it'll apply the currently set filters and inform the teacher as such
# Set up a basic filtering case.
Expand Down
10 changes: 5 additions & 5 deletions grade/report/history/tests/behat/basic_functionality.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Feature: A teacher checks the grade history report in a course
And I navigate to "View > Grade history" in the course gradebook
When I press "Submit"
Then the following should exist in the "gradereport_history" table:
| First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 |
| Student 1 | student1@example.com | apple | Rewarding assignment | | 60.00 | Teacher 1 |
| Student 2 | student2@example.com | orange | The greatest assignment ever | | 50.00 | Teacher 1 |
Expand Down Expand Up @@ -79,7 +79,7 @@ Feature: A teacher checks the grade history report in a course
And I press "Finish selecting users"
And I press "Submit"
And the following should exist in the "gradereport_history" table:
| First name/Last name | Grade item | Original grade | Revised grade | Grader |
| First name | Grade item | Original grade | Revised grade | Grader |
| Student 1 | The greatest assignment ever | | 50.00 | Teacher 1 |
| Student 1 | Rewarding assignment | | 60.00 | Teacher 1 |
| Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 |
Expand All @@ -96,7 +96,7 @@ Feature: A teacher checks the grade history report in a course
And I set the field "Grade item" to "The greatest assignment ever"
And I press "Submit"
And the following should exist in the "gradereport_history" table:
| First name/Last name | Grade item | Original grade | Revised grade | Grader |
| First name | Grade item | Original grade | Revised grade | Grader |
| Student 1 | The greatest assignment ever | | 50.00 | Teacher 1 |
| Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 |
And the following should not exist in the "gradereport_history" table:
Expand All @@ -106,13 +106,13 @@ Feature: A teacher checks the grade history report in a course
And I set the field "Grader" to "Teacher 1"
And I press "Submit"
And the following should exist in the "gradereport_history" table:
| First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 |
And the following should not exist in the "gradereport_history" table:
| Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 |
# Test filtering by revised grades.
And I click on "id_revisedonly" "checkbox"
And I press "Submit"
And the following should exist in the "gradereport_history" table:
| First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader |
| Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 |
2 changes: 1 addition & 1 deletion grade/report/singleview/tests/behat/singleview.feature
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feature: We can use Single view
And I press "Save"
Then I should see "Grades were set for 1 items"
And the following should exist in the "generaltable" table:
| First name (Alternate name) Last name | Grade |
| User full name | Grade |
| Ann, Jill, Grainne, Beauchamp | Very good |
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher2"
And I click on "Users" "link" in the ".page-toggler" "css_element"
Expand Down
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Feature: An admin can import grades into gradebook using a CSV file
And I should see "Grade import success"
And I click on "Continue" "button"
Then the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- |
| -1- | -2- | -3- | -4- |
| Student 1 | student1@example.com | 400.00 | 400.00 |
| Student 2 | student2@example.com | 50.00 | 50.00 |
| Student 3 | student3@example.com | 50.00 | 50.00 |
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_letter_boundary.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ Feature: We can customise the letter boundary of a course.
And I am on "Course 1" course homepage with editing mode off
And I navigate to "View > Grader report" in the course gradebook
Then the following should exist in the "user-grades" table:
| -1- | -1- |-3- | -4- |
| -1- | -2- |-3- | -4- |
| Student 1 | student1@example.com | D | D |
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_letter_boundary_20160518.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ Feature: We can customise the letter boundary of a course in gradebook version 2
And I am on "Course 1" course homepage with editing mode off
And I navigate to "View > Grader report" in the course gradebook
Then the following should exist in the "user-grades" table:
| -1- | -1- | -3- | -4- |
| -1- | -2- | -3- | -4- |
| Student 1 | student1@example.com | F | F |
Loading

0 comments on commit 49ab83c

Please sign in to comment.