MDL-71912 mod_assign: Behat fixes for overrides.

This commit is contained in:
abgreeve
2021-11-10 16:26:57 +08:00
parent 85fded1a95
commit 05e6cdfd26
7 changed files with 14 additions and 11 deletions
@@ -76,7 +76,7 @@ class user_submission_actionmenu implements templatable, renderable {
* @return string The status of the submission.
*/
protected function get_current_status(): string {
if (!is_null($this->teamsubmission)) {
if (!is_null($this->teamsubmission) && isset($this->teamsubmission->status)) {
return $this->teamsubmission->status;
} else if (!empty((array)$this->submission)) {
return $this->submission->status;
@@ -56,10 +56,11 @@ Feature: Assign reset
And I follow "View all submissions"
Then I should not see "Submitted for grading"
@javascript @skip_interim
@javascript
Scenario: Use course reset to remove user overrides.
And I am on the "Test assignment name" Activity page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
@@ -140,7 +140,7 @@ Feature: Assign group override
And I am on the "Test assignment name" Activity page logged in as student1
And I should not see "Tuesday, 1 January 2030, 8:00"
@javascript @skip_interim
@javascript
Scenario: Add both a user and group override and verify that both are applied correctly
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
@@ -160,6 +160,7 @@ Feature: Assign group override
And I should see "Tuesday, 1 January 2030, 8:00"
And I am on the "Test assignment name" Activity page
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
@@ -144,7 +144,6 @@ Feature: Assign user override
Then I should see "No groups you can access."
And the "Add user override" "button" should be disabled
@skip_interim
Scenario: A teacher without accessallgroups permission should only be able to add user override for users that he/she shares groups with,
when the activity's group mode is "separate groups"
Given the following "permission overrides" exist:
@@ -164,11 +163,12 @@ Feature: Assign user override
| student2 | G2 |
And I am on the "Assignment 2" Activity page logged in as teacher1
When I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
And the "Override user" select box should not contain "Sam2 Student2, student2@example.com"
@javascript @skip_interim
@javascript
Scenario: A teacher without accessallgroups permission should only be able to see the user override for users that he/she shares groups with,
when the activity's group mode is "separate groups"
Given the following "permission overrides" exist:
@@ -188,6 +188,7 @@ Feature: Assign user override
| student2 | G2 |
And I am on the "Assignment 2" Activity page logged in as admin
And I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
@@ -201,6 +202,7 @@ Feature: Assign user override
And I am on the "Assignment 2" Activity page logged in as teacher1
When I navigate to "Overrides" in current page administration
And I select "User overrides" from the "jump" singleselect
Then I should see "Student1" in the ".generaltable" "css_element"
But I should not see "Student2" in the ".generaltable" "css_element"
@@ -68,7 +68,6 @@ Feature: Outcome grading
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should not see "Outcome Test: Excellent" in the "Student 1" "table_row"
@skip_interim
Scenario: Giving an outcome to a group submission
Given the following "users" exist:
| username | firstname | lastname | email |
@@ -31,7 +31,7 @@ Feature: Remove a submission
| student1 | G1 |
| student2 | G1 |
@javascript @skip_chrome_zerosize @skip_interim
@javascript @skip_chrome_zerosize
Scenario: Remove a submission should remove the data that was submitted
Given the following "activity" exists:
| activity | assign |
@@ -56,7 +56,7 @@ Feature: Remove a submission
And I am on the "Test assignment name" Activity page logged in as student1
And I should not see "I'm the student submission"
And I should see "No attempt" in the "Submission status" "table_row"
And I should see "No submissions have been made yet" in the "Submission status" "table_row"
@javascript @skip_chrome_zerosize
Scenario: Remove a group submission should remove the data from all group members
@@ -86,7 +86,7 @@ Feature: Remove a submission
And I should not see "I'm the student submission"
And I should see "Nothing has been submitted for this assignment" in the "Submission status" "table_row"
@javascript @skip_chrome_zerosize @skip_interim
@javascript @skip_chrome_zerosize
Scenario: A student can remove their own submission
Given the following "activity" exists:
| activity | assign |
@@ -113,4 +113,4 @@ Feature: Remove a submission
And I am on the "Test assignment name" Activity page logged in as student1
And I should not see "I'm the student submission"
And I should see "No attempt" in the "Submission status" "table_row"
And I should see "No submissions have been made yet" in the "Submission status" "table_row"
@@ -3,7 +3,7 @@ Feature: Submit assignment without group
As a teacher
I should be able to prevent students submitting team assignments as members of the default group
@javascript @skip_interim
@javascript
Scenario: Switch between group modes
Given the following "courses" exist:
| fullname | shortname | category | groupmode |