mirrored from git://git.moodle.org/moodle.git
/
activities_visibility_icons.feature
175 lines (172 loc) · 9.2 KB
/
activities_visibility_icons.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
@core @core_course @_cross_browser
Feature: Toggle activities visibility from the course page
In order to delay activities availability
As a teacher
I need to quickly change the visibility of an activity
@javascript
Scenario: Hide/Show toggle with javascript enabled
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| Availability | Show on course page |
When I open "Test forum name" actions menu
Then "Test forum name" actions menu should not have "Show" item
And "Test forum name" actions menu should not have "Make available" item
And "Test forum name" actions menu should not have "Make unavailable" item
And I click on "Hide" "link" in the "Test forum name" activity
And "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And "Test forum name" actions menu should not have "Hide" item
# Stealth behaviour is not available by default:
And "Test forum name" actions menu should not have "Make available" item
And "Test forum name" actions menu should not have "Make unavailable" item
And I click on "Show" "link" in the "Test forum name" activity
And "Test forum name" activity should be visible
And I open "Test forum name" actions menu
And "Test forum name" actions menu should not have "Show" item
And "Test forum name" actions menu should not have "Make available" item
And "Test forum name" actions menu should not have "Make unavailable" item
And I click on "Hide" "link" in the "Test forum name" activity
And "Test forum name" activity should be hidden
And I reload the page
And "Test forum name" activity should be hidden
# Make sure that "Availability" dropdown in the edit menu has two options: Show/Hide.
And I open "Test forum name" actions menu
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should not contain "Make available but not shown on course page"
And the field "Availability" matches value "Hide from students"
And I press "Save and return to course"
And "Test forum name" activity should be hidden
And I turn editing mode off
And "Test forum name" activity should be hidden
And I log out
# Student should not see this activity.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should not see "Test forum name"
And I log out
@javascript
Scenario: Activities can be made available and unavailable inside a hidden section
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| Availability | Show on course page |
When I hide section "2"
Then "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And "Test forum name" actions menu should not have "Show" item
And "Test forum name" actions menu should not have "Hide" item
And "Test forum name" actions menu should not have "Make unavailable" item
And I click on "Make available" "link" in the "Test forum name" activity
And "Test forum name" activity should be available but hidden from course page
And I open "Test forum name" actions menu
And "Test forum name" actions menu should not have "Show" item
And "Test forum name" actions menu should not have "Hide" item
And "Test forum name" actions menu should not have "Make available" item
And I click on "Make unavailable" "link" in the "Test forum name" activity
And "Test forum name" activity should be hidden
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "Test forum name" actions menu
And I click on "Edit settings" "link" in the "Test forum name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Hide from students"
And the "Availability" select box should contain "Make available but not shown on course page"
And the "Availability" select box should not contain "Show on course page"
And I set the field "Availability" to "Make available but not shown on course page"
And I press "Save and return to course"
And "Test forum name" activity should be available but hidden from course page
And I turn editing mode off
And "Test forum name" activity should be available but hidden from course page
And I log out
# Student will not see the module on the course page but can access it from other reports and blocks:
And I log in as "student1"
And I am on "Course 1" course homepage
And "Test forum name" activity should be hidden
And I click on "Test forum name" "link" in the "Recent activity" "block"
And I should see "Test forum name"
And I should see "(There are no discussion topics yet in this forum)"
And I log out
@javascript
Scenario: Activities can be made available but not visible on a course page
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following config values are set as admin:
| allowstealth | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I add a "Assignment" to section "2" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| Availability | Show on course page |
When I open "Test assignment name" actions menu
Then "Test assignment name" actions menu should not have "Show" item
And "Test assignment name" actions menu should have "Hide" item
And "Test assignment name" actions menu should not have "Make available" item
And "Test assignment name" actions menu should not have "Make unavailable" item
And I click on "Hide" "link" in the "Test assignment name" activity
And "Test assignment name" activity should be hidden
And I open "Test assignment name" actions menu
And "Test assignment name" actions menu should have "Show" item
And "Test assignment name" actions menu should not have "Hide" item
And "Test assignment name" actions menu should not have "Make unavailable" item
And I click on "Make available" "link" in the "Test assignment name" activity
And "Test assignment name" activity should be available but hidden from course page
# Make sure that "Availability" dropdown in the edit menu has three options.
And I open "Test assignment name" actions menu
And I click on "Edit settings" "link" in the "Test assignment name" activity
And I expand all fieldsets
And the "Availability" select box should contain "Show on course page"
And the "Availability" select box should contain "Hide from students"
And the field "Availability" matches value "Make available but not shown on course page"
And I press "Save and return to course"
And "Test assignment name" activity should be available but hidden from course page
And I turn editing mode off
And "Test assignment name" activity should be available but hidden from course page
And I log out
# Student will not see the module on the course page but can access it from other reports and blocks:
And I log in as "student1"
And I am on "Course 1" course homepage
And "Test assignment name" activity should be hidden
And I click on "Test assignment name" "link" in the "Recent activity" "block"
And I should see "Test assignment name"
And I should see "Submission status"
And I log out