Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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 <belowpage> "section" should not exist
43
    And I open "Test forum name 1" actions menu
44
    And I click on "Edit settings" "link" in the "Test forum name 1" activity
45
    And I should see "Edit settings"
46
    And I should see "Display description on course page"
47
    And I set the following fields to these values:
48
      | Forum name | Just to check that I can edit the name |
49
      | Description | Just to check that I can edit the description |
50
      | Display description on course page | 1 |
51
    And I click on "Cancel" "button"
52
    And <belowpage> "section" should not exist
53
    And I open "Test forum name 1" actions menu
54
    And I choose "Hide" in the open action menu
55
    And <belowpage> "section" should not exist
56
    And I delete "Test forum name 1" activity
57
    And I should not see "Test forum name 1" in the "region-main" "region"
58
    And I duplicate "Test forum name 2" activity editing the new copy with:
59
      | Forum name | Edited test forum name 2 |
60
    And <belowpage> "section" should not exist
61
    And I should see "Test forum name 2"
62
    And I should see "Edited test forum name 2"
63
    # General section can't be hidden. Check this part using always the first section.
64
    And I am on the "Course 1" course page
65
    And I hide section "1"
66
    And section "1" should be hidden
67
    And all activities in section "1" should be hidden
68
    And I show section "1"
69
    And section "1" should be visible
70
    And I am on the "C1 > Section 1" "course > section" page
71
    And <belowpage> "section" should not exist
72
    And the following config values are set as admin:
1441 ariadna 73
      | showsectionname | 0 | block_section_links |
74
      | unaddableblocks |   | theme_boost         |
1 efrain 75
    And I add the "Section links" block
76
    And <belowpage> "section" should not exist
77
    And I should see "1 2 3 4 5" in the "Section links" "block"
78
    And I click on "2" "link" in the "Section links" "block"
79
    And I should not see "Test forum name 2"
80
 
81
    Examples:
82
      | courseformat | coursedisplay | initsections | targetsectionnum | targetpage              | belowpage                |
83
      | topics       | 0             | 1            | 0                | "General"               | "Section 2"              |
84
      | topics       | 1             | 1            | 0                | "General"               | "Section 2"              |
85
      | topics       | 0             | 1            | 1                | "Section 1"             | "Section 2"              |
86
      | topics       | 1             | 1            | 1                | "Section 1"             | "Section 2"              |
87
      | weeks        | 0             | 0            | 0                | "General"               | "8 January - 14 January" |
88
      | weeks        | 1             | 0            | 0                | "General"               | "8 January - 14 January" |
89
      | weeks        | 0             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
90
      | weeks        | 1             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
91
 
92
  Scenario Outline: Check, without javascript, activities using topics and weeks formats, and paged mode and not paged mode
93
    Given the following "users" exist:
94
      | username | firstname   | lastname | email                |
95
      | teacher1 | Teacher     | 1        | teacher1@example.com |
96
    And the following "course" exists:
97
      | fullname     | Course 1        |
98
      | shortname    | C1              |
99
      | format       | <courseformat>  |
100
      |coursedisplay | <coursedisplay> |
101
      | numsections  | 5               |
102
      | startdate    | 0               |
103
      | initsections | <initsections>  |
104
    And the following "course enrolments" exist:
105
      | user | course | role |
106
      | teacher1 | C1 | editingteacher |
107
    And the following "activities" exist:
108
      | activity | course | section            | name              | idnumber |
109
      | forum    | C1     | <targetsectionnum> | Test forum name 1 | 00001    |
110
      | forum    | C1     | <targetsectionnum> | Test forum name 2 | 00002    |
111
      | forum    | C1     | 1                  | Test forum name 3 | 00003    |
112
    And I am on the "Course 1" course page logged in as "teacher1"
113
    When I click on <targetpage> "link" in the "region-main" "region"
114
    And I turn editing mode on
115
    And <belowpage> "section" should not exist
116
    And I click on "Edit settings" "link" in the "Test forum name 1" activity
117
    And I should see "Edit settings"
118
    And I should see "Display description on course page"
119
    And I press "Save and return to course"
120
    And <belowpage> "section" should not exist
121
    And I click on "Hide" "link" in the "Test forum name 1" activity
122
    And <belowpage> "section" should not exist
123
    And I delete "Test forum name 1" activity
124
    And <belowpage> "section" should not exist
125
    And I should not see "Test forum name 1" in the "region-main" "region"
126
    And I duplicate "Test forum name 2" activity editing the new copy with:
127
      | Forum name | Edited test forum name 2 |
128
    And <belowpage> "section" should not exist
129
    And I should see "Test forum name 2"
130
    And I should see "Edited test forum name 2"
131
    # General section can't be hidden. Check this part using always the first section.
132
    And I am on the "Course 1" course page
133
    And I hide section "1"
134
    And section "1" should be hidden
135
    And all activities in section "1" should be hidden
136
    And I show section "1"
137
    And section "1" should be visible
138
    And the following config values are set as admin:
1441 ariadna 139
      | showsectionname | 0 | block_section_links |
140
      | unaddableblocks |   | theme_boost         |
1 efrain 141
    And I add the "Section links" block
142
    And I should see "1 2 3 4 5" in the "Section links" "block"
143
    And I click on "2" "link" in the "Section links" "block"
144
    And I should not see "Test forum name 2"
145
 
146
    Examples:
147
      | courseformat | coursedisplay | initsections | targetsectionnum | targetpage              | belowpage                |
148
      | topics       | 0             | 1            | 0                | "General"               | "Section 2"              |
149
      | topics       | 1             | 1            | 0                | "General"               | "Section 2"              |
150
      | topics       | 0             | 1            | 1                | "Section 1"             | "Section 2"              |
151
      | topics       | 1             | 1            | 1                | "Section 1"             | "Section 2"              |
152
      | weeks        | 0             | 0            | 0                | "General"               | "8 January - 14 January" |
153
      | weeks        | 1             | 0            | 0                | "General"               | "8 January - 14 January" |
154
      | weeks        | 0             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
155
      | weeks        | 1             | 0            | 1                | "1 January - 7 January" | "8 January - 14 January" |
156
 
157
  @javascript
158
  Scenario Outline: Indentation should allow one level only
159
    Given the following "users" exist:
160
      | username | firstname | lastname | email                |
161
      | teacher1 | Teacher   | 1        | teacher1@example.com |
162
    And the following "courses" exist:
163
      | fullname | shortname | format         | coursedisplay   | numsections | startdate |
164
      | Course 1 | C1        | <courseformat> | <coursedisplay> | 5           | 0         |
165
    And the following "course enrolments" exist:
166
      | user     | course | role           |
167
      | teacher1 | C1     | editingteacher |
168
    And the following "activities" exist:
169
      | activity | name               | intro                     | course | idnumber |
170
      | forum    | Test forum name    | Test forum description    | C1     | forum1   |
171
    When I log in as "teacher1"
172
    And I am on "Course 1" course homepage with editing mode on
173
    And I open "Test forum name" actions menu
174
    Then "Move right" "link" should be visible
175
    And "Move left" "link" should not be visible
176
    And I click on "Move right" "link" in the "Test forum name" activity
177
    And I open "Test forum name" actions menu
178
    And "Move right" "link" should not be visible
179
    And "Move left" "link" should be visible
180
    And I click on "Move left" "link" in the "Test forum name" activity
181
    And I open "Test forum name" actions menu
182
    And "Move right" "link" should be visible
183
    And "Move left" "link" should not be visible
184
 
185
    Examples:
186
      | courseformat |
187
      | topics       |
188
      | weeks        |
189
 
190
  @javascript
191
  Scenario Outline: Admins could disable indentation
192
    Given the following "courses" exist:
193
      | fullname | shortname | format | coursedisplay | numsections | startdate |
194
      | Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
195
    And the following "activities" exist:
196
      | activity | name               | intro                     | course | idnumber |
197
      | forum    | Test forum name    | Test forum description    | C1     | forum1   |
198
    And I log in as "admin"
199
    And I am on "Course 1" course homepage with editing mode on
200
    And I open "Test forum name" actions menu
201
    And "Move right" "link" should be visible
202
    And "Move left" "link" should not be visible
203
    And I click on "Move right" "link" in the "Test forum name" activity
204
    When the following config values are set as admin:
205
      | indentation | 0 | format_<courseformat> |
206
    And I am on "Course 1" course homepage with editing mode on
207
    And I open "Test forum name" actions menu
208
    Then "Move right" "link" should not exist
209
    And "Move left" "link" should not exist
210
 
211
    Examples:
212
      | courseformat |
213
      | topics       |
214
      | weeks        |