1 |
efrain |
1 |
@block @block_timeline @javascript
|
|
|
2 |
Feature: The timeline block allows users to see courses with overdue activities
|
|
|
3 |
In order to view overdue activities in the timeline block
|
|
|
4 |
As a student
|
|
|
5 |
I can select the overdue filter in courses view
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email | idnumber |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com | S1 |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category | startdate | enddate |
|
|
|
13 |
| Course 1 | C1 | 0 | ##now -3 months## | ##tomorrow## |
|
|
|
14 |
| Course 2 | C2 | 0 | ##yesterday## | ##tomorrow## |
|
|
|
15 |
| Course 3 | C3 | 0 | ##yesterday## | ##tomorrow## |
|
|
|
16 |
| Course 4 | C4 | 0 | ##yesterday## | ##tomorrow## |
|
|
|
17 |
| Course 5 | C5 | 0 | ##yesterday## | ##tomorrow## |
|
|
|
18 |
| Course 6 | C6 | 0 | ##yesterday## | ##tomorrow## |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | course | idnumber | name | intro | timeopen | duedate |
|
|
|
21 |
| assign | C1 | assign1 | Test assign 1 | Assign due last month | ##now -2 months## | ##now -1 month## |
|
|
|
22 |
| assign | C2 | assign2 | Test assign 2 | Assign due yesterday | ##now -2 days## | ##yesterday## |
|
|
|
23 |
| assign | C3 | assign3 | Test assign 3 | Assign due yesterday | ##now -2 days## | ##yesterday## |
|
|
|
24 |
| assign | C4 | assign4 | Test assign 4 | Assign due later today | ##yesterday## | ##now +10 minutes## |
|
|
|
25 |
| assign | C5 | assign5 | Test assign 5 | Assign due yesterday | ##now -2 days## | ##yesterday## |
|
|
|
26 |
| assign | C6 | assign6 | Test assign 6 | Assign due tomorrow | ##yesterday## | ##tomorrow## |
|
|
|
27 |
|
|
|
28 |
Scenario: No activities to display as overdue displays expected message
|
|
|
29 |
Given the following "course enrolments" exist:
|
|
|
30 |
| user | course | role |
|
|
|
31 |
| student1 | C1 | student |
|
|
|
32 |
| student1 | C4 | student |
|
|
|
33 |
| student1 | C6 | student |
|
|
|
34 |
Given I log in as "student1"
|
|
|
35 |
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
|
|
36 |
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
|
|
37 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
38 |
When I click on "Overdue" "link" in the "Timeline" "block"
|
|
|
39 |
Then I should see "No activities require action" in the "Timeline" "block"
|
|
|
40 |
And I reload the page
|
|
|
41 |
And I should see "No activities require action" in the "Timeline" "block"
|
|
|
42 |
|
|
|
43 |
Scenario: If filtering by overdue, only courses with a matching item are included
|
|
|
44 |
Given the following "course enrolments" exist:
|
|
|
45 |
| user | course | role |
|
|
|
46 |
| student1 | C1 | student |
|
|
|
47 |
| student1 | C2 | student |
|
|
|
48 |
| student1 | C4 | student |
|
|
|
49 |
| student1 | C5 | student |
|
|
|
50 |
| student1 | C6 | student |
|
|
|
51 |
When I log in as "student1"
|
|
|
52 |
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
|
|
53 |
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
|
|
54 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
55 |
And I click on "Overdue" "link" in the "Timeline" "block"
|
|
|
56 |
Then I should not see "Show more courses" in the "Timeline" "block"
|
|
|
57 |
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
58 |
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
59 |
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
60 |
And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
61 |
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
62 |
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
63 |
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
64 |
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
65 |
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
66 |
And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
67 |
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
68 |
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
69 |
And I reload the page
|
|
|
70 |
And I should not see "Show more courses" in the "Timeline" "block"
|
|
|
71 |
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
72 |
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
73 |
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
74 |
And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
75 |
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
76 |
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
77 |
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
78 |
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
79 |
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
80 |
And "Test assign 3" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
81 |
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
82 |
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
83 |
|
|
|
84 |
Scenario: If filtering by overdue, only courses with a matching item are included and loading more is supported
|
|
|
85 |
Given the following "course enrolments" exist:
|
|
|
86 |
| user | course | role |
|
|
|
87 |
| student1 | C1 | student |
|
|
|
88 |
| student1 | C2 | student |
|
|
|
89 |
| student1 | C3 | student |
|
|
|
90 |
| student1 | C4 | student |
|
|
|
91 |
| student1 | C5 | student |
|
|
|
92 |
| student1 | C6 | student |
|
|
|
93 |
When I log in as "student1"
|
|
|
94 |
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
|
|
95 |
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
|
|
96 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
97 |
And I click on "Overdue" "link" in the "Timeline" "block"
|
|
|
98 |
And I click on "Show more courses" "button" in the "Timeline" "block"
|
|
|
99 |
Then I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
100 |
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
101 |
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
102 |
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
103 |
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
104 |
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
105 |
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
106 |
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
107 |
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
108 |
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
109 |
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
110 |
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
111 |
And I should not see "Show more courses" in the "Timeline" "block"
|
|
|
112 |
And I reload the page
|
|
|
113 |
And I click on "Show more courses" "button" in the "Timeline" "block"
|
|
|
114 |
And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
115 |
And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
116 |
And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
117 |
And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
118 |
And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
119 |
And I should not see "Course 6" in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
120 |
And "Test assign 2" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
121 |
And "Test assign 3" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
122 |
And "Test assign 5" "link" should exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
123 |
And "Test assign 1" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
124 |
And "Test assign 4" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|
|
|
125 |
And "Test assign 6" "link" should not exist in the ".block-timeline [data-region='view-courses']" "css_element"
|