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 1474f74687
commit 6385949078
75 changed files with 371 additions and 871 deletions

View file

@ -24,7 +24,6 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
| activity | assign |
| course | C1 |
| name | Test assignment name |
| intro | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| markingworkflow | 1 |
@ -39,7 +38,6 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I set the following fields to these values:
| Online text | I'm student1's submission |
And I press "Save changes"
And I log out
# Add another submission.
And I am on the "Test assignment name" "assign activity" page logged in as "student2"
Then I should not see "Feedback"
@ -48,7 +46,6 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I set the following fields to these values:
| Online text | I'm student2's submission |
And I press "Save changes"
And I log out
# Mark the submissions.
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
And I follow "View all submissions"
@ -87,35 +84,22 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I follow "View all submissions"
Then I should see "Released" in the "I'm student1's submission" "table_row"
And I should see "Released" in the "I'm student2's submission" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should not see "50"
And I should not see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should not see "50"
And I should not see "Great job!"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
And I follow "View all submissions"
And I set the field "Grading action" to "Reveal student identities"
And I press "Continue"
Then I should see "Released" in the "Student 1" "table_row"
And I should see "Released" in the "Student 2" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should see "50"
And I should see "Great job!"
@ -135,15 +119,9 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I follow "View all submissions"
Then I should see "Released" in the "Student 1" "table_row"
And I should see "Released" in the "Student 2" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should see "50"
And I should see "Great job!"

View file

@ -20,22 +20,13 @@ Feature: Outcome grading
| student1 | C1 | student |
And the following config values are set as admin:
| enableoutcomes | 1 |
And I log in as "admin"
And I navigate to "Grades > Scales" in site administration
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Test Scale |
| Scale | Disappointing, Excellent, Good, Very good, Excellent |
And I press "Save changes"
And I navigate to "Grades > Outcomes" in site administration
And I press "Add a new outcome"
And I set the following fields to these values:
| Full name | Outcome Test |
| Short name | OT |
| Scale | Test Scale |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "More > Outcomes" in the course gradebook
And the following "scales" exist:
| name | scale |
| Test Scale | Disappointing, Excellent, Good, Very good, Excellent |
And the following "grade outcomes" exist:
| fullname | shortname | scale |
| Outcome Test | OT | Test Scale |
And I am on the "Course 1" "grades > outcomes" page logged in as admin
And I set the field "Available standard outcomes" to "Outcome Test"
And I click on "#add" "css_element"
And I log out
@ -49,13 +40,11 @@ Feature: Outcome grading
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 0" "table_row"
@ -92,13 +81,11 @@ Feature: Outcome grading
| Students submit in groups | Yes |
| Group mode | No groups |
| Outcome Test | 1 |
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 0" "table_row"

View file

@ -52,9 +52,7 @@ Feature: In an assignment, teachers grade multiple students on one page
| student2 | C1 | student |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "More > Outcomes" in the course gradebook
When I am on the "Course 1" "grades > outcomes" page logged in as teacher1
And I press "Manage outcomes"
And I press "Add a new outcome"
And I follow "Add a new scale"
@ -62,8 +60,7 @@ Feature: In an assignment, teachers grade multiple students on one page
| Name | 1337dom scale |
| Scale | Noob, Nub, 1337, HaXor |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "More > Outcomes" in the course gradebook
And I am on the "Course 1" "grades > outcomes" page
And I press "Manage outcomes"
And I press "Add a new outcome"
And I set the following fields to these values:
@ -78,19 +75,16 @@ Feature: In an assignment, teachers grade multiple students on one page
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| M8d skillZ! | 1 |
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student1 submission |
And I press "Save changes"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student2
When I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student2 submission |
And I press "Save changes"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I click on "Grade" "link" in the "Student 1" "table_row"
@ -105,21 +99,18 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save all quick grading changes"
And I should see "The grade changes were saved"
And I press "Continue"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "I'm the teacher first feedback"
And I should see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should see "1337"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student2
And I should not see "I'm the teacher first feedback"
And I should not see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should not see "1337"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I follow "View all submissions"
And I click on "Hide User picture" "link"
@ -138,14 +129,12 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save all quick grading changes"
And I should see "The grade changes were saved"
And I press "Continue"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "I'm the teacher first feedback"
And I should see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should see "1337"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student2
And I should not see "I'm the teacher first feedback"
And I should not see "60.0"

View file

@ -60,10 +60,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I should see "Released" in the "I'm the student's first submission" "table_row"
And I set the field "Grading action" to "Reveal student identities"
And I press "Continue"
And I log out
And I am on the "C1" Course page logged in as student1
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job! Lol, not really."
@ -82,10 +79,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I press "Save changes"
And I follow "View all submissions"
And I should see "Released" in the "Student 1" "table_row"
And I log out
And I am on the "C1" Course page logged in as student1
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job! Lol, not really."

View file

@ -41,7 +41,6 @@ Feature: Do a H5P attempt
And I click on "Correct one" "text" in the ".h5p-question-content" "css_element"
And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
And I switch to the main frame
And I log out
And I am on the "Course 1" course page logged in as teacher1
And I navigate to course participants
And I follow "Student 1"
@ -83,8 +82,7 @@ Feature: Do a H5P attempt
And "2" row "Score" column of "table" table should contain "1"
And "3" row "Score" column of "table" table should contain "0"
And "4" row "Score" column of "table" table should contain "1"
And I am on the "Course 1" course page logged in as teacher1
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
Then the following should exist in the "user-grade" table:
| Grade item | Grade | Percentage |

View file

@ -30,8 +30,7 @@ Feature: View activity completion information in the LTI activity
Given I am on the "Music history" "lti activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I am on the "Course 1" 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"
And I turn editing mode on
And I give the grade "90.00" to the user "Vinnie Student1" for the grade item "Music history"
And I press "Save changes"

View file

@ -33,8 +33,7 @@ Feature: Pass grade activity completion information in the LTI activity
And the "View" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
And I am on the "Course 1" 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"
And I turn editing mode on
And I give the grade "90.00" to the user "Vinnie Student1" for the grade item "Music history"
And I give the grade "20.00" to the user "Vinnie Student2" for the grade item "Music history"