Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_timeline @javascript
2
Feature: The timeline block allows users to see upcoming activities
3
  In order to enable the timeline block
4
  As a student
5
  I can add the timeline block to my dashboard
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                | idnumber |
10
      | student1 | Student   | 1        | student1@example.com | S1       |
11
      | student2 | Student   | 2        | student2@example.com | S2       |
12
    And the following "courses" exist:
13
      | fullname | shortname | category | startdate                   | enddate         |
14
      | Course 1 | C1        | 0        | ##1 month ago##             | ##15 days ago## |
15
      | Course 2 | C2        | 0        | ##yesterday##               | ##tomorrow## |
16
      | Course 3 | C3        | 0        | ##first day of next month## | ##last day of next month## |
17
    And the following "activities" exist:
18
      | activity | course | idnumber  | name            | intro                   | timeopen      | timeclose     |
19
      | choice   | C2     | choice1   | Test choice 1   | Test choice description | ##yesterday## | ##tomorrow##  |
20
      | choice   | C1     | choice2   | Test choice 2   | Test choice description | ##1 month ago## | ##15 days ago##  |
21
      | choice   | C3     | choice3   | Test choice 3   | Test choice description | ##first day of +5 months## | ##last day of +5 months##  |
22
      | feedback | C2     | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow##  |
23
      | feedback | C1     | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months##  |
24
      | feedback | C3     | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
25
      | feedback | C2     | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##now +1 minute## |
26
    And the following "activities" exist:
27
      | activity | course | idnumber  | name            | intro                   | timeopen        | duedate           |
28
      | assign   | C1     | assign1   | Test assign 1   | Test assign description | ##1 month ago## | ##yesterday##     |
29
      | assign   | C2     | assign2   | Test assign 2   | Test assign description | ##yesterday##   | ##now -1 minute## |
30
    And the following "course enrolments" exist:
31
      | user | course | role |
32
      | student1 | C1 | student |
33
      | student1 | C2 | student |
34
      | student1 | C3 | student |
35
    And I change window size to "large"
36
 
37
  Scenario: Next 7 days in date view
38
    Given I log in as "student1"
39
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
40
    When I click on "Next 7 days" "link" in the "Timeline" "block"
41
    Then "Test choice 1" "link" should exist in the "Timeline" "block"
42
    And I should see "Choice closes · Course 2" in the "Timeline" "block"
43
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
44
    And I should see "Feedback closes · Course 2" in the "Timeline" "block"
45
    And "Test assign 2" "link" should exist in the "Timeline" "block"
46
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
47
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
48
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
49
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
50
    And "Test assign 1" "link" should not exist in the "Timeline" "block"
51
    And I should not see "Assignment is due · Course 1" in the "Timeline" "block"
52
 
53
  Scenario: Overdue in date view
54
    Given I log in as "student1"
55
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
56
    When I click on "Overdue" "link" in the "Timeline" "block"
57
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
58
    And I should see "Assignment is due · Course 1" in the "Timeline" "block"
59
    And "Test assign 2" "link" should exist in the "Timeline" "block"
60
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
61
    And "Test feedback 1" "link" should not exist in the "Timeline" "block"
62
    And "Test choice 1" "link" should not exist in the "Timeline" "block"
63
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
64
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
65
    And "Test feedback 4" "link" should not exist in the "Timeline" "block"
66
 
67
  Scenario: All in date view
68
    Given I log in as "student1"
69
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
70
    When I click on "All" "link" in the "Timeline" "block"
71
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
72
    And I should see "Assignment is due · Course 1" in the "Timeline" "block"
73
    And "Test assign 2" "link" should exist in the "Timeline" "block"
74
    And I should see "Assignment is due · Course 2" in the "Timeline" "block"
75
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
76
    And I should see "Feedback closes · Course 2" in the "Timeline" "block"
77
    And "Test choice 1" "link" should exist in the "Timeline" "block"
78
    And I should see "Choice closes · Course 2" in the "Timeline" "block"
79
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
80
    And I should see "Feedback closes · Course 2" in the "Timeline" "block"
81
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
82
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
83
    And I click on "Show more activities" "button"
84
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
85
    And I should see "Feedback closes · Course 1" in the "Timeline" "block"
86
    And "Test choice 3" "link" should exist in the "Timeline" "block"
87
    And I should see "Test assign 1" in the "Timeline" "block"
88
    And I should see "Test feedback 1" in the "Timeline" "block"
89
    And I should see "Test choice 1" in the "Timeline" "block"
90
    And I should see "Test choice 3" in the "Timeline" "block"
91
    And I should see "Test feedback 3" in the "Timeline" "block"
92
    And I should not see "Test choice 2" in the "Timeline" "block"
93
 
94
  Scenario: Persistent All in date view
95
    Given I log in as "student1"
96
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
97
    When I click on "All" "link" in the "Timeline" "block"
98
    And I reload the page
99
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
100
    And I should see "Assignment is due · Course 1" in the "Timeline" "block"
101
    And "Test assign 2" "link" should exist in the "Timeline" "block"
102
    And I should see "Assignment is due · Course 2" in the "Timeline" "block"
103
    And "Test feedback 1" "link" should exist in the "Timeline" "block"
104
    And I should see "Feedback closes · Course 2" in the "Timeline" "block"
105
    And "Test choice 1" "link" should exist in the "Timeline" "block"
106
    And I should see "Choice closes · Course 2" in the "Timeline" "block"
107
    And "Test feedback 4" "link" should exist in the "Timeline" "block"
108
    And I should see "Feedback closes · Course 2" in the "Timeline" "block"
109
    And I should not see "Test choice 2" in the "Timeline" "block"
110
    And I should not see "Test feedback 2" in the "Timeline" "block"
111
    And I click on "Show more activities" "button"
112
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
113
    And I should see "Feedback closes · Course 1" in the "Timeline" "block"
114
    And I should see "Test assign 1" in the "Timeline" "block"
115
    And I should see "Test feedback 1" in the "Timeline" "block"
116
    And I should see "Test feedback 3" in the "Timeline" "block"
117
    And I should see "Test choice 1" in the "Timeline" "block"
118
    And I should not see "Test choice 2" in the "Timeline" "block"
119
    And I should see "Test choice 3" in the "Timeline" "block"
120
 
121
  Scenario: Persistent Overdue in date view
122
    Given I log in as "student1"
123
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
124
    When I click on "Overdue" "link" in the "Timeline" "block"
125
    And I reload the page
126
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
127
    And I should see "Assignment is due · Course 1" in the "Timeline" "block"
128
    And "Test assign 2" "link" should exist in the "Timeline" "block"
129
    And I should see "Assignment is due · Course 2" in the "Timeline" "block"
130
    And "Test feedback 1" "link" should not exist in the "Timeline" "block"
131
    And "Test feedback 3" "link" should not exist in the "Timeline" "block"
132
    And "Test feedback 4" "link" should not exist in the "Timeline" "block"
133
    And "Test choice 1" "link" should not exist in the "Timeline" "block"
134
    And "Test choice 2" "link" should not exist in the "Timeline" "block"
135
    And "Test choice 3" "link" should not exist in the "Timeline" "block"
136
 
137
  Scenario: Current filtering always applies in date view
138
    Given I log in as "student1"
139
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
140
    And I click on "Overdue" "link" in the "Timeline" "block"
141
    And I reload the page
142
    And "Test assign 1" "link" should exist in the "Timeline" "block"
143
    And "Test feedback 2" "link" should not exist in the "Timeline" "block"
144
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
145
    And I click on "Sort by courses" "link" in the "Timeline" "block"
146
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
147
    # Confirm that when we switch back to date view, the "All" filer continues to be applied (and not "overdue")
148
    When I click on "All" "link" in the "Timeline" "block"
149
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
150
    And I click on "Sort by dates" "link" in the "Timeline" "block"
151
    Then "Test assign 1" "link" should exist in the "Timeline" "block"
152
    And I click on "Show more activities" "button"
153
    And "Test feedback 2" "link" should exist in the "Timeline" "block"
154
 
155
  Scenario: Student not enrolled in any courses sees a message
156
    Given I log in as "student2"
157
    When I click on "Sort timeline items" "button" in the "Timeline" "block"
158
    And I click on "Sort by dates" "link" in the "Timeline" "block"
159
    Then I should see "No in-progress courses" in the "Timeline" "block"
160
    And I should not see "Test choice 1"