MDL-78684 Behat: Replace gradebook navigation to use page resolvers

This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
This commit is contained in:
Angelia Dela Cruz 2023-07-12 15:00:31 +08:00
parent 13553c25da
commit efb38571e5
68 changed files with 330 additions and 791 deletions

View file

@ -75,8 +75,7 @@ Feature: We can change what we are viewing on the grader report
And the following "role capability" exists:
| role | editingteacher |
| moodle/grade:viewhidden | prevent |
And I am on the "C1" "course" page logged in as "teacher1"
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
Then I should see "Test assignment name 1" in the "user-grades" "table"
And I should see "Test assignment name 2" in the "user-grades" "table"
And I should see "Manual grade"

View file

@ -25,14 +25,12 @@ Feature: A teacher checks the grade history report in a course
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | course | section | name | intro |
| assign | C1 | 1 | The greatest assignment ever | Write a behat test for Moodle - it's amazing |
| assign | C1 | 1 | Rewarding assignment | After writing your behat test go grab a beer! |
| activity | course | name |
| assign | C1 | The greatest assignment ever |
| assign | C1 | Rewarding assignment |
Given the following config values are set as admin:
| showuseridentity | email,profile_field_food |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I should see "apple" in the "student1" "table_row"
And I should see "orange" in the "student2" "table_row"
And I turn editing mode on
@ -41,10 +39,7 @@ Feature: A teacher checks the grade history report in a course
And I give the grade "50.00" to the user "Student 2" for the grade item "The greatest assignment ever"
And I give the grade "60.00" to the user "Student 2" for the grade item "Rewarding assignment"
And I press "Save changes"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2"
And I should see "apple" in the "student1" "table_row"
And I should see "orange" in the "student2" "table_row"
And I turn editing mode on

View file

@ -16,11 +16,9 @@ Feature: Given we have opted to search for a grade item, Lets find and search th
| activity | course | idnumber | name |
| assign | C1 | a1 | Test assignment one |
| assign | C1 | a2 | Test assignment two |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I change window size to "large"
Scenario: A teacher can search for and find a grade item to view
Given I navigate to "View > Single view" in the course gradebook
Given I am on the "Course 1" "grades > Single view > View" page logged in as "teacher1"
And I click on "Grade items" "link" in the ".page-toggler" "css_element"
When I click on ".search-widget[data-searchtype='grade']" "css_element"
Then I confirm "Test assignment one" in "grade" search within the gradebook widget exists

View file

@ -15,11 +15,9 @@ Feature: Given we land on the index page, select what type of report we wish to
And the following "activities" exist:
| activity | course | idnumber | name |
| assign | C1 | a1 | Test assignment one |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I change window size to "large"
Scenario: I switch between the two report types within singleview
Given I navigate to "View > Single view" in the course gradebook
Given I am on the "Course 1" "grades > Single view > View" page logged in as "teacher1"
And I click on "Grade items" "link" in the ".page-toggler" "css_element"
And ".search-widget[data-searchtype='user']" "css_element" should not exist
And ".search-widget[data-searchtype='grade']" "css_element" should exist

View file

@ -55,9 +55,7 @@ Feature: We can use Single view
And the following config values are set as admin:
| fullnamedisplay | firstnamephonetic,lastnamephonetic |
| alternativefullnameformat | middlename, alternatename, firstname, lastname |
And I log in as "teacher1"
And I am on "Course 1" course homepage
Given I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
Scenario: I can update grades, add feedback and exclude grades.
Given I navigate to "View > Single view" in the course gradebook
@ -97,10 +95,7 @@ Feature: We can use Single view
And the following should exist in the "generaltable" table:
| First name (Alternate name) Last name | Grade |
| Ann, Jill, Grainne, Beauchamp | Very good |
And I log out
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 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"
And I click on "Student" in the "user" search widget
And I turn editing mode on
@ -173,27 +168,19 @@ Feature: We can use Single view
And I should see "Select a user above to view all their grades" in the "region-main" "region"
And I click on "Grade items" "link"
And I should see "Select a grade item above" in the "region-main" "region"
And I am on "Course 1" course homepage
When I navigate to "View > Single view" in the course gradebook
When I am on the "Course 1" "grades > Single view > View" page
Then I should see "Select a grade item above" in the "region-main" "region"
And I log out
And I log in as "teacher3"
And I am on "Course 1" course homepage
And I navigate to "View > Single view" in the course gradebook
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
And I should see "Select a user above to view all their grades" in the "region-main" "region"
Scenario: Teacher sees his last viewed user report when navigating back to the gradebook singleview report.
Given I navigate to "View > Single view" in the course gradebook
And I click on "Gronya,Beecham" in the "user" search widget
And I should see "Gronya,Beecham" in the "region-main" "region"
And I am on "Course 1" course homepage
When I navigate to "View > Single view" in the course gradebook
When I am on the "Course 1" "grades > Single view > View" page
Then I should not see "Select a user above to view all their grades" in the "region-main" "region"
And I should see "Gronya,Beecham" in the "region-main" "region"
And I log out
And I log in as "teacher3"
And I am on "Course 1" course homepage
And I navigate to "View > Single view" in the course gradebook
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
And I should see "Select a user above to view all their grades" in the "region-main" "region"
Scenario: Teacher sees his last viewed grade item report when navigating back to the gradebook singleview report.
@ -201,14 +188,10 @@ Feature: We can use Single view
And I click on "Grade items" "link"
And I click on "Test assignment one" in the "grade" search widget
And I should see "Test assignment one" in the "region-main" "region"
And I am on "Course 1" course homepage
When I navigate to "View > Single view" in the course gradebook
When I am on the "Course 1" "grades > Single view > View" page
Then I should not see "Select a grade item above" in the "region-main" "region"
And I should see "Test assignment one" in the "region-main" "region"
And I log out
And I log in as "teacher3"
And I am on "Course 1" course homepage
And I navigate to "View > Single view" in the course gradebook
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher3"
And I should see "Select a user above to view all their grades" in the "region-main" "region"
Scenario: Teacher sees his last viewed user report if the user is a part of the the current group.
@ -237,8 +220,7 @@ Feature: We can use Single view
And the following "group members" exist:
| user | group |
| student2 | G1 |
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
And I set the field "Group mode" to "Visible groups"
And I press "Save and display"
@ -256,8 +238,7 @@ Feature: We can use Single view
And I navigate to course participants
And I click on "Unenrol" "icon" in the "Gronya,Beecham" "table_row"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
And I am on "Course 1" course homepage
When I navigate to "View > Single view" in the course gradebook
When I am on the "Course 1" "grades > Single view > View" page
Then I should see "Select a user above to view all their grades" in the "region-main" "region"
And I should not see "Gronya,Beecham" in the "region-main" "region"

View file

@ -16,11 +16,9 @@ Feature: Within the singleview report, a teacher can search for users.
| student1 | C1 | student |
| student2 | C1 | student |
| student32 | C1 | student |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I change window size to "large"
Scenario: A teacher can search for and find a user to view
Given I navigate to "View > Single view" in the course gradebook
Given I am on the "Course 1" "grades > Single view > View" page logged in as "teacher1"
When I click on "Users" "link" in the ".page-toggler" "css_element"
And I wait until the page is ready
And I click on ".search-widget[data-searchtype='user']" "css_element"

View file

@ -25,14 +25,11 @@ Feature: Group searching functionality within the user report.
| student1 | dg |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I am on the "C1" "Course" page logged in as "teacher1"
And I change window size to "large"
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
Scenario: A teacher can see the 'group' search widget only when group mode is enabled in the course
Given I navigate to "View > User report" in the course gradebook
And ".search-widget[data-searchtype='group']" "css_element" should exist
And I am on "Course 1" course homepage
And I navigate to "Settings" in current page administration
Given ".search-widget[data-searchtype='group']" "css_element" should exist
And I am on the "Course 1" "course editing" page
And I set the following fields to these values:
| id_groupmode | No groups |
And I press "Save and display"
@ -40,8 +37,7 @@ Feature: Group searching functionality within the user report.
Then ".search-widget[data-searchtype='group']" "css_element" should not exist
Scenario: A teacher can search for and find a group to find a user in
Given I navigate to "View > User report" in the course gradebook
And I click on ".search-widget[data-searchtype='group']" "css_element"
Given I click on ".search-widget[data-searchtype='group']" "css_element"
And I confirm "Tutor group" in "group" search within the gradebook widget exists
And I confirm "Marker group" in "group" search within the gradebook widget exists
When I set the field "Search groups" to "tutor"
@ -50,9 +46,8 @@ Feature: Group searching functionality within the user report.
And I confirm "Marker group" in "group" search within the gradebook widget does not exist
Scenario: A teacher can only see the group members in the 'user' search widget after selecting a group option
Given I navigate to "View > User report" in the course gradebook
# Confirm that all users are initially displayed in the 'user' search widget.
And I confirm "Student 1" in "user" search within the gradebook widget exists
Given I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Student 2" in "user" search within the gradebook widget exists
# Select a particular group from the 'group' search widget.
When I click on "Default group" in the "group" search widget

View file

@ -23,13 +23,11 @@ Feature: User can toggle the visibility of the grade categories within the user
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory | grade | gradepass |
| assign | C1 | a2 | Test assignment two | Submit something! | Category 1 | 100 | 50 |
And I log in as "teacher1"
And I am on "Course" course homepage
| activity | course | idnumber | name | gradecategory | grade | gradepass |
| assign | C1 | a2 | Test assignment two | Category 1 | 100 | 50 |
Scenario: A teacher can search for and find a user to view
Given I navigate to "View > User report" in the course gradebook
Given I am on the "Course" "grades > User report > View" page logged in as "teacher1"
And I click on "Student 1" in the "user" search widget
And I should see "Test assignment one" in the "user-grade" "table"
And I should see "Test assignment two" in the "user-grade" "table"

View file

@ -21,14 +21,12 @@ Feature: Teacher can navigate to the previous or next user report.
| student2 | C1 | student |
| student3 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
And I log in as "teacher1"
And I am on "Course" course homepage
| activity | course | idnumber | name | grade |
| assign | C1 | a1 | Test assignment one | 300 |
And I am on the "Course" "grades > User report > View" page logged in as "teacher1"
Scenario: A teacher can navigate to the next user report
Given I navigate to "View > User report" in the course gradebook
And I click on "Student 1" in the "user" search widget
Given I click on "Student 1" in the "user" search widget
And I should see "Student 1" in the ".user-heading" "css_element"
And ".previous" "css_element" should not exist in the ".user-navigation" "css_element"
And ".next" "css_element" should exist in the ".user-navigation" "css_element"
@ -46,8 +44,7 @@ Feature: Teacher can navigate to the previous or next user report.
And ".next" "css_element" should not exist in the ".user-navigation" "css_element"
Scenario: A teacher can navigate to the previous user report
Given I navigate to "View > User report" in the course gradebook
And I click on "Student 3" in the "user" search widget
Given I click on "Student 3" in the "user" search widget
And I should see "Student 3" in the ".user-heading" "css_element"
And ".previous" "css_element" should exist in the ".user-navigation" "css_element"
And I should see "Student 2" in the ".previous" "css_element"

View file

@ -32,8 +32,7 @@ Feature: View the user report as the student will see it
| assign | C1 | a6 | Test assignment six | Submit something! | 100 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
When I am on the "C1" "Course" page logged in as "teacher1"
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "C1" "grades > gradebook setup" page logged in as "teacher1"
And I hide the grade item "Test assignment six"
And I hide the grade item "Sub category 2"
And I navigate to "View > Grader report" in the course gradebook

View file

@ -16,11 +16,9 @@ Feature: Within the User report, a teacher can search for users.
| student1 | C1 | student |
| student2 | C1 | student |
| student32 | C1 | student |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I change window size to "large"
Scenario: A teacher can search for and find a user to view
Given I navigate to "View > User report" in the course gradebook
Given I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
When I click on ".search-widget[data-searchtype='user']" "css_element"
Then I confirm "Student 1" in "user" search within the gradebook widget exists
And I confirm "Student 2" in "user" search within the gradebook widget exists

View file

@ -9,9 +9,7 @@ Feature: We can use the user report
| Course 1 | C1 | 0 | 1 |
Scenario: Verify we can view a user grade report with no users enrolled.
Given I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as "admin"
And I click on "All users (0)" in the "user" search widget
Then I should see "There are no students enrolled in this course."
@ -26,20 +24,14 @@ Feature: We can use the user report
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
And I should see "Select a user above to view their report" in the "region-main" "region"
And I click on "Student 1" in the "user" search widget
And I should see "Student 1" in the "region-main" "region"
And I am on "Course 1" course homepage
When I navigate to "View > User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page
Then I should not see "Select a user above to view their report" in the "region-main" "region"
And I should see "Student 1" in the "region-main" "region"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher2"
And I should see "Select a user above to view their report" in the "region-main" "region"
Scenario: Teacher sees his last viewed user report if the user is a part of the the current group.
@ -59,9 +51,7 @@ Feature: We can use the user report
And the following "group members" exist:
| user | group |
| student2 | G1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
And I click on "Student 2" in the "user" search widget
And I navigate to "View > Grader report" in the course gradebook
And I select "Group 1" from the "group" singleselect
@ -86,9 +76,7 @@ Feature: We can use the user report
And the following "group members" exist:
| user | group |
| student2 | G1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
And I click on "Student 1" in the "user" search widget
And I navigate to "View > Grader report" in the course gradebook
And I select "Group 1" from the "group" singleselect
@ -107,9 +95,7 @@ Feature: We can use the user report
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
And I click on "Student 1" in the "user" search widget
And I should see "Student 1" in the "region-main" "region"
And I navigate to course participants