| 1441 |
ariadna |
1 |
@mod @mod_subsection
|
|
|
2 |
Feature: Users view subsections on course page
|
|
|
3 |
In order to use subsections
|
|
|
4 |
As an user
|
|
|
5 |
I need to view subsections on course page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category | numsections | initsections |
|
|
|
14 |
| Course 1 | C1 | 0 | 3 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | idnumber | section |
|
|
|
21 |
| subsection | Subsection1 | C1 | sub1 | 1 |
|
|
|
22 |
| page | Page1 in Subsection1 | C1 | page11 | 4 |
|
|
|
23 |
| subsection | Subsection2 | C1 | sub2 | 1 |
|
|
|
24 |
| data | New database | C1 | data1 | 3 |
|
|
|
25 |
| page | New page | C1 | page1 | 3 |
|
|
|
26 |
@javascript
|
|
|
27 |
Scenario: Student can view, expand and collapse subsections on course page
|
|
|
28 |
When I log in as "student1"
|
|
|
29 |
And I am on "Course 1" course homepage
|
|
|
30 |
Then I should see "Subsection1" in the "region-main" "region"
|
|
|
31 |
And I should see "Page1 in Subsection1" in the "Subsection1" "activity"
|
|
|
32 |
And I click on "Collapse" "link" in the "Subsection1" "activity"
|
|
|
33 |
And I should not see "Page1 in Subsection1" in the "Subsection1" "activity"
|
|
|
34 |
And I click on "Expand" "link" in the "Subsection1" "activity"
|
|
|
35 |
And I click on "Page1 in Subsection1" "link" in the "Subsection1" "activity"
|
|
|
36 |
|
|
|
37 |
@javascript
|
|
|
38 |
Scenario: Teacher can create activities inside subsections on course page
|
|
|
39 |
When I log in as "teacher1"
|
|
|
40 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
41 |
# Add an assignment to the top of Subsection1.
|
|
|
42 |
And I hover "Insert an activity or resource before 'Page1 in Subsection1'" "button"
|
|
|
43 |
And I press "Insert an activity or resource before 'Page1 in Subsection1'"
|
|
|
44 |
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
|
|
|
45 |
And I set the following fields to these values:
|
|
|
46 |
| Assignment name | Assignment1 in Subsection1 |
|
|
|
47 |
And I press "Save and return to course"
|
|
|
48 |
Then I should see "Assignment1 in Subsection1" in the "Subsection1" "activity"
|
|
|
49 |
# Add an assignment to the empty Subsection2.
|
|
|
50 |
And I add an "assign" activity to course "Course 1" section "4" and I fill the form with:
|
|
|
51 |
| Assignment name | Assignment1 in Subsection2 |
|
|
|
52 |
And I should see "Assignment1 in Subsection2" in the "Subsection2" "activity"
|
|
|
53 |
|
|
|
54 |
@javascript
|
|
|
55 |
Scenario: Teacher can create activities between subsections on course page
|
|
|
56 |
When I log in as "teacher1"
|
|
|
57 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
58 |
And I hover "Insert content before 'Subsection2'" "button"
|
|
|
59 |
And I press "Insert content before 'Subsection2'"
|
|
|
60 |
And I click on "Activity or resource" "button" in the ".dropdown-menu.show" "css_element"
|
|
|
61 |
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
|
|
|
62 |
And I set the following fields to these values:
|
|
|
63 |
| Assignment name | Assignment between subsections |
|
|
|
64 |
And I press "Save and return to course"
|
|
|
65 |
And I wait "5" seconds
|
|
|
66 |
And "Assignment between subsections" "link" should appear after "Page1 in Subsection1" "text"
|
|
|
67 |
And "Assignment between subsections" "link" should appear before "Subsection2" "text"
|
|
|
68 |
|
|
|
69 |
@javascript
|
|
|
70 |
Scenario: Teacher can create a subsection at section bottom
|
|
|
71 |
When I log in as "teacher1"
|
|
|
72 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
73 |
And I click on "Add content" "button" in the "General" "section"
|
|
|
74 |
And I click on "Subsection" "link" in the ".dropdown-menu.show" "css_element"
|
|
|
75 |
Then I should see "New subsection" in the "General" "section"
|
|
|
76 |
|
|
|
77 |
@javascript
|
|
|
78 |
Scenario: Teacher can create a subsection between activities
|
|
|
79 |
When I log in as "teacher1"
|
|
|
80 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
81 |
And I hover "Insert content before 'New page'" "button"
|
|
|
82 |
And I press "Insert content before 'New page'"
|
|
|
83 |
And I click on "Subsection" "link" in the ".dropdown-menu.show" "css_element"
|
|
|
84 |
Then I should see "New subsection" in the "Section 3" "section"
|
|
|
85 |
And "New database" "text" should appear before "New subsection" "text"
|
|
|
86 |
And "New subsection" "text" should appear before "New page" "text"
|
|
|
87 |
|
|
|
88 |
@javascript
|
|
|
89 |
Scenario: Teacher can create an activity at section bottom
|
|
|
90 |
When I log in as "teacher1"
|
|
|
91 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
92 |
And I click on "Add content" "button" in the "General" "section"
|
|
|
93 |
And I click on "Activity or resource" "button" in the ".dropdown-menu.show" "css_element"
|
|
|
94 |
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
|
|
|
95 |
And I set the field "Forum name" to "New forum"
|
|
|
96 |
And I press "Save and return to course"
|
|
|
97 |
Then I should see "New forum" in the "General" "section"
|
|
|
98 |
|
|
|
99 |
@javascript
|
|
|
100 |
Scenario: Teacher can create an activity between activities
|
|
|
101 |
When I log in as "teacher1"
|
|
|
102 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
103 |
And I hover "Insert content before 'New page'" "button"
|
|
|
104 |
And I press "Insert content before 'New page'"
|
|
|
105 |
And I click on "Activity or resource" "button" in the ".dropdown-menu.show" "css_element"
|
|
|
106 |
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
|
|
|
107 |
And I set the field "Forum name" to "New forum"
|
|
|
108 |
And I press "Save and return to course"
|
|
|
109 |
Then I should see "New forum" in the "Section 3" "section"
|
|
|
110 |
And "New database" "text" should appear before "New forum" "text"
|
|
|
111 |
And "New forum" "text" should appear before "New page" "text"
|
|
|
112 |
|
|
|
113 |
@javascript
|
|
|
114 |
Scenario: Teacher can subsections after moving the parent section
|
|
|
115 |
Given I log in as "teacher1"
|
|
|
116 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
117 |
And I open section "1" edit menu
|
|
|
118 |
And I click on "Move" "link" in the "Section 1" "section"
|
|
|
119 |
And I click on "Section 3" "link" in the "Move section" "dialogue"
|
|
|
120 |
And "Section 1" "section" should appear after "Section 3" "section"
|
|
|
121 |
When I click on "Add content" "button" in the "Section 1" "section"
|
|
|
122 |
And I click on "Subsection" "link" in the ".dropdown-menu.show" "css_element"
|
|
|
123 |
Then I should see "New subsection" in the "Section 1" "section"
|