2 Feature: Course activity controls works as expected
3 In order to manage my course's activities
5 I need to edit, hide, show and indent activities inside course sections
7 # The difference between these two scenario outlines is that one is with
8 # JS enabled and the other one with JS disabled, also with JS disabled we
9 # add the delete activity checking; we can not use Background sections
10 # when using Scenario Outlines because of Behat framework restrictions.
13 # * Javascript on and off
14 # * Topics and weeks course formats
15 # * Course controls without paged mode
16 # * Course controls with paged mode in the course home page
17 # * Course controls with paged mode in a section's page
19 @javascript @_cross_browser
20 Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected
21 Given the following "users" exists:
22 | username | firstname | lastname | email |
23 | teacher1 | Teacher | 1 | teacher1@asd.com |
24 And the following "courses" exists:
25 | fullname | shortname | format | coursedisplay | numsections |
26 | Course 1 | C1 | <courseformat> | <coursedisplay> | 5 |
27 And the following "course enrolments" exists:
28 | user | course | role |
29 | teacher1 | C1 | editingteacher |
30 And I log in as "teacher1"
31 And I follow "Course 1"
32 When I follow <targetpage>
33 And I press "Turn editing on"
34 Then I should see "Turn editing off"
35 And I press "Turn editing off"
36 And "Turn editing on" "button" should exists
37 And I follow "Turn editing on"
38 And "Turn editing off" "button" should exists
39 And I follow "Turn editing off"
40 And I should see "Turn editing on"
41 And "Turn editing on" "button" should exists
42 And I turn editing mode on
43 And I click on "Actions" "link" in the "Recent activity" "block"
44 And I click on "Delete Recent activity block" "link"
46 And "#section-2" "css_element" <should_see_other_sections> exists
47 And I add a "Forum" to section "1" and I fill the form with:
48 | Forum name | Test forum name 1 |
49 | Description | Test forum description 1 |
50 And I add a "Forum" to section "1" and I fill the form with:
51 | Forum name | Test forum name 2 |
52 | Description | Test forum description 2 |
53 And "#section-2" "css_element" <should_see_other_sections> exists
54 And I indent right "Test forum name 1" activity
55 And "#section-2" "css_element" <should_see_other_sections> exists
56 And I indent left "Test forum name 1" activity
57 And "#section-2" "css_element" <should_see_other_sections> exists
58 And I click on "Actions" "link" in the "Test forum name 1" activity
59 And I click on "Update" "link" in the "Test forum name 1" activity
60 And I should see "Updating Forum"
61 And I should see "Display description on course page"
62 And I press "Save and return to course"
63 And "#section-2" "css_element" <should_see_other_sections> exists
64 And I click on "Actions" "link" in the "Test forum name 1" activity
65 And I click on "Hide" "link" in the "Test forum name 1" activity
66 And "#section-2" "css_element" <should_see_other_sections> exists
67 And I duplicate "Test forum name 2" activity editing the new copy with:
68 | Forum name | Edited test forum name 2 |
69 And "#section-2" "css_element" <should_see_other_sections> exists
70 And I should see "Test forum name 2"
71 And I should see "Edited test forum name 2"
72 And I hide section "1"
73 And "#section-2" "css_element" <should_see_other_sections> exists
74 And section "1" should be hidden
75 And I show section "1"
76 And "#section-2" "css_element" <should_see_other_sections> exists
77 And section "1" should be visible
78 And I add the "Section links" block
79 And "#section-2" "css_element" <should_see_other_sections> exists
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_see_other_sections_following_block_sections_links> see "Test forum name 2"
85 | courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links |
86 | topics | 0 | "Course 1" | should | should |
87 | topics | 1 | "Topic 1" | should not | should not |
88 | topics | 1 | "Course 1" | should | should not |
89 | weeks | 0 | "Course 1" | should | should |
90 | weeks | 1 | "1 January - 7 January" | should not | should not |
91 | weeks | 1 | "Course 1" | should | should not |
94 Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected
95 Given the following "users" exists:
96 | username | firstname | lastname | email |
97 | teacher1 | Teacher | 1 | teacher1@asd.com |
98 And the following "courses" exists:
99 | fullname | shortname | format | coursedisplay | numsections |
100 | Course 1 | C1 | <courseformat> | <coursedisplay> | 5 |
101 And the following "course enrolments" exists:
102 | user | course | role |
103 | teacher1 | C1 | editingteacher |
104 And I log in as "teacher1"
105 And I follow "Course 1"
106 When I follow <targetpage>
107 And I press "Turn editing on"
108 Then I should see "Turn editing off"
109 And I press "Turn editing off"
110 And "Turn editing on" "button" should exists
111 And I follow "Turn editing on"
112 And "Turn editing off" "button" should exists
113 And I follow "Turn editing off"
114 And I should see "Turn editing on"
115 And "Turn editing on" "button" should exists
116 And I turn editing mode on
117 And I click on "Actions" "link" in the "Recent activity" "block"
118 And I click on "Delete Recent activity block" "link"
120 And "#section-2" "css_element" <should_see_other_sections> exists
121 And I add a "Forum" to section "1" and I fill the form with:
122 | Forum name | Test forum name 1 |
123 | Description | Test forum description 1 |
124 And I add a "Forum" to section "1" and I fill the form with:
125 | Forum name | Test forum name 2 |
126 | Description | Test forum description 2 |
127 And "#section-2" "css_element" <should_see_other_sections> exists
128 And I indent right "Test forum name 1" activity
129 And "#section-2" "css_element" <should_see_other_sections> exists
130 And I indent left "Test forum name 1" activity
131 And "#section-2" "css_element" <should_see_other_sections> exists
132 And I click on "Actions" "link" in the "Test forum name 1" activity
133 And I click on "Update" "link" in the "Test forum name 1" activity
134 And I should see "Updating Forum"
135 And I should see "Display description on course page"
136 And I press "Save and return to course"
137 And "#section-2" "css_element" <should_see_other_sections> exists
138 And I click on "Actions" "link" in the "Test forum name 1" activity
139 And I click on "Hide" "link" in the "Test forum name 1" activity
140 And "#section-2" "css_element" <should_see_other_sections> exists
141 And I delete "Test forum name 1" activity
142 And "#section-2" "css_element" <should_see_other_sections> exists
143 And I should not see "Test forum name 1" in the ".region-content" "css_element"
144 And I duplicate "Test forum name 2" activity editing the new copy with:
145 | Forum name | Edited test forum name 2 |
146 And "#section-2" "css_element" <should_see_other_sections> exists
147 And I should see "Test forum name 2"
148 And I should see "Edited test forum name 2"
149 And I hide section "1"
150 And "#section-2" "css_element" <should_see_other_sections> exists
151 And section "1" should be hidden
152 And I show section "1"
153 And "#section-2" "css_element" <should_see_other_sections> exists
154 And section "1" should be visible
155 And I add the "Section links" block
156 And "#section-2" "css_element" <should_see_other_sections> exists
157 And I should see "1 2 3 4 5" in the "Section links" "block"
158 And I click on "2" "link" in the "Section links" "block"
159 And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2"
162 | courseformat | coursedisplay | targetpage | should_see_other_sections | should_see_other_sections_following_block_sections_links |
163 | topics | 0 | "Course 1" | should | should |
164 | topics | 1 | "Topic 1" | should not | should not |
165 | topics | 1 | "Course 1" | should | should not |
166 | weeks | 0 | "Course 1" | should | should |
167 | weeks | 1 | "1 January - 7 January" | should not | should not |
168 | weeks | 1 | "Course 1" | should | should not |