Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_courseformat @core_course @format_weeks @show_editor @javascript
2
Feature: Weeks format bulk activity actions.
3
  In order to edit the course weeks
4
  As a teacher
5
  I need to be able to edit weeks in bulk.
6
 
7
  Background:
8
    Given the following "course" exists:
9
      | fullname    | Course 1  |
10
      | shortname   | C1        |
11
      | category    | 0         |
12
      | numsections | 4         |
13
      | format      | weeks     |
14
      | startdate   | 957139200 |
15
    And the following "activities" exist:
16
      | activity | name              | intro                       | course | idnumber | section |
17
      | assign   | Activity sample 1 | Test assignment description | C1     | sample1  | 1       |
18
      | assign   | Activity sample 2 | Test assignment description | C1     | sample2  | 1       |
19
      | assign   | Activity sample 3 | Test assignment description | C1     | sample3  | 2       |
20
      | assign   | Activity sample 4 | Test assignment description | C1     | sample4  | 2       |
21
    And the following "users" exist:
22
      | username | firstname | lastname | email                |
23
      | teacher1 | Teacher   | 1        | teacher1@example.com |
24
    And the following "course enrolments" exist:
25
      | user     | course | role           |
26
      | teacher1 | C1     | editingteacher |
27
    And I am on the "C1" "Course" page logged in as "teacher1"
28
    And I turn editing mode on
29
    And I click on "Bulk actions" "button"
30
    And I should see "0 selected" in the "sticky-footer" "region"
31
 
32
  Scenario: Bulk hide weeks
33
    Given I should not see "Hidden from students" in the "Activity sample 1" "activity"
34
    And I should not see "Hidden from students" in the "Activity sample 2" "activity"
35
    And I should not see "Hidden from students" in the "Activity sample 3" "activity"
36
    And I should not see "Hidden from students" in the "Activity sample 4" "activity"
37
    And I should not see "Hidden from students" in the "1 May - 7 May" "section"
38
    And I should not see "Hidden from students" in the "8 May - 14 May" "section"
39
    And I should not see "Hidden from students" in the "15 May - 21 May" "section"
40
    And I should not see "Hidden from students" in the "22 May - 28 May" "section"
41
    When I click on "Select section 1 May - 7 May" "checkbox"
42
    And I click on "Select section 8 May - 14 May" "checkbox"
43
    And I should see "2 selected" in the "sticky-footer" "region"
44
    And I click on "Sections availability" "button" in the "sticky-footer" "region"
45
    And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue"
46
    And I click on "Apply" "button" in the "Sections availability" "dialogue"
47
    Then I should see "Hidden from students" in the "Activity sample 1" "activity"
48
    And I should see "Hidden from students" in the "Activity sample 2" "activity"
49
    And I should see "Hidden from students" in the "Activity sample 3" "activity"
50
    And I should see "Hidden from students" in the "Activity sample 4" "activity"
51
    And I should see "Hidden from students" in the "1 May - 7 May" "section"
52
    And I should see "Hidden from students" in the "8 May - 14 May" "section"
53
    And I should not see "Hidden from students" in the "15 May - 21 May" "section"
54
    And I should not see "Hidden from students" in the "22 May - 28 May" "section"
55
    And I should see "0 selected" in the "sticky-footer" "region"
56
 
57
  Scenario: Bulk show weeks
58
    Given I click on "Select section 1 May - 7 May" "checkbox"
59
    And I click on "Select section 15 May - 21 May" "checkbox"
60
    And I click on "Sections availability" "button" in the "sticky-footer" "region"
61
    And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue"
62
    And I click on "Apply" "button" in the "Sections availability" "dialogue"
63
    And I should see "Hidden from students" in the "Activity sample 1" "activity"
64
    And I should see "Hidden from students" in the "Activity sample 2" "activity"
65
    And I should not see "Hidden from students" in the "Activity sample 3" "activity"
66
    And I should not see "Hidden from students" in the "Activity sample 4" "activity"
67
    And I should see "Hidden from students" in the "1 May - 7 May" "section"
68
    And I should not see "Hidden from students" in the "8 May - 14 May" "section"
69
    And I should see "Hidden from students" in the "15 May - 21 May" "section"
70
    And I should not see "Hidden from students" in the "22 May - 28 May" "section"
71
    When I click on "Select section 1 May - 7 May" "checkbox"
72
    And I click on "Select section 8 May - 14 May" "checkbox"
73
    And I should see "2 selected" in the "sticky-footer" "region"
74
    And I click on "Sections availability" "button" in the "sticky-footer" "region"
75
    And I click on "Show on course page" "radio" in the "Sections availability" "dialogue"
76
    And I click on "Apply" "button" in the "Sections availability" "dialogue"
77
    Then I should not see "Hidden from students" in the "Activity sample 1" "activity"
78
    And I should not see "Hidden from students" in the "Activity sample 2" "activity"
79
    And I should not see "Hidden from students" in the "Activity sample 3" "activity"
80
    And I should not see "Hidden from students" in the "Activity sample 4" "activity"
81
    And I should not see "Hidden from students" in the "1 May - 7 May" "section"
82
    And I should not see "Hidden from students" in the "8 May - 14 May" "section"
83
    And I should see "Hidden from students" in the "15 May - 21 May" "section"
84
    And I should not see "Hidden from students" in the "22 May - 28 May" "section"
85
 
86
  Scenario: Delete a single week using bulk action
87
    Given I should see "1 May - 7 May" in the "region-main" "region"
88
    And I should see "8 May - 14 May" in the "region-main" "region"
89
    And I should see "15 May - 21 May" in the "region-main" "region"
90
    And I should see "22 May - 28 May" in the "region-main" "region"
91
    And I should see "Activity sample 1" in the "1 May - 7 May" "section"
92
    And I should see "Activity sample 2" in the "1 May - 7 May" "section"
93
    And I should see "Activity sample 3" in the "8 May - 14 May" "section"
94
    And I should see "Activity sample 4" in the "8 May - 14 May" "section"
95
    And I click on "Select section 1 May - 7 May" "checkbox"
96
    And I click on "Select section 8 May - 14 May" "checkbox"
97
    And I should see "2 selected" in the "sticky-footer" "region"
98
    When I click on "Delete sections" "button" in the "sticky-footer" "region"
99
    And I click on "Delete" "button" in the "Delete selected sections?" "dialogue"
100
    Then I should see "1 May - 7 May" in the "region-main" "region"
101
    And I should see "8 May - 14 May" in the "region-main" "region"
102
    And I should not see "15 May - 21 May" in the "region-main" "region"
103
    And I should not see "22 May - 28 May" in the "region-main" "region"
104
    And I should not see "Activity sample 1" in the "1 May - 7 May" "section"
105
    And I should not see "Activity sample 2" in the "1 May - 7 May" "section"
106
    And I should not see "Activity sample 3" in the "8 May - 14 May" "section"
107
    And I should not see "Activity sample 4" in the "8 May - 14 May" "section"
108
    And I should see "0 selected" in the "sticky-footer" "region"
109
 
110
  Scenario: Delete several weeks in bulk
111
    Given I should see "1 May - 7 May" in the "region-main" "region"
112
    And I should see "8 May - 14 May" in the "region-main" "region"
113
    And I should see "15 May - 21 May" in the "region-main" "region"
114
    And I should see "22 May - 28 May" in the "region-main" "region"
115
    And I should see "Activity sample 1" in the "1 May - 7 May" "section"
116
    And I should see "Activity sample 2" in the "1 May - 7 May" "section"
117
    And I should see "Activity sample 3" in the "8 May - 14 May" "section"
118
    And I should see "Activity sample 4" in the "8 May - 14 May" "section"
119
    And I click on "Select section 8 May - 14 May" "checkbox"
120
    And I click on "Select section 15 May - 21 May" "checkbox"
121
    And I should see "2 selected" in the "sticky-footer" "region"
122
    When I click on "Delete sections" "button" in the "sticky-footer" "region"
123
    And I click on "Delete" "button" in the "Delete selected sections?" "dialogue"
124
    Then I should see "1 May - 7 May" in the "region-main" "region"
125
    And I should see "8 May - 14 May" in the "region-main" "region"
126
    And I should not see "15 May - 21 May" in the "region-main" "region"
127
    And I should not see "22 May - 28 May" in the "region-main" "region"
128
    And I should see "Activity sample 1" in the "1 May - 7 May" "section"
129
    And I should see "Activity sample 1" in the "1 May - 7 May" "section"
130
    And I should see "Activity sample 2" in the "1 May - 7 May" "section"
131
    And I should not see "Activity sample 3" in the "8 May - 14 May" "section"
132
    And I should not see "Activity sample 4" in the "8 May - 14 May" "section"
133
    And I should see "0 selected" in the "sticky-footer" "region"
134
 
135
  Scenario: Bulk move sections after general section
136
    Given I set the field "Edit section name" in the "8 May - 14 May" "section" to "Move one"
137
    And I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move two"
138
    And I click on "Select section Move one" "checkbox"
139
    And I click on "Select section Move two" "checkbox"
140
    And I should see "2 selected" in the "sticky-footer" "region"
141
    When I click on "Move sections" "button" in the "sticky-footer" "region"
142
    And I click on "General" "link" in the "Move selected sections" "dialogue"
143
    # Check activities are moved with the weeks.
144
    Then I should see "Activity sample 1" in the "15 May - 21 May" "section"
145
    And I should see "Activity sample 2" in the "15 May - 21 May" "section"
146
    And I should see "Activity sample 3" in the "Move one" "section"
147
    And I should see "Activity sample 4" in the "Move one" "section"
148
    # Check new section order.
149
    And "Move one" "section" should appear after "General" "section"
150
    And "Move two" "section" should appear after "Move one" "section"
151
    And "15 May - 21 May" "section" should appear after "Move two" "section"
152
    And "22 May - 28 May" "section" should appear after "15 May - 21 May" "section"
153
 
154
  Scenario: Bulk move sections at the end of the course
155
    Given I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move me"
156
    And I click on "Select section 8 May - 14 May" "checkbox"
157
    And I click on "Select section Move me" "checkbox"
158
    And I should see "2 selected" in the "sticky-footer" "region"
159
    When I click on "Move sections" "button" in the "sticky-footer" "region"
160
    And I click on "22 May - 28 May" "link" in the "Move selected sections" "dialogue"
161
    # Check activities are moved with the weeks.
162
    Then I should see "Activity sample 1" in the "1 May - 7 May" "section"
163
    And I should see "Activity sample 2" in the "1 May - 7 May" "section"
164
    And I should see "Activity sample 3" in the "15 May - 21 May" "section"
165
    And I should see "Activity sample 4" in the "15 May - 21 May" "section"
166
    # Check new section order.
167
    And "1 May - 7 May" "section" should appear after "General" "section"
168
    And "8 May - 14 May" "section" should appear after "1 May - 7 May" "section"
169
    And "15 May - 21 May" "section" should appear after "8 May - 14 May" "section"
170
    And "Move me" "section" should appear after "15 May - 21 May" "section"
171
 
172
  Scenario: Bulk move sections in the middle of the course
173
    Given I set the field "Edit section name" in the "22 May - 28 May" "section" to "Move me"
174
    And I click on "Select section 1 May - 7 May" "checkbox"
175
    And I click on "Select section Move me" "checkbox"
176
    And I should see "2 selected" in the "sticky-footer" "region"
177
    When I click on "Move sections" "button" in the "sticky-footer" "region"
178
    And I click on "8 May - 14 May" "link" in the "Move selected sections" "dialogue"
179
    # Check activities are moved with the weeks.
180
    Then I should see "Activity sample 1" in the "8 May - 14 May" "section"
181
    And I should see "Activity sample 2" in the "8 May - 14 May" "section"
182
    And I should see "Activity sample 3" in the "1 May - 7 May" "section"
183
    And I should see "Activity sample 4" in the "1 May - 7 May" "section"
184
    # Check new section order.
185
    And "1 May - 7 May" "section" should appear after "General" "section"
186
    And "8 May - 14 May" "section" should appear after "1 May - 7 May" "section"
187
    And "Move me" "section" should appear after "8 May - 14 May" "section"
188
    And "22 May - 28 May" "section" should appear after "Move me" "section"