Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course
2
Feature: Course activity controls works as expected
3
  In order to manage my course's activities
4
  As a teacher
5
  I need to edit, hide and show activities inside course sections
6
 
7
  # The difference between these two scenario outlines is that one is with
8
  # JS enabled and the other one with JS disabled; we can not use Background
9
  # sections when using Scenario Outlines because of Behat framework restrictions.
10
 
11
  # We are testing:
12
  # * Javascript on and off
13
  # * Topics and weeks course formats
14
  # * Course controls without paged mode
15
  # * Course controls with paged mode in the course home page
16
  # * Course controls with paged mode in a section's page
17
 
18
  @javascript @_cross_browser
19
  Scenario Outline: Check activities using topics and weeks formats, and paged mode and not paged mode
20
    Given the following "users" exist:
21
      | username | firstname | lastname | email                |
22
      | teacher1 | Teacher   | 1        | teacher1@example.com |
23
    And the following "course" exists:
24
      | fullname     | Course 1        |
25
      | shortname    | C1              |
26
      | format       | <courseformat>  |
27
      |coursedisplay | <coursedisplay> |
28
      | numsections  | 5               |
29
      | startdate    | 0               |
30
      | initsections | <initsections>  |
31
    And the following "course enrolments" exist:
32
      | user | course | role           |
33
      | teacher1 | C1 | editingteacher |
34
    And the following "activities" exist:
35
      | activity | course | section            | name              |
36
      | forum    | C1     | <targetsectionnum> | Test forum name 1 |
37
      | forum    | C1     | <targetsectionnum> | Test forum name 2 |
38
      | forum    | C1     | 1                  | Test forum name 3 |
39
    And I am on the "Course 1" course page logged in as "teacher1"
40
    When I click on <targetpage> "link" in the "region-main" "region"
41
    And I turn editing mode on
42
    And I add the "Recent activity" block
43
    And I open the action menu in "Recent activity" "block"
44
    And I click on "Delete Recent activity block" "link"
45
    And I click on "Delete" "button" in the "Delete block?" "dialogue"
46
    And <belowpage> "section" should not exist
47
    And I open "Test forum name 1" actions menu
48
    And I click on "Edit settings" "link" in the "Test forum name 1" activity
49
    And I should see "Edit settings"
50
    And I should see "Display description on course page"
51
    And I set the following fields to these values:
52
      | Forum name | Just to check that I can edit the name |
53
      | Description | Just to check that I can edit the description |
54
      | Display description on course page | 1 |
55
    And I click on "Cancel" "button"
56
    And <belowpage> "section" should not exist
57
    And I open "Test forum name 1" actions menu
58
    And I choose "Hide" in the open action menu
59
    And <belowpage> "section" should not exist
60
    And I delete "Test forum name 1" activity
61
    And I should not see "Test forum name 1" in the "region-main" "region"
62
    And I duplicate "Test forum name 2" activity editing the new copy with:
63
      | Forum name | Edited test forum name 2 |
64
    And <belowpage> "section" should not exist
65
    And I should see "Test forum name 2"
66
    And I should see "Edited test forum name 2"
67
    # General section can't be hidden. Check this part using always the first section.
68
    And I am on the "Course 1" course page
69
    And I hide section "1"
70
    And section "1" should be hidden
71
    And all activities in section "1" should be hidden
72
    And I show section "1"
73
    And section "1" should be visible
74
    And I am on the "C1 > Section 1" "course > section" page
75
    And <belowpage> "section" should not exist
76
    And the following config values are set as admin:
77
      | unaddableblocks | | theme_boost|
78
    And I add the "Section links" block
79
    And <belowpage> "section" should not exist
80
    And I should see "1 2 3 4 5" in the "Section links" "block"
81
    And I click on "2" "link" in the "Section links" "block"
82
    And I should not see "Test forum name 2"
83
 
84
    Examples:
85
      | courseformat | coursedisplay | initsections | targetsectionnum | targetpage              | belowpage                |
86
      | topics       | 0             | 1            | 0                | "General"               | "Section 2"              |
87
      | topics       | 1             | 1            | 0                | "General"               | "Section 2"              |
88
      | topics       | 0             | 1            | 1                | "Section 1"             | "Section 2"              |
89
      | topics       | 1             | 1            | 1                | "Section 1"             | "Section 2"              |
90
      | weeks        | 0             | 0            | 0                | "General"               | "8 January - 14 January" |
91
      | weeks        | 1             | 0            | 0                | "General"               | "8 January - 14 January" |
92
      | weeks        | 0             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
93
      | weeks        | 1             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
94
 
95
  Scenario Outline: Check, without javascript, activities using topics and weeks formats, and paged mode and not paged mode
96
    Given the following "users" exist:
97
      | username | firstname   | lastname | email                |
98
      | teacher1 | Teacher     | 1        | teacher1@example.com |
99
    And the following "course" exists:
100
      | fullname     | Course 1        |
101
      | shortname    | C1              |
102
      | format       | <courseformat>  |
103
      |coursedisplay | <coursedisplay> |
104
      | numsections  | 5               |
105
      | startdate    | 0               |
106
      | initsections | <initsections>  |
107
    And the following "course enrolments" exist:
108
      | user | course | role |
109
      | teacher1 | C1 | editingteacher |
110
    And the following "activities" exist:
111
      | activity | course | section            | name              | idnumber |
112
      | forum    | C1     | <targetsectionnum> | Test forum name 1 | 00001    |
113
      | forum    | C1     | <targetsectionnum> | Test forum name 2 | 00002    |
114
      | forum    | C1     | 1                  | Test forum name 3 | 00003    |
115
    And I am on the "Course 1" course page logged in as "teacher1"
116
    When I click on <targetpage> "link" in the "region-main" "region"
117
    And I turn editing mode on
118
    And I add the "Recent activity" block
119
    And I open the action menu in "Recent activity" "block"
120
    And I click on "Delete Recent activity block" "link"
121
    And I press "Yes"
122
    And <belowpage> "section" should not exist
123
    And I click on "Edit settings" "link" in the "Test forum name 1" activity
124
    And I should see "Edit settings"
125
    And I should see "Display description on course page"
126
    And I press "Save and return to course"
127
    And <belowpage> "section" should not exist
128
    And I click on "Hide" "link" in the "Test forum name 1" activity
129
    And <belowpage> "section" should not exist
130
    And I delete "Test forum name 1" activity
131
    And <belowpage> "section" should not exist
132
    And I should not see "Test forum name 1" in the "region-main" "region"
133
    And I duplicate "Test forum name 2" activity editing the new copy with:
134
      | Forum name | Edited test forum name 2 |
135
    And <belowpage> "section" should not exist
136
    And I should see "Test forum name 2"
137
    And I should see "Edited test forum name 2"
138
    # General section can't be hidden. Check this part using always the first section.
139
    And I am on the "Course 1" course page
140
    And I hide section "1"
141
    And section "1" should be hidden
142
    And all activities in section "1" should be hidden
143
    And I show section "1"
144
    And section "1" should be visible
145
    And the following config values are set as admin:
146
      | unaddableblocks | | theme_boost|
147
    And I add the "Section links" block
148
    And I should see "1 2 3 4 5" in the "Section links" "block"
149
    And I click on "2" "link" in the "Section links" "block"
150
    And I should not see "Test forum name 2"
151
 
152
    Examples:
153
      | courseformat | coursedisplay | initsections | targetsectionnum | targetpage              | belowpage                |
154
      | topics       | 0             | 1            | 0                | "General"               | "Section 2"              |
155
      | topics       | 1             | 1            | 0                | "General"               | "Section 2"              |
156
      | topics       | 0             | 1            | 1                | "Section 1"             | "Section 2"              |
157
      | topics       | 1             | 1            | 1                | "Section 1"             | "Section 2"              |
158
      | weeks        | 0             | 0            | 0                | "General"               | "8 January - 14 January" |
159
      | weeks        | 1             | 0            | 0                | "General"               | "8 January - 14 January" |
160
      | weeks        | 0             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
161
      | weeks        | 1             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
162
 
163
  @javascript
164
  Scenario Outline: Indentation should allow one level only
165
    Given the following "users" exist:
166
      | username | firstname | lastname | email                |
167
      | teacher1 | Teacher   | 1        | teacher1@example.com |
168
    And the following "courses" exist:
169
      | fullname | shortname | format         | coursedisplay   | numsections | startdate |
170
      | Course 1 | C1        | <courseformat> | <coursedisplay> | 5           | 0         |
171
    And the following "course enrolments" exist:
172
      | user     | course | role           |
173
      | teacher1 | C1     | editingteacher |
174
    And the following "activities" exist:
175
      | activity | name               | intro                     | course | idnumber |
176
      | forum    | Test forum name    | Test forum description    | C1     | forum1   |
177
    When I log in as "teacher1"
178
    And I am on "Course 1" course homepage with editing mode on
179
    And I open "Test forum name" actions menu
180
    Then "Move right" "link" should be visible
181
    And "Move left" "link" should not be visible
182
    And I click on "Move right" "link" in the "Test forum name" activity
183
    And I open "Test forum name" actions menu
184
    And "Move right" "link" should not be visible
185
    And "Move left" "link" should be visible
186
    And I click on "Move left" "link" in the "Test forum name" activity
187
    And I open "Test forum name" actions menu
188
    And "Move right" "link" should be visible
189
    And "Move left" "link" should not be visible
190
 
191
    Examples:
192
      | courseformat |
193
      | topics       |
194
      | weeks        |
195
 
196
  @javascript
197
  Scenario Outline: Admins could disable indentation
198
    Given the following "courses" exist:
199
      | fullname | shortname | format | coursedisplay | numsections | startdate |
200
      | Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
201
    And the following "activities" exist:
202
      | activity | name               | intro                     | course | idnumber |
203
      | forum    | Test forum name    | Test forum description    | C1     | forum1   |
204
    And I log in as "admin"
205
    And I am on "Course 1" course homepage with editing mode on
206
    And I open "Test forum name" actions menu
207
    And "Move right" "link" should be visible
208
    And "Move left" "link" should not be visible
209
    And I click on "Move right" "link" in the "Test forum name" activity
210
    When the following config values are set as admin:
211
      | indentation | 0 | format_<courseformat> |
212
    And I am on "Course 1" course homepage with editing mode on
213
    And I open "Test forum name" actions menu
214
    Then "Move right" "link" should not exist
215
    And "Move left" "link" should not exist
216
 
217
    Examples:
218
      | courseformat |
219
      | topics       |
220
      | weeks        |