1 |
efrain |
1 |
@core @core_courseformat @core_course @show_editor @javascript
|
|
|
2 |
Feature: Bulk course section actions one section per page
|
|
|
3 |
In order to edit the course section in one section per page setting
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to edit sections in bulk in both display modes.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "course" exists:
|
|
|
9 |
| fullname | Course 1 |
|
|
|
10 |
| shortname | C1 |
|
|
|
11 |
| category | 0 |
|
|
|
12 |
| numsections | 4 |
|
|
|
13 |
| coursedisplay | 1 |
|
|
|
14 |
| initsections | 1 |
|
|
|
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 the following config values are set as admin:
|
|
|
28 |
| allowstealth | 1 |
|
|
|
29 |
And I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
30 |
And I turn editing mode on
|
|
|
31 |
And I click on "Bulk actions" "button"
|
|
|
32 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
33 |
|
|
|
34 |
Scenario: Bulk section edit is only available when multiple sections are displayed
|
|
|
35 |
Given I click on "Select section Section 1" "checkbox"
|
|
|
36 |
And I should see "1 selected" in the "sticky-footer" "region"
|
|
|
37 |
And I click on "Close bulk actions" "button" in the "sticky-footer" "region"
|
|
|
38 |
# Move to single section page.
|
|
|
39 |
When I am on the "C1 > Section 1" "course > section" page
|
|
|
40 |
And I click on "Bulk actions" "button"
|
|
|
41 |
Then "Select section Section 1" "checkbox" should not exist
|
|
|
42 |
|
|
|
43 |
Scenario: Bulk availability sections in one section per page
|
|
|
44 |
Given I should not see "Hidden from students" in the "Activity sample 1" "activity"
|
|
|
45 |
And I should not see "Hidden from students" in the "Activity sample 2" "activity"
|
|
|
46 |
And I should not see "Hidden from students" in the "Section 1" "section"
|
|
|
47 |
And I should not see "Hidden from students" in the "Section 2" "section"
|
|
|
48 |
And I click on "Select section Section 1" "checkbox"
|
|
|
49 |
And I should see "1 selected" in the "sticky-footer" "region"
|
|
|
50 |
And I click on "Sections availability" "button" in the "sticky-footer" "region"
|
|
|
51 |
And I click on "Hide on course page" "radio" in the "Section availability" "dialogue"
|
|
|
52 |
When I click on "Apply" "button" in the "Section availability" "dialogue"
|
|
|
53 |
And I should see "Hidden from students" in the "Activity sample 1" "activity"
|
|
|
54 |
And I should see "Hidden from students" in the "Activity sample 2" "activity"
|
|
|
55 |
And I should see "Hidden from students" in the "Section 1" "section"
|
|
|
56 |
And I should not see "Hidden from students" in the "Section 2" "section"
|
|
|
57 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
58 |
|
|
|
59 |
Scenario: Bulk delete sections in one section per page
|
|
|
60 |
Given I should see "Section 1" in the "region-main" "region"
|
|
|
61 |
And I should see "Section 2" in the "region-main" "region"
|
|
|
62 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
63 |
And I should see "Section 4" in the "region-main" "region"
|
|
|
64 |
And I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
65 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
66 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
67 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
68 |
And I click on "Select section Section 1" "checkbox"
|
|
|
69 |
And I should see "1 selected" in the "sticky-footer" "region"
|
|
|
70 |
When I click on "Delete sections" "button" in the "sticky-footer" "region"
|
|
|
71 |
And I click on "Delete" "button" in the "Delete section?" "dialogue"
|
|
|
72 |
Then I should see "Section 2" in the "region-main" "region"
|
|
|
73 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
74 |
And I should see "Section 4" in the "region-main" "region"
|
|
|
75 |
And I should not see "Section 1" in the "region-main" "region"
|
|
|
76 |
And I should not see "Activity sample 1"
|
|
|
77 |
And I should not see "Activity sample 2"
|
|
|
78 |
And I should see "Activity sample 3" in the "Section 2" "section"
|
|
|
79 |
And I should see "Activity sample 4" in the "Section 2" "section"
|
|
|
80 |
And I should see "0 selected" in the "sticky-footer" "region"
|
|
|
81 |
|
|
|
82 |
Scenario: Bulk move sections in one section per page
|
|
|
83 |
Given I set the field "Edit section name" in the "Section 2" "section" to "Move one"
|
|
|
84 |
And I set the field "Edit section name" in the "Section 3" "section" to "Move two"
|
|
|
85 |
And I click on "Select section Move one" "checkbox"
|
|
|
86 |
And I click on "Select section Move two" "checkbox"
|
|
|
87 |
And I should see "2 selected" in the "sticky-footer" "region"
|
|
|
88 |
When I click on "Move sections" "button" in the "sticky-footer" "region"
|
|
|
89 |
And I click on "General" "link" in the "Move selected sections" "dialogue"
|
|
|
90 |
# Check activities are moved with the sections.
|
|
|
91 |
Then I should see "Activity sample 1" in the "Section 1" "section"
|
|
|
92 |
And I should see "Activity sample 2" in the "Section 1" "section"
|
|
|
93 |
And I should see "Activity sample 3" in the "Move one" "section"
|
|
|
94 |
And I should see "Activity sample 4" in the "Move one" "section"
|
|
|
95 |
# Check new section order.
|
|
|
96 |
And "Move one" "section" should appear after "General" "section"
|
|
|
97 |
And "Move two" "section" should appear after "Move one" "section"
|
|
|
98 |
And "Section 1" "section" should appear after "Move two" "section"
|
|
|
99 |
And "Section 4" "section" should appear after "Section 1" "section"
|