diff --git a/mod/assign/tests/behat/assign_group_override.feature b/mod/assign/tests/behat/assign_group_override.feature index 62b251ab94b..9f1cb4e2365 100644 --- a/mod/assign/tests/behat/assign_group_override.feature +++ b/mod/assign/tests/behat/assign_group_override.feature @@ -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" diff --git a/mod/lesson/tests/behat/lesson_group_override.feature b/mod/lesson/tests/behat/lesson_group_override.feature index c0803b60868..4a1406310c8 100644 --- a/mod/lesson/tests/behat/lesson_group_override.feature +++ b/mod/lesson/tests/behat/lesson_group_override.feature @@ -382,3 +382,103 @@ Feature: Lesson group override And I should see "Only visible to members/Non-Participation" in the "Override group" "select" And I should see "Only see own membership" in the "Override group" "select" And I should not see "Not visible" in the "Override group" "select" + + @javascript + Scenario: Lesson 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 lesson name" "lesson activity editing" page logged in as teacher1 + And I set the following fields to these values: + | available[enabled] | 1 | + | deadline[enabled] | 1 | + | available | ##today## | + | deadline | ##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 lesson name" "lesson activity editing" 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 follow "Add group override" + And I set the following fields to these values: + | Override group | Group 1 | + | Available from | ##tomorrow## | + | Deadline | ##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 lesson name" "lesson activity editing" 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 follow "Add group override" + And I set the following fields to these values: + | Override group | Group 2 | + | Available from | ##tomorrow +1day## | + | Deadline | ##tomorrow +3days## | + And I press "Save" + And I log in as "student1" + And I should see "##tomorrow +3days##%A, %d %B %Y##" in the "Timeline" "block" + + @javascript + Scenario: Lesson 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 lesson name" "lesson activity editing" page logged in as teacher1 + And I set the following fields to these values: + | available[enabled] | 1 | + | deadline[enabled] | 1 | + | available | ##today## | + | deadline | ##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 follow "Add group override" + And I set the following fields to these values: + | Override group | Group 1 | + | Available from | ##tomorrow## | + | Deadline | ##tomorrow +1day## | + And I press "Save" + And I follow "Add group override" + And I set the following fields to these values: + | Override group | Group 2 | + | Available from | ##tomorrow +1day## | + | Deadline | ##tomorrow +3days## | + And I navigate to "Overrides" in current page administration + And I follow "Add user override" + And I set the following fields to these values: + | Override user | Sam1 Student1 | + | Available from | ##tomorrow## | + | Deadline | ##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: Lesson 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 lesson name" "lesson 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 follow "Add group override" + And I set the following fields to these values: + | Override group | Group 2 | + | Available from | ##tomorrow +1day## | + | Deadline | ##tomorrow +3days## | + And I navigate to "Overrides" in current page administration + And I follow "Add user override" + And I set the following fields to these values: + | Override user | Sam1 Student1 | + | Available from | ##tomorrow## | + | Deadline | ##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 lesson name" "link" should not exist in the "Timeline" "block" + And I should not see "##tomorrow noon##%A, %d %B %Y##" in the "Timeline" "block" diff --git a/mod/quiz/tests/behat/quiz_group_override.feature b/mod/quiz/tests/behat/quiz_group_override.feature index e1a79510852..2e97612c477 100644 --- a/mod/quiz/tests/behat/quiz_group_override.feature +++ b/mod/quiz/tests/behat/quiz_group_override.feature @@ -137,3 +137,77 @@ Feature: Quiz group override And I should see "Only visible to members/Non-Participation" in the "Override group" "select" And I should see "Only see own membership" in the "Override group" "select" And I should not see "Not visible" in the "Override group" "select" + + @javascript + Scenario: Quiz 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 quiz" "quiz activity editing" page logged in as teacher1 + And I set the following fields to these values: + | timeopen[enabled] | 1 | + | timeclose[enabled] | 1 | + | timeopen | ##today## | + | timeclose | ##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 the following "mod_quiz > group overrides" exist: + | quiz | group | timeopen | timeclose | + | Test quiz | G1 | ##tomorrow## | ##tomorrow +1day## | + And I reload the page + And I should see "##tomorrow +1day##%A, %d %B %Y##" in the "Timeline" "block" + And the following "mod_quiz > group overrides" exist: + | quiz | group | timeopen | timeclose | + | Test quiz | G2 | ##tomorrow +1day## | ##tomorrow +3days## | + And I reload the page + And I should see "##tomorrow +3days##%A, %d %B %Y##" in the "Timeline" "block" + + @javascript + Scenario: Quiz 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 quiz" "quiz activity editing" page logged in as teacher1 + And I set the following fields to these values: + | timeopen[enabled] | 1 | + | timeclose[enabled] | 1 | + | timeopen | ##today## | + | timeclose | ##tomorrow## | + And I press "Save and display" + And the following "mod_quiz > group overrides" exist: + | quiz | group | timeopen | timeclose | + | Test quiz | G1 | ##tomorrow## | ##tomorrow +1day## | + | Test quiz | G2 | ##tomorrow +1day## | ##tomorrow +3days## | + And I navigate to "Overrides" in current page administration + And I press "Add user override" + And I set the following fields to these values: + | Override user | Sam 1 Student 1 | + | timeopen | ##tomorrow## | + | timeclose | ##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: Quiz activity override are not visible on timeline block when student is unenrolled + Given the following "group members" exist: + | user | group | + | student1 | G2 | + And the following "mod_quiz > group overrides" exist: + | quiz | group | timeopen | timeclose | + | Test quiz | G2 | ##tomorrow +1day## | ##tomorrow +3days## | + And I am on the "Test quiz" "quiz activity" page logged in as teacher1 + And I navigate to "Overrides" in current page administration + And I press "Add user override" + And I set the following fields to these values: + | Override user | Sam 1 Student 1 | + | timeopen | ##tomorrow## | + | timeclose | ##tomorrow noon## | + 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 quiz" "link" should not exist in the "Timeline" "block" + And I should not see "##tomorrow noon##%A, %d %B %Y##" in the "Timeline" "block"