MDL-85697 mod_assign: Behat for assignment group and user overrides

This commit is contained in:
andelacruz
2025-07-08 16:17:46 +08:00
parent 09873ae9ce
commit 69ba3e7149
@@ -312,3 +312,102 @@ Feature: Assign group override
And I navigate to "Submissions" in current page administration
And "Sam1 Student1" row "Grade" column of "submissions" table should contain "90.00"
And "Sam1 Student1" row "Final grade" column of "submissions" table should contain "90.00"
@javascript
Scenario: Assign activity group overrides are displayed on the timeline block
Given the following "group members" exist:
| user | group |
| student1 | G2 |
And I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| allowsubmissionsfromdate[enabled] | 1 |
| duedate[enabled] | 1 |
| allowsubmissionsfromdate | ##today## |
| duedate | ##tomorrow## |
And I press "Save and display"
When I log in as "student1"
Then I should see "##tomorrow##%A, %d %B %Y##" in the "Timeline" "block"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "Group overrides" from the "jump" singleselect
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| Allow submissions from | ##tomorrow## |
| Due date | ##tomorrow +1day## |
And I press "Save"
And I log in as "student1"
And I should see "##tomorrow +1day##%A, %d %B %Y##" in the "Timeline" "block"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "Group overrides" from the "jump" singleselect
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 2 |
| Allow submissions from | ##tomorrow +1day## |
| Due date | ##tomorrow +3days## |
And I press "Save"
And I click on "Move up" "link" in the "Group 2" "table_row"
And I log in as "student1"
And I should see "##tomorrow +3days##%A, %d %B %Y##" in the "Timeline" "block"
@javascript
Scenario: Assign activity user override is displayed even if group override exists on the timeline block
Given the following "group members" exist:
| user | group |
| student1 | G2 |
And I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| allowsubmissionsfromdate[enabled] | 1 |
| duedate[enabled] | 1 |
| allowsubmissionsfromdate | ##today## |
| duedate | ##tomorrow## |
And I press "Save and display"
And I navigate to "Overrides" in current page administration
And I select "Group overrides" from the "jump" singleselect
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| Allow submissions from | ##tomorrow## |
| Due date | ##tomorrow +1day## |
And I press "Save"
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 2 |
| Allow submissions from | ##tomorrow +1day## |
| Due date | ##tomorrow +3days## |
And I navigate to "Overrides > Add user override" in current page administration
And I set the following fields to these values:
| Override user | Sam1 Student1 |
| allowsubmissionsfromdate | ##tomorrow## |
| duedate | ##tomorrow noon## |
And I press "Save"
When I log in as "student1"
Then I should see "##tomorrow noon##%A, %d %B %Y##" in the "Timeline" "block"
@javascript
Scenario: Assign activity override are not visible on timeline block when student is unenrolled
Given the following "group members" exist:
| user | group |
| student1 | G2 |
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "Overrides" in current page administration
And I select "Group overrides" from the "jump" singleselect
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 2 |
| Allow submissions from | ##tomorrow +1day## |
| Due date | ##tomorrow +3days## |
And I navigate to "Overrides > Add user override" in current page administration
And I set the following fields to these values:
| Override user | Sam1 Student1 |
| allowsubmissionsfromdate | ##tomorrow## |
| duedate | ##tomorrow noon## |
And I press "Save"
And I am on "Course 1" course homepage
And I navigate to course participants
And I click on "Unenrol" "icon" in the "student1" "table_row"
And I click on "Unenrol" "button" in the "Unenrol" "dialogue"
When I log in as "student1"
Then "Test assignment name" "link" should not exist in the "Timeline" "block"
And I should not see "##tomorrow noon##%A, %d %B %Y##" in the "Timeline" "block"