1 |
efrain |
1 |
@mod @mod_data
|
|
|
2 |
Feature: Students can view upcoming data activities in the timeline block
|
|
|
3 |
In order for student to see upcoming data activities in timeline block
|
|
|
4 |
As a teacher
|
|
|
5 |
I should be able to set the availability dates of data activities
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | One | student1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname |
|
|
|
13 |
| Course 1 | C1 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| student1 | C1 | student |
|
|
|
17 |
|
|
|
18 |
@javascript
|
|
|
19 |
Scenario Outline: Student can view upcoming data activities in the timeline block
|
|
|
20 |
Given the following "activities" exist:
|
|
|
21 |
| activity | course | name | id_timeavailablefrom_enabled | timeavailablefrom | id_timeavailableto_enabled | timeavailableto |
|
|
|
22 |
| data | C1 | DB Past | 1 | <pastfrom> | 1 | <pastto> |
|
|
|
23 |
| data | C1 | DB Future | 1 | <futurefrom> | 1 | <futureto> |
|
|
|
24 |
| data | C1 | DB No date | 0 | | 0 | |
|
|
|
25 |
# Confirm that student can see future but not past db activity in the timeline block
|
|
|
26 |
When I log in as "student 1"
|
|
|
27 |
Then I should not see "DB Past" in the "Timeline" "block"
|
|
|
28 |
# Also confirm that student can't see db activity where availability is disabled
|
|
|
29 |
And I should not see "DB No Date" in the "Timeline" "block"
|
|
|
30 |
And I should see "DB Future" in the "Timeline" "block"
|
|
|
31 |
# Confirm link works and redirects to db activity
|
|
|
32 |
And I click on "DB Future" "link" in the "Timeline" "block"
|
|
|
33 |
And the activity date in "DB Future" should contain "Opens:"
|
|
|
34 |
And the activity date in "DB Future" should contain "<futurefrom>%A, %d %B %Y, %I:%M##"
|
|
|
35 |
And the activity date in "DB Future" should contain "Closes:"
|
|
|
36 |
And the activity date in "DB Future" should contain "<futureto>%A, %d %B %Y, %I:%M##"
|
|
|
37 |
|
|
|
38 |
Examples:
|
|
|
39 |
| pastfrom | pastto | futurefrom | futureto |
|
|
|
40 |
| ##1 month ago## | ##yesterday## | ##tomorrow## | ##tomorrow +1day## |
|
|
|
41 |
| ##yesterday## | ##yesterday +3hours## | ##tomorrow noon## | ##tomorrow noon +3hours## |
|
|
|
42 |
| ##6 months ago## | ##1 week ago## | ##tomorrow +5days## | ##tomorrow +6days## |
|