1441 |
ariadna |
1 |
@mod @mod_subsection
|
|
|
2 |
Feature: The module menu replaces the delegated section menu
|
|
|
3 |
In order to use subsections
|
|
|
4 |
As an teacher
|
|
|
5 |
I need to see the delegated section action menu instead of module menu.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category | numsections | initsections |
|
|
|
13 |
| Course 1 | C1 | 0 | 2 | 1 |
|
|
|
14 |
And the following "activity" exists:
|
|
|
15 |
| activity | subsection |
|
|
|
16 |
| name | Subsection1 |
|
|
|
17 |
| course | C1 |
|
|
|
18 |
| idnumber | subsection1 |
|
|
|
19 |
| section | 1 |
|
|
|
20 |
And the following "course enrolments" exist:
|
|
|
21 |
| user | course | role |
|
|
|
22 |
| teacher1 | C1 | editingteacher |
|
|
|
23 |
And I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
24 |
|
|
|
25 |
@javascript
|
|
|
26 |
Scenario: The action menu for subsection page meets the module menu
|
|
|
27 |
Given I click on "Subsection1" "link" in the "region-main" "region"
|
|
|
28 |
And I turn editing mode on
|
|
|
29 |
# Open the action menu.
|
|
|
30 |
When I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
31 |
Then I should not see "Move right"
|
|
|
32 |
And I should not see "Assign roles"
|
|
|
33 |
And I should not see "Highlight"
|
|
|
34 |
And I should see "Edit settings"
|
|
|
35 |
And I should not see "Move"
|
|
|
36 |
# Duplicate is not implemented yet.
|
|
|
37 |
And I should not see "Duplicate"
|
|
|
38 |
And I should see "Hide"
|
|
|
39 |
And I should see "Delete"
|
|
|
40 |
And I should see "Permalink"
|
|
|
41 |
|
|
|
42 |
@javascript
|
|
|
43 |
Scenario: The action menu for subsection module has less options than a regular activity
|
|
|
44 |
Given I turn editing mode on
|
|
|
45 |
When I open "Subsection1" actions menu
|
|
|
46 |
Then I should not see "Move right"
|
|
|
47 |
And I should not see "Assign roles"
|
|
|
48 |
And I should not see "Highlight"
|
|
|
49 |
And I should see "View"
|
|
|
50 |
And I should see "Edit settings"
|
|
|
51 |
And I should see "Move"
|
|
|
52 |
# Duplicate is not implemented yet.
|
|
|
53 |
And I should not see "Duplicate"
|
|
|
54 |
And I should see "Hide"
|
|
|
55 |
And I should see "Delete"
|
|
|
56 |
|
|
|
57 |
@javascript
|
|
|
58 |
Scenario: The action menu for subsection module in section page has less options than a regular activity
|
|
|
59 |
Given I click on "Section 1" "link"
|
|
|
60 |
And I turn editing mode on
|
|
|
61 |
When I open "Subsection1" actions menu
|
|
|
62 |
Then I should not see "Move right"
|
|
|
63 |
And I should not see "Assign roles"
|
|
|
64 |
And I should not see "Highlight"
|
|
|
65 |
And I should see "View"
|
|
|
66 |
And I should see "Edit settings"
|
|
|
67 |
And I should see "Move"
|
|
|
68 |
# Duplicate is not implemented yet.
|
|
|
69 |
And I should not see "Duplicate"
|
|
|
70 |
And I should see "Hide"
|
|
|
71 |
And I should see "Delete"
|
|
|
72 |
And I should see "Permalink"
|
|
|
73 |
|
|
|
74 |
@javascript
|
|
|
75 |
Scenario: View option in subsection action menu
|
|
|
76 |
Given I turn editing mode on
|
|
|
77 |
And I open "Subsection1" actions menu
|
|
|
78 |
When I choose "View" in the open action menu
|
|
|
79 |
# Subsection page. Subsection name should be the title.
|
|
|
80 |
Then I should see "Subsection1" in the "h1" "css_element"
|
|
|
81 |
And "Section 1" "text" should exist in the ".breadcrumb" "css_element"
|
|
|
82 |
# Open the section header action menu.
|
|
|
83 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
84 |
And "View" "link" should not exist in the "[data-region='header-actions-container']" "css_element"
|
|
|
85 |
And I click on "Section 1" "link" in the ".breadcrumb" "css_element"
|
|
|
86 |
# Section page. Section name should be the title.
|
|
|
87 |
And I should see "Section 1" in the "h1" "css_element"
|
|
|
88 |
And "Subsection1" "text" should not exist in the ".breadcrumb" "css_element"
|
|
|
89 |
# Open the section header action menu.
|
|
|
90 |
And I open "Subsection1" actions menu
|
|
|
91 |
And I choose "View" in the open action menu
|
|
|
92 |
And I should see "Subsection1" in the "h1" "css_element"
|
|
|
93 |
|
|
|
94 |
@javascript
|
|
|
95 |
Scenario: Edit settings option in subsection action menu
|
|
|
96 |
Given I turn editing mode on
|
|
|
97 |
And I open "Subsection1" actions menu
|
|
|
98 |
When I choose "Edit settings" in the open action menu
|
|
|
99 |
And the field "Section name" matches value "Subsection1"
|
|
|
100 |
And I click on "Cancel" "button"
|
|
|
101 |
And I am on the "C1 > Subsection1" "course > section" page
|
|
|
102 |
# Subsection page. Open the section header action menu.
|
|
|
103 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
104 |
And I choose "Edit settings" in the open action menu
|
|
|
105 |
And the field "Section name" matches value "Subsection1"
|
|
|
106 |
And I click on "Cancel" "button"
|
|
|
107 |
And I am on the "C1 > Section 1" "course > section" page
|
|
|
108 |
# Section page. Open Subsection1 module action menu.
|
|
|
109 |
And I open "Subsection1" actions menu
|
|
|
110 |
And I choose "Edit settings" in the open action menu
|
|
|
111 |
And the field "Section name" matches value "Subsection1"
|
|
|
112 |
|
|
|
113 |
@javascript
|
|
|
114 |
Scenario: Permalink option in subsection action menu
|
|
|
115 |
Given I turn editing mode on
|
|
|
116 |
And I open "Subsection1" actions menu
|
|
|
117 |
When I choose "Permalink" in the open action menu
|
|
|
118 |
Then I click on "Copy to clipboard" "link"
|
|
|
119 |
And I should see "Text copied to clipboard"
|
|
|
120 |
And I am on the "C1 > Subsection1" "course > section" page
|
|
|
121 |
# Subsection page. Open the section header action menu.
|
|
|
122 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
123 |
And I choose "Permalink" in the open action menu
|
|
|
124 |
And I click on "Copy to clipboard" "link"
|
|
|
125 |
And I should see "Text copied to clipboard"
|
|
|
126 |
And I am on the "C1 > Section 1" "course > section" page
|
|
|
127 |
# Section page. Open Subsection1 module action menu.
|
|
|
128 |
And I open "Subsection1" actions menu
|
|
|
129 |
And I choose "Permalink" in the open action menu
|
|
|
130 |
And I click on "Copy to clipboard" "link"
|
|
|
131 |
And I should see "Text copied to clipboard"
|
|
|
132 |
|
|
|
133 |
@javascript
|
|
|
134 |
Scenario: Delete option in subsection action menu
|
|
|
135 |
Given the following "activities" exist:
|
|
|
136 |
| activity | course | idnumber | name | intro | section |
|
|
|
137 |
| subsection | C1 | subsection2 | Subsection2 | Test Subsection2 | 1 |
|
|
|
138 |
| subsection | C1 | subsection3 | Subsection3 | Test Subsection3 | 1 |
|
|
|
139 |
Given I turn editing mode on
|
|
|
140 |
And "Subsection1" "link" should exist
|
|
|
141 |
And "Subsection2" "link" should exist
|
|
|
142 |
And "Subsection3" "link" should exist
|
|
|
143 |
And I open "Subsection1" actions menu
|
|
|
144 |
When I choose "Delete" in the open action menu
|
|
|
145 |
And I click on "Delete" "button" in the "Delete subsection?" "dialogue"
|
|
|
146 |
And "Subsection1" "link" should not exist in the "#region-main-box" "css_element"
|
|
|
147 |
And I am on the "C1 > Section 1" "course > section" page
|
|
|
148 |
# Section page. Open Subsection2 module action menu.
|
|
|
149 |
And I open "Subsection2" actions menu
|
|
|
150 |
And I choose "Delete" in the open action menu
|
|
|
151 |
And I click on "Delete" "button" in the "Delete subsection?" "dialogue"
|
|
|
152 |
And "Subsection2" "link" should not exist in the "#region-main-box" "css_element"
|
|
|
153 |
And I am on the "C1 > Subsection3" "course > section" page
|
|
|
154 |
# Subsection page. Open the section header action menu.
|
|
|
155 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
156 |
And I choose "Delete" in the open action menu
|
|
|
157 |
And I click on "Delete" "button" in the "Delete subsection?" "dialogue"
|
|
|
158 |
And I should not see "Subsection3"
|
|
|
159 |
And I should see "Course 1" in the "h1" "css_element"
|
|
|
160 |
|
|
|
161 |
@javascript
|
|
|
162 |
Scenario: Hide/Show option in subsection action menu
|
|
|
163 |
Given I turn editing mode on
|
|
|
164 |
And I should not see "Hidden from students"
|
|
|
165 |
And I open "Subsection1" actions menu
|
|
|
166 |
When I choose "Hide" in the open action menu
|
|
|
167 |
Then I should see "Hidden from students"
|
|
|
168 |
Given I am on the "C1 > Subsection1" "course > section" page
|
|
|
169 |
And I should see "Hidden from students"
|
|
|
170 |
# Subsection page. Open the section header action menu.
|
|
|
171 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
172 |
And I choose "Show" in the open action menu
|
|
|
173 |
And I should not see "Hidden from students"
|
|
|
174 |
And I click on "Section 1" "link" in the ".breadcrumb" "css_element"
|
|
|
175 |
And I should not see "Hidden from students"
|
|
|
176 |
# Section page. Open Subsection1 module action menu.
|
|
|
177 |
And I open "Subsection1" actions menu
|
|
|
178 |
And I choose "Hide" in the open action menu
|
|
|
179 |
And I should see "Hidden from students"
|
|
|
180 |
|
|
|
181 |
@javascript
|
|
|
182 |
Scenario: Hide/Show option in course page action menu for subsections
|
|
|
183 |
Given I am on the "C1" "Course" page
|
|
|
184 |
And I turn editing mode on
|
|
|
185 |
When I hide section "Subsection1"
|
|
|
186 |
Then I should see "Hidden from students"
|
|
|
187 |
And I show section "Subsection1"
|
|
|
188 |
And I should not see "Hidden from students"
|
|
|
189 |
|
|
|
190 |
@javascript
|
|
|
191 |
Scenario: Hide/Show option in subsection page action menu for subsections
|
|
|
192 |
Given I am on the "C1 > Subsection1" "course > section" page
|
|
|
193 |
And I turn editing mode on
|
|
|
194 |
When I hide section "Subsection1"
|
|
|
195 |
Then I should see "Hidden from students"
|
|
|
196 |
And I show section "Subsection1"
|
|
|
197 |
And I should not see "Hidden from students"
|
|
|
198 |
|
|
|
199 |
@javascript
|
|
|
200 |
Scenario: Subsections can't change visibility in hidden sections.
|
|
|
201 |
Given I am on the "C1" "Course" page
|
|
|
202 |
And I turn editing mode on
|
|
|
203 |
And I hide section "Section 1"
|
|
|
204 |
When I open section "Subsection1" edit menu
|
|
|
205 |
Then I should not see "Hide"
|
|
|
206 |
And I should not see "Show"
|
|
|
207 |
And I am on the "C1 > Section 1" "course > section" page
|
|
|
208 |
And I open section "Subsection1" edit menu
|
|
|
209 |
And I should not see "Hide"
|
|
|
210 |
And I should not see "Show"
|
|
|
211 |
|
|
|
212 |
@javascript
|
|
|
213 |
Scenario: Move option in subsection action menu
|
|
|
214 |
Given the following "activities" exist:
|
|
|
215 |
| activity | course | idnumber | name | intro | section |
|
|
|
216 |
| subsection | C1 | subsection2 | Subsection2 | Test Subsection2 | 1 |
|
|
|
217 |
And I turn editing mode on
|
|
|
218 |
And I open "Subsection1" actions menu
|
|
|
219 |
When I choose "Move" in the open action menu
|
|
|
220 |
And I should see "Move Subsection1 after" in the "Move subsection" "dialogue"
|
|
|
221 |
# Can't be moved inside same subsection.
|
|
|
222 |
And I click on "Subsection1" "link" in the "Move subsection" "dialogue"
|
|
|
223 |
And I should see "Move Subsection1 after" in the "Move subsection" "dialogue"
|
|
|
224 |
# Can't be moved inside other subsection.
|
|
|
225 |
And I click on "Subsection2" "link" in the "Move subsection" "dialogue"
|
|
|
226 |
And I should see "Move Subsection1 after" in the "Move subsection" "dialogue"
|
|
|
227 |
# Can be moved to other position.
|
|
|
228 |
And I click on "General" "link" in the "Move subsection" "dialogue"
|
|
|
229 |
Then I should not see "Move Subsection1 after"
|
|
|
230 |
And I should see "Subsection1" in the "General" "section"
|
|
|
231 |
And I should not see "Subsection1" in the "Section 1" "section"
|
|
|
232 |
# Section page. Subsection is still content, so Move option should exist.
|
|
|
233 |
And I am on the "C1 > Section 1" "course > section" page
|
|
|
234 |
And I open "Subsection2" actions menu
|
|
|
235 |
And I should see "Move"
|
|
|
236 |
# Subsection page. Move option should not exist.
|
|
|
237 |
And I am on the "C1 > Subsection1" "course > section" page
|
|
|
238 |
And I click on "Edit" "icon" in the "[data-region='header-actions-container']" "css_element"
|
|
|
239 |
And "Move" "link" should not exist in the "[data-region='header-actions-container']" "css_element"
|