MDL-47410 mod_assign: Update mod_assign behat tests

Updates the mod_assign behat tests to utilize the ability to
conviniently populate the datetime selector fields.
This commit is contained in:
Mihail Geshoski
2021-02-11 12:15:45 +08:00
parent 3d87e93f02
commit c34c00a762
4 changed files with 73 additions and 210 deletions
@@ -40,18 +40,13 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "Edit" "link" in the "Group 1" "table_row"
And I set the following fields to these values:
| duedate[year] | 2030 |
| Due date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I click on "Delete" "link"
@@ -65,19 +60,14 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "copy" "link"
And I set the following fields to these values:
| Override group | Group 2 |
| duedate[year] | 2030 |
| Override group | Group 2 |
| Due date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I should see "Group 2"
@@ -88,25 +78,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 1 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 0 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2000 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Allow submissions from | disabled |
| Due date | ##1 Jan 2000 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override group | Group 1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
And I log out
@@ -126,25 +106,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2000 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | disabled |
| Cut-off date | ##1 Jan 2000 08:00## |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2030 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Override group | Group 1 |
| Cut-off date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I log out
@@ -164,25 +134,15 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2030 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
And I should see "Thursday, 1 January 2015, 8:00"
And I log out
@@ -204,38 +164,23 @@ Feature: Assign group override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2040 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2040 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 January 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I follow "Test assignment name"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2031 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 January 2031 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2031, 8:00"
And I log out
@@ -304,22 +249,12 @@ Feature: Assign group override
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
| Override group | Group 1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2020 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 1 |
| Allow submissions from | ##1 January 2020 08:00## |
And I press "Save and enter another override"
And I set the following fields to these values:
| Override group | Group 2 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2020 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override group | Group 2 |
| Allow submissions from | ##1 January 2020 08:00## |
And I press "Save"
And I log out
When I log in as "teacher1"
@@ -26,33 +26,21 @@ Feature: Assignment with no calendar capabilites
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
When I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_allowsubmissionsfromdate_day | 1 |
| id_allowsubmissionsfromdate_month | 1 |
| id_allowsubmissionsfromdate_year | 2017 |
| id_duedate_enabled | 1 |
| id_duedate_day | 1 |
| id_duedate_month | 2 |
| id_duedate_year | 2017 |
| id_cutoffdate_enabled | 1 |
| id_cutoffdate_day | 2 |
| id_cutoffdate_month | 2 |
| id_cutoffdate_year | 2017 |
| id_gradingduedate_enabled | 1 |
| id_gradingduedate_day | 1 |
| id_gradingduedate_month | 3 |
| id_gradingduedate_year | 2017 |
| Assignment name | Test assignment name |
| Description | Test assignment description |
| Allow submissions from | ##1 January 2017## |
| Due date | ##1 February 2017## |
| Cut-off date | ##2 February 2017## |
| Remind me to grade by | ##1 March 2017## |
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_allowsubmissionsfromdate_year | 2018 |
| id_duedate_year | 2018 |
| id_cutoffdate_year | 2018 |
| id_gradingduedate_year | 2018 |
| Allow submissions from | ##1 January 2018## |
| Due date | ##1 February 2018## |
| Cut-off date | ##2 February 2018## |
| Remind me to grade by | ##1 March 2018## |
And I press "Save and return to course"
Then I should see "Test assignment name"
@@ -30,18 +30,13 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##first day of January 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "Edit" "link" in the "Sam1 Student1" "table_row"
And I set the following fields to these values:
| duedate[year] | 2030 |
| Due date | ##first day of January 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I click on "Delete" "link"
@@ -56,19 +51,14 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##2020-01-01 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
Then I click on "copy" "link"
And I set the following fields to these values:
| Override user | Student2 |
| duedate[year] | 2030 |
| Override user | Student2 |
| Due date | ##2030-01-01 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I should see "Sam2 Student2"
@@ -80,25 +70,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 1 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 0 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2000 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Allow submissions from | disabled |
| Due date | ##1 Jan 2000 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2020 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student1 |
| Due date | ##1 Jan 2020 08:00## |
And I press "Save"
And I should see "Wednesday, 1 January 2020, 8:00"
And I log out
@@ -119,25 +99,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 0 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2000 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | disabled |
| Cut-off date | ##1 Jan 2000 08:00## |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_cutoffdate_enabled | 1 |
| cutoffdate[day] | 1 |
| cutoffdate[month] | January |
| cutoffdate[year] | 2030 |
| cutoffdate[hour] | 08 |
| cutoffdate[minute] | 00 |
| Override user | Student1 |
| Cut-off date | ##1 Jan 2030 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I log out
@@ -158,25 +128,15 @@ Feature: Assign user override
When I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_duedate_enabled | 0 |
| id_allowsubmissionsfromdate_enabled | 1 |
| id_cutoffdate_enabled | 0 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2030 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Due date | disabled |
| Allow submissions from | ##1 January 2030 08:00## |
| Cut-off date | disabled |
And I press "Save and display"
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
And I should see "Thursday, 1 January 2015, 8:00"
And I log out
@@ -253,22 +213,12 @@ Feature: Assign user override
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##first day of January 2015 08:00## |
And I press "Save and enter another override"
And I set the following fields to these values:
| Override user | Student2 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student2 |
| Allow submissions from | ##first day of January 2015 08:00## |
And I press "Save"
And I log out
When I log in as "teacher1"
@@ -290,13 +240,8 @@ Feature: Assign user override
When I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
| id_allowsubmissionsfromdate_enabled | 1 |
| allowsubmissionsfromdate[day] | 1 |
| allowsubmissionsfromdate[month] | January |
| allowsubmissionsfromdate[year] | 2015 |
| allowsubmissionsfromdate[hour] | 08 |
| allowsubmissionsfromdate[minute] | 00 |
| Override user | Student1 |
| Allow submissions from | ##1 Jan 2015 08:00## |
And I press "Save"
Then I should see "This override is inactive"
And "Edit" "icon" should exist in the "Sam1 Student1" "table_row"
@@ -119,13 +119,8 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student |
| id_duedate_enabled | 1 |
| duedate[day] | 1 |
| duedate[month] | January |
| duedate[year] | 2030 |
| duedate[hour] | 08 |
| duedate[minute] | 00 |
| Override user | Student |
| Due date | ##2030-01-01 08:00## |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I follow "Test assignment name"