1 |
efrain |
1 |
@block @block_timeline @javascript
|
|
|
2 |
Feature: The timeline block allows users to use the lazy loading to view more activities
|
|
|
3 |
|
|
|
4 |
Background:
|
|
|
5 |
Given the following "users" exist:
|
|
|
6 |
| username | firstname | lastname | email | idnumber |
|
|
|
7 |
| student1 | Student | 1 | student1@example.com | S1 |
|
|
|
8 |
And the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | startdate | enddate |
|
|
|
10 |
| Course 1 | C1 | 0 | ##yesterday## | ##last day of next month## |
|
|
|
11 |
| Course 2 | C2 | 0 | ##yesterday## | ##last day of next month## |
|
|
|
12 |
And the following "course enrolments" exist:
|
|
|
13 |
| user | course | role |
|
|
|
14 |
| student1 | C1 | student |
|
|
|
15 |
| student1 | C2 | student |
|
|
|
16 |
And the following "activities" exist:
|
|
|
17 |
| activity | course | idnumber | name | intro | timeopen | timeclose |
|
|
|
18 |
| choice | C1 | choice1 | Test choice 1 | Test choice description | ##yesterday## | ##tomorrow## |
|
|
|
19 |
| choice | C1 | choice2 | Test choice 2 | Test choice description | ##yesterday## | ##+1 days## |
|
|
|
20 |
| choice | C1 | choice3 | Test choice 3 | Test choice description | ##yesterday## | ##+2 days## |
|
|
|
21 |
| choice | C1 | choice4 | Test choice 4 | Test choice description | ##yesterday## | ##+3 days## |
|
|
|
22 |
| choice | C1 | choice5 | Test choice 5 | Test choice description | ##yesterday## | ##+4 days## |
|
|
|
23 |
| choice | C1 | choice6 | Test choice 6 | Test choice description | ##yesterday## | ##+5 days## |
|
|
|
24 |
| choice | C1 | choice7 | Test choice 7 | Test choice description | ##yesterday## | ##+6 days## |
|
|
|
25 |
| choice | C1 | choice8 | Test choice 8 | Test choice description | ##yesterday## | ##+7 days## |
|
|
|
26 |
| choice | C1 | choice9 | Test choice 9 | Test choice description | ##yesterday## | ##+8 days## |
|
|
|
27 |
| choice | C1 | choice10 | Test choice 10 | Test choice description | ##yesterday## | ##+9 days## |
|
|
|
28 |
| choice | C2 | choice10 | Test choice 11 | Test choice description | ##yesterday## | ##+9 days## |
|
|
|
29 |
And the following "activities" exist:
|
|
|
30 |
| activity | course | idnumber | name | intro | timeopen | duedate |
|
|
|
31 |
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
|
|
|
32 |
|
|
|
33 |
Scenario: Lazy loading for date view
|
|
|
34 |
Given I log in as "student1"
|
|
|
35 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
36 |
When I click on "All" "link" in the "Timeline" "block"
|
|
|
37 |
Then I should see "Test choice 1" in the "Timeline" "block"
|
|
|
38 |
And "Test assign 1" "link" should exist in the "Timeline" "block"
|
|
|
39 |
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
|
|
40 |
And "Test choice 2" "link" should exist in the "Timeline" "block"
|
|
|
41 |
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
|
|
42 |
And "Test choice 4" "link" should exist in the "Timeline" "block"
|
|
|
43 |
And "Test choice 5" "link" should not exist in the "Timeline" "block"
|
|
|
44 |
And "Test choice 6" "link" should not exist in the "Timeline" "block"
|
|
|
45 |
And "Test choice 7" "link" should not exist in the "Timeline" "block"
|
|
|
46 |
And "Test choice 8" "link" should not exist in the "Timeline" "block"
|
|
|
47 |
And "Test choice 9" "link" should not exist in the "Timeline" "block"
|
|
|
48 |
And "Test choice 10" "link" should not exist in the "Timeline" "block"
|
|
|
49 |
And "Test choice 11" "link" should not exist in the "Timeline" "block"
|
|
|
50 |
And I click on "Show more activities" "button" in the "[data-region='view-dates']" "css_element"
|
|
|
51 |
And "Test choice 5" "link" should exist in the "Timeline" "block"
|
|
|
52 |
And "Test choice 6" "link" should exist in the "Timeline" "block"
|
|
|
53 |
And "Test choice 7" "link" should exist in the "Timeline" "block"
|
|
|
54 |
And "Test choice 8" "link" should exist in the "Timeline" "block"
|
|
|
55 |
And "Test choice 9" "link" should exist in the "Timeline" "block"
|
|
|
56 |
And "Test choice 10" "link" should exist in the "Timeline" "block"
|
|
|
57 |
And "Test choice 11" "link" should exist in the "Timeline" "block"
|
|
|
58 |
|
|
|
59 |
Scenario: Lazy loading for course view
|
|
|
60 |
Given I log in as "student1"
|
|
|
61 |
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
|
|
62 |
When I click on "Sort by courses" "link" in the "Timeline" "block"
|
|
|
63 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
64 |
And I click on "All" "link" in the "Timeline" "block"
|
|
|
65 |
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
|
|
66 |
And "Test choice 2" "link" should exist in the "Timeline" "block"
|
|
|
67 |
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
|
|
68 |
And "Test choice 4" "link" should exist in the "Timeline" "block"
|
|
|
69 |
And "Test choice 5" "link" should exist in the "Timeline" "block"
|
|
|
70 |
And "Test choice 11" "link" should exist in the "Timeline" "block"
|
|
|
71 |
And "Test choice 6" "link" should not exist in the "Timeline" "block"
|
|
|
72 |
And "Test choice 7" "link" should not exist in the "Timeline" "block"
|
|
|
73 |
And "Test choice 8" "link" should not exist in the "Timeline" "block"
|
|
|
74 |
And "Test choice 9" "link" should not exist in the "Timeline" "block"
|
|
|
75 |
And "Test choice 10" "link" should not exist in the "Timeline" "block"
|
|
|
76 |
And I click on "Show more activities" "button" in the "[data-region='view-courses']" "css_element"
|
|
|
77 |
And "Test choice 6" "link" should exist in the "Timeline" "block"
|
|
|
78 |
And "Test choice 7" "link" should exist in the "Timeline" "block"
|
|
|
79 |
And "Test choice 8" "link" should exist in the "Timeline" "block"
|
|
|
80 |
And "Test choice 9" "link" should exist in the "Timeline" "block"
|
|
|
81 |
And "Test choice 10" "link" should exist in the "Timeline" "block"
|
|
|
82 |
|
|
|
83 |
Scenario: The lazy loading button will not be shown if the number of events is smaller than 5
|
|
|
84 |
Given I log in as "student1"
|
|
|
85 |
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
|
|
86 |
And I click on "Sort by dates" "link" in the "Timeline" "block"
|
|
|
87 |
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
|
|
88 |
When I click on "Overdue" "link" in the "Timeline" "block"
|
|
|
89 |
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
|
|
90 |
And "Show more activities" "button" should not exist in the "[data-region='view-courses']" "css_element"
|