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 search for upcoming activities
3
  As a student
4
  I can search for the upcoming activities in the timeline block
5
 
6
  Background:
7
    Given the following "users" exist:
8
      | username | firstname | lastname | email               | idnumber |
9
      | student1 | Student  | 1        | student1@example.com | S1       |
10
    And the following "courses" exist:
11
      | fullname                  | shortname | category | startdate                   | enddate                    |
12
      | Course 1                  | C1        | 0        | ##1 month ago##             | ##15 days ago##            |
13
      | Course 2                  | C2        | 0        | ##yesterday##               | ##tomorrow##               |
14
      | Course 3                  | C3        | 0        | ##first day of next month## | ##last day of next month## |
15
      | Course 4                  | C4        | 0        | ##1 month ago##             | ##tomorrow##               |
16
      | Course 5                  | C5        | 0        | ##first day of last month## | ##last day of next month## |
17
      | Course with advanced name | C6        | 0        | ##first day of last month## | ##last day of next month## |
18
    And the following "activities" exist:
19
      | activity | course | idnumber  | name                      | intro                     | timeopen                   | timeclose                  | duedate      |
20
      | choice   | C2     | choice1   | Test choice 1             | Test choice description   | ##yesterday##              | ##tomorrow##               |              |
21
      | choice   | C1     | choice2   | Test choice 2             | Test choice description   | ##first day of +5 months## | ##last day of +5 months##  |              |
22
      | choice   | C3     | choice3   | Test choice 3             | Test choice description   | ##first day of +5 months## | ##last day of +10 months## |              |
23
      | choice   | C2     | choice4   | Test choice 4             | Test choice description   | ##first day of +5 months## | ##last day of +15 months## |              |
24
      | choice   | C1     | choice5   | Test choice 5             | Test choice description   | ##first day of +5 months## | ##last day of +20 months## |              |
25
      | choice   | C3     | choice6   | Test choice 6             | Test choice description   | ##first day of +5 months## | ##last day of +25 months## |              |
26
      | choice   | C4     | choice7   | Test choice 7             | Test choice description   | ##first day of +5 months## | ##last day of +5 months##  |              |
27
      | choice   | C5     | choice8   | Test choice 8             | Test choice description   | ##first day of +5 months## | ##last day of +10 months## |              |
28
      | feedback | C2     | feedback1 | Test feedback 1           | Test feedback description | ##yesterday##              | ##tomorrow##               |              |
29
      | feedback | C1     | feedback2 | Test feedback 2           | Test feedback description | ##first day of +5 months## | ##last day of +5 months##  |              |
30
      | feedback | C3     | feedback3 | Test feedback 3           | Test feedback description | ##first day of +5 months## | ##last day of +10 months## |              |
31
      | assign   | C6     | assign1   | Assign with advanced name | Test assign description   | ##yesterday##              |                            | ##tomorrow## |
32
    And the following "course enrolments" exist:
33
      | user     | course | role    |
34
      | student1 | C1     | student |
35
      | student1 | C2     | student |
36
      | student1 | C3     | student |
37
      | student1 | C4     | student |
38
      | student1 | C5     | student |
39
      | student1 | C6     | student |
40
 
41
  Scenario: The search should return no events if I enter the wrong value
42
    Given I log in as "student1"
43
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
44
    And I click on "All" "link" in the "Timeline" "block"
45
    When I set the field "Search" in the "Timeline" "block" to "Fake example"
46
    Then I should see "No activities require action" in the "Timeline" "block"
47
 
48
  Scenario: Search for Course name
49
    Given I log in as "student1"
50
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
51
    And I click on "All" "link" in the "Timeline" "block"
52
    When I set the field "Search" in the "Timeline" "block" to "Course 1"
53
    Then I should see "Test choice 2" in the "Timeline" "block"
54
    And I should see "Test choice 5" in the "Timeline" "block"
55
    And I should see "Test feedback 2" in the "Timeline" "block"
56
    And I should not see "Test choice 1" in the "Timeline" "block"
57
    And I should not see "Test choice 3" in the "Timeline" "block"
58
    And I should not see "Test choice 4" in the "Timeline" "block"
59
    And I should not see "Test feedback 1" in the "Timeline" "block"
60
    And I should not see "Test feedback 3" in the "Timeline" "block"
61
 
62
  Scenario: Search for Course name - Advanced
63
    Given I log in as "student1"
64
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
65
    And I click on "All" "link" in the "Timeline" "block"
66
    When I set the field "Search" in the "Timeline" "block" to "Course advanced"
67
    Then I should see "Assign with advanced name" in the "Timeline" "block"
68
 
69
  Scenario: Search for Activity name
70
    Given I log in as "student1"
71
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
72
    And I click on "All" "link" in the "Timeline" "block"
73
    When I set the field "Search" in the "Timeline" "block" to "Test choice 1"
74
    And I wait until "Test choice 2" "text" does not exist
75
    Then I should see "Test choice 1" in the "Timeline" "block"
76
    And I should not see "Test choice 2" in the "Timeline" "block"
77
    And I should not see "Test choice 3" in the "Timeline" "block"
78
    And I should not see "Test choice 4" in the "Timeline" "block"
79
    And I should not see "Test choice 5" in the "Timeline" "block"
80
    And I should not see "Test choice 6" in the "Timeline" "block"
81
    And I should not see "Test feedback 1" in the "Timeline" "block"
82
    And I should not see "Test feedback 2" in the "Timeline" "block"
83
    And I should not see "Test feedback 3" in the "Timeline" "block"
84
 
85
  Scenario: Search for Activity name - Advanced
86
    Given I log in as "student1"
87
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
88
    And I click on "All" "link" in the "Timeline" "block"
89
    When I set the field "Search" in the "Timeline" "block" to "Assign advanced"
90
    Then I should see "Assign with advanced name" in the "Timeline" "block"
91
 
92
  Scenario: Search for Activity type
93
    Given I log in as "student1"
94
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
95
    And I click on "All" "link" in the "Timeline" "block"
96
    When I set the field "Search" in the "Timeline" "block" to "feedback"
97
    Then I should see "Test feedback 1" in the "Timeline" "block"
98
    And I should see "Test feedback 2" in the "Timeline" "block"
99
    And I should see "Test feedback 3" in the "Timeline" "block"
100
    And I should not see "Test choice 1" in the "Timeline" "block"
101
    And I should not see "Test choice 2" in the "Timeline" "block"
102
    And I should not see "Test choice 3" in the "Timeline" "block"
103
    And I should not see "Test choice 4" in the "Timeline" "block"
104
    And I should not see "Test choice 5" in the "Timeline" "block"
105
 
106
  Scenario: Timeline paginated search
107
    Given I log in as "student1"
108
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
109
    And I click on "All" "link" in the "Timeline" "block"
110
    When I set the field "Search" in the "Timeline" "block" to "choice"
111
    Then I should see "Test choice 1" in the "Timeline" "block"
112
    And I should see "Test choice 2" in the "Timeline" "block"
113
    And I should see "Test choice 3" in the "Timeline" "block"
114
    And I should see "Test choice 7" in the "Timeline" "block"
115
    And I should see "Test choice 8" in the "Timeline" "block"
116
    And I should not see "Test choice 4" in the "Timeline" "block"
117
    And I should not see "Test choice 5" in the "Timeline" "block"
118
    And I should not see "Test choice 6" in the "Timeline" "block"
119
    And I click on "Show more activities" "button"
120
    And I should see "Test choice 4" in the "Timeline" "block"
121
    And I should see "Test choice 5" in the "Timeline" "block"
122
    And I should see "Test choice 6" in the "Timeline" "block"
123
 
124
  Scenario: Courses view is refreshed when search changes
125
    Given I log in as "student1"
126
    And I click on "Sort timeline items" "button" in the "Timeline" "block"
127
    And I click on "Sort by courses" "link" in the "Timeline" "block"
128
    And I click on "Filter timeline by date" "button" in the "Timeline" "block"
129
    And I click on "All" "link" in the "Timeline" "block"
130
    And I click on "Show more courses" "button" in the "Timeline" "block"
131
    And I should see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
132
    And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
133
    And I should see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
134
    And I should see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
135
    And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
136
    And I click on "Show more courses" "button" in the "Timeline" "block"
137
    And I should see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
138
    And I should see "Test choice 1" in the ".block-timeline [data-region='view-courses']" "css_element"
139
    And I should see "Test choice 2" in the ".block-timeline [data-region='view-courses']" "css_element"
140
    And I should see "Test choice 3" in the ".block-timeline [data-region='view-courses']" "css_element"
141
    And I should see "Test choice 7" in the ".block-timeline [data-region='view-courses']" "css_element"
142
    And I should see "Test choice 8" in the ".block-timeline [data-region='view-courses']" "css_element"
143
    When I set the field "Search by activity type or name" to "choice 1"
144
    And I wait until "Course 4" "text" does not exist
145
    Then I should see "Test choice 1" in the "Timeline" "block"
146
    And I should see "Course 2" in the ".block-timeline [data-region='view-courses']" "css_element"
147
    And I should not see "Course 1" in the ".block-timeline [data-region='view-courses']" "css_element"
148
    And I should not see "Course 3" in the ".block-timeline [data-region='view-courses']" "css_element"
149
    And I should not see "Course 4" in the ".block-timeline [data-region='view-courses']" "css_element"
150
    And I should not see "Course 5" in the ".block-timeline [data-region='view-courses']" "css_element"
151
    And I should not see "Test choice 2" in the ".block-timeline [data-region='view-courses']" "css_element"
152
    And I should not see "Test choice 3" in the ".block-timeline [data-region='view-courses']" "css_element"
153
    And I should not see "Test choice 7" in the ".block-timeline [data-region='view-courses']" "css_element"
154
    And I should not see "Test choice 8" in the ".block-timeline [data-region='view-courses']" "css_element"