-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcourses_list.feature.example
229 lines (226 loc) · 16.7 KB
/
courses_list.feature.example
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
@core_course_list
Feature: View course lists
In order to find out about moodle courses
As a moodle user
I need to be able to see course lists
Background:
# -------------------------------------------------------------------------------
# Generate categories
# -------------------------------------------------------------------------------
Given the following "categories" exists:
| name | category | idnumber | description |
| Cat 1 (many subcategories, no courses) | 0 | CAT1 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla non arcu lacinia neque faucibus fringilla. Vivamus porttitor turpis ac leo. Integer in sapien. Nullam eget nisl. Aliquam erat volutpat. Cras elementum. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Integer malesuada. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna. Mauris elementum mauris vitae tortor. Aliquam erat volutpat. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Pellentesque ipsum. Cras pede libero, dapibus nec, pretium sit amet, tempor quis. Aliquam ante. Proin in tellus sit amet nibh dignissim sagittis. Vivamus porttitor turpis ac leo. |
| Cat 2 (no subcategories, many courses) | 0 | CAT2 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla non arcu lacinia neque faucibus fringilla. Vivamus porttitor turpis ac leo. Integer in sapien. Nullam eget nisl. Aliquam erat volutpat. Cras elementum. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Integer malesuada. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna. Mauris elementum mauris vitae tortor. Aliquam erat volutpat. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Pellentesque ipsum. Cras pede libero, dapibus nec, pretium sit amet, tempor quis. Aliquam ante. Proin in tellus sit amet nibh dignissim sagittis. Vivamus porttitor turpis ac leo. |
| Cat 3 with very long name that to test how it is wrapped into several lines. Cat 3 with very long name that to test how it is wrapped into several lines. Cat 3 with very long name that to test how it is wrapped into several lines. | 0 | CAT3 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla non arcu lacinia neque faucibus fringilla. Vivamus porttitor turpis ac leo. Integer in sapien. Nullam eget nisl. Aliquam erat volutpat. Cras elementum. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Integer malesuada. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna. Mauris elementum mauris vitae tortor. Aliquam erat volutpat. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Pellentesque ipsum. Cras pede libero, dapibus nec, pretium sit amet, tempor quis. Aliquam ante. Proin in tellus sit amet nibh dignissim sagittis. Vivamus porttitor turpis ac leo. |
| Cat 4 | CAT1 | CAT4 | |
| Cat 5 | CAT1 | CAT5 | |
| Cat 6 | CAT1 | CAT6 | |
| Cat 7 | CAT1 | CAT7 | |
| Cat 8 | CAT1 | CAT8 | |
| Cat 9 | CAT1 | CAT9 | |
| Cat 10 | CAT1 | CAT10 | |
| Cat 11 | CAT1 | CAT11 | |
| Cat 12 | CAT1 | CAT12 | |
| Cat 13 | CAT5 | CAT13 | |
| Cat 14 | CAT5 | CAT14 | |
| Cat 15 (many subcategories, many courses) | CAT5 | CAT15 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla non arcu lacinia neque faucibus fringilla. Vivamus porttitor turpis ac leo. Integer in sapien. Nullam eget nisl. Aliquam erat volutpat. Cras elementum. Mauris suscipit, ligula sit amet pharetra semper, nibh ante cursus purus, vel sagittis velit mauris vel metus. Integer malesuada. Nullam lectus justo, vulputate eget mollis sed, tempor sed magna. Mauris elementum mauris vitae tortor. Aliquam erat volutpat. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Pellentesque ipsum. Cras pede libero, dapibus nec, pretium sit amet, tempor quis. Aliquam ante. Proin in tellus sit amet nibh dignissim sagittis. Vivamus porttitor turpis ac leo. |
| Cat 16 | CAT15 | CAT16 | |
| Cat 17 | CAT15 | CAT17 | |
| Cat 24 | CAT15 | CAT24 | |
| Cat 25 | CAT15 | CAT25 | |
| Cat 26 | CAT15 | CAT26 | |
| Cat 27 | CAT15 | CAT27 | |
| Cat 28 | CAT15 | CAT28 | |
| Cat 29 | CAT15 | CAT29 | |
| Cat 18 | CAT1 | CAT18 | |
| Cat 19 | CAT1 | CAT19 | |
| Cat 20 | CAT1 | CAT20 | |
| Cat 21 | CAT1 | CAT21 | |
| Cat 22 | CAT1 | CAT22 | |
| Cat 23 | CAT1 | CAT23 | |
And the following "categories" exists:
| name | category | idnumber | visible |
| Cat 40 (hidden) | CAT13 | CAT40 | 0 |
| Cat 41 (hidden) | CAT40 | CAT41 | 0 |
# -------------------------------------------------------------------------------
# Generate courses
# -------------------------------------------------------------------------------
And the following "courses" exists:
| fullname | shortname | category | summary |
| Cat course | COURSE1 | 0 | The domestic cat is a small, usually furry, domesticated, and carnivorous mammal. It is often called the housecat when kept as an indoor pet, or simply the cat when there is no need to distinguish it from other felids and felines. Cats are valued by humans for companionship and their ability to hunt vermin and household pests. |
| Dog course | COURSE2 | 0 | The domestic dog is a subspecies of the gray wolf (Canis lupus), a member of the Canidae family of the mammalian order Carnivora. The term "domestic dog" is generally used for both domesticated and feral varieties. The dog has been the first animal to be domesticated and has been the most widely kept working, hunting, and pet animal in human history. The word "dog" may also mean the male of a canine species, as opposed to the word "bitch" for the female of the species. |
| Dog hidden course | COURSE2x | 0 | The domestic dog is a subspecies of the gray wolf (Canis lupus), a member of the Canidae family of the mammalian order Carnivora. The term "domestic dog" is generally used for both domesticated and feral varieties. The dog has been the first animal to be domesticated and has been the most widely kept working, hunting, and pet animal in human history. The word "dog" may also mean the male of a canine species, as opposed to the word "bitch" for the female of the species. |
| Mouse course | COURSE3 | 0 | A mouse (plural: mice) is a small mammal belonging to the order of rodents, characteristically having a pointed snout, small rounded ears, and a long naked or almost hairless tail. The best known mouse species is the common house mouse (Mus musculus). It is also a popular pet. In some places, certain kinds of field mice are also common. This rodent is eaten by large birds such as hawks and eagles. They are known to invade homes for food and occasionally shelter. |
| Course 4 | COURSE4 | CAT2 | Course summary |
| Course 5 (no summary) | COURSE5 | CAT2 ||
| Course 7 | COURSE7 | CAT2 | Course summary |
| Course 8 | COURSE8 | CAT2 | Course summary |
| Course 9 | COURSE9 | CAT2 | Course summary |
| Course 10 | COURSE10 | CAT2 | Course summary |
| Course 11 | COURSE11 | CAT2 | Course summary |
| Course 12 | COURSE12 | CAT2 | Course summary |
| Course 13 | COURSE13 | CAT2 | Course summary |
| Course 14 | COURSE14 | CAT15 | Course summary |
| Course 15 | COURSE15 | CAT15 | Course summary |
| Course 16 | COURSE16 | CAT15 | Course summary |
| Course 17 | COURSE17 | CAT15 | Course summary |
| Course 18 | COURSE18 | CAT15 | Course summary |
| Course 19 | COURSE19 | CAT15 | Course summary |
| Course 20 | COURSE20 | CAT15 | Course summary |
| Course 6 with very long name that to test how it is wrapped into several lines. Course 6 with very long name that to test how it is wrapped into several lines. Course 6 with very long name that to test how it is wrapped into several lines | COURSE6 | CAT2 | Course summary |
# -------------------------------------------------------------------------------
# Generate and enrol student and teachers
# -------------------------------------------------------------------------------
And the following "users" exists:
| username | firstname | lastname | email | auth | confirmed |
| student1 | Sam1 | Student1 | [email protected] | manual | 1 |
| teacher1 | Terry1 | Teacher1 | [email protected] | manual | 1 |
| teacher2 | Terry2 | Teacher2 | [email protected] | manual | 1 |
And the following "course enrolments" exists:
| user | course | role |
| teacher1 | COURSE1 | editingteacher |
| teacher1 | COURSE2 | editingteacher |
| teacher2 | COURSE2 | editingteacher |
| student1 | COURSE1 | student |
| student1 | COURSE2 | student |
# -------------------------------------------------------------------------------
# Allow uploading more course summary files than default:
# -------------------------------------------------------------------------------
And I log in as "admin"
And I set the following administration settings values:
| Course summary files limit | 5 |
| Course summary files extensions | .jpg,.gif,.png,.pdf |
# -------------------------------------------------------------------------------
# Allow guest access to "Cat course", add summary files:
# -------------------------------------------------------------------------------
When I am on homepage
And I follow "Cat course"
And I follow "Edit settings"
And I upload "admin/tool/behatui/tests/fixtures/cat.jpg" file to "Course summary files" filepicker
And I fill the moodle form with:
| Allow guest access | Yes |
And I press "Save changes"
# -------------------------------------------------------------------------------
# Enable self-enrolment for "Mouse course", add summary files:
# -------------------------------------------------------------------------------
When I am on homepage
And I follow "Mouse course"
And I follow "Edit settings"
And I upload "admin/tool/behatui/tests/fixtures/mouse.jpg" file to "Course summary files" filepicker
And I press "Save changes"
And I add "Self enrolment" enrolment method with:
| Custom instance name | Test student enrolment |
And I am on homepage
# -------------------------------------------------------------------------------
# Enable self-enrolment and guest access for "Dog course", add summary files:
# -------------------------------------------------------------------------------
When I am on homepage
And I follow "Dog course"
And I follow "Edit settings"
And I upload "admin/tool/behatui/tests/fixtures/dog.jpg" file to "Course summary files" filepicker
And I upload "admin/tool/behatui/tests/fixtures/dog_course_overview.pdf" file to "Course summary files" filepicker
And I fill the moodle form with:
| Allow guest access | Yes |
And I press "Save changes"
And I add "Self enrolment" enrolment method with:
| Custom instance name | Test student enrolment |
And I am on homepage
# -------------------------------------------------------------------------------
# Hide course and enable self-enrolment and guest access for "Dog hidden course", add summary files:
# -------------------------------------------------------------------------------
When I am on homepage
And I follow "Dog hidden course"
And I follow "Edit settings"
And I upload "admin/tool/behatui/tests/fixtures/dog.jpg" file to "Course summary files" filepicker
And I upload "admin/tool/behatui/tests/fixtures/dog_course_overview.pdf" file to "Course summary files" filepicker
And I fill the moodle form with:
| Allow guest access | Yes |
| Visible | Hide |
And I press "Save changes"
And I add "Self enrolment" enrolment method with:
| Custom instance name | Test student enrolment |
# -------------------------------------------------------------------------------
# Create modules inside "Cat course" (they will be seen on /my/ page)
# -------------------------------------------------------------------------------
When I am on homepage
And I follow "Cat course"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
And I add a "Chat" to section "1" and I fill the form with:
| Name of this chat room | Test chat name |
| Description | The new chat |
| Repeat/publish session times | At the same time every week |
And I log out
@javascript
Scenario Outline: Make screenshots of course listings
# -------------------------------------------------------------------------------
# Install languages, set browser size, change values for "courses per page" and other config variables affecting display.
# -------------------------------------------------------------------------------
Given I log in as "admin"
And I install languages "<languages>"
And I change browser size to <browserwidth>x768
And I set the following administration settings values:
| Courses per page | 5 |
| Courses with summaries limit | 4 |
| Auto-login guests | 1 |
And I am on homepage
And I follow "Edit settings"
And I fill in "id_s__frontpagecourselimit" with "8"
And I fill in "id_s__maxcategorydepth" with "10"
And I press "Save changes"
And I change guest frontpage display to List of courses
And Repeat in themes "<themes>":
"""
And I change frontpage display to Enrolled courses
And I log out
Then I save screenshots in languages "<languages>" as {themename}/{lang}_01_frontpageguest
When I follow "Mouse course"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_14_courseenrol
When I log in as "student1"
And I am on homepage
Then I save screenshots in languages "<languages>" as {themename}/{lang}_02_frontpageenroled
And I follow "My courses"
And I expand all course overviews
Then I save screenshots in languages "<languages>" as {themename}/{lang}_15_mycourses
And I log out
When I log in as "admin"
And I change frontpage display to Combo list
And I am on homepage
Then I save screenshots in languages "<languages>" as {themename}/{lang}_03_frontpagecombo
When I change frontpage display to List of categories,Course search box
And I am on homepage
Then I save screenshots in languages "<languages>" as {themename}/{lang}_04_frontpagecategories
When I follow "Courses"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_05_coursespage
When I follow "Miscellaneous"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_06_smallcategory
When I follow "Courses"
And I follow "Cat 1 (many subcategories, no courses)"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_07_categoriespaging
When I follow "Courses"
And I follow "Cat 2 (no subcategories, many courses)"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_08_coursespaging
When I follow "Courses"
When I fill in "Search courses:" with "course"
And I press "Go"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_09_coursesearch
When I am on homepage
And I follow "Cat 15 (many subcategories, many courses)"
And I follow "View more"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_11_bigcategorycategories
And I follow "View all courses"
Then I save screenshots in languages "<languages>" as {themename}/{lang}_12_bigcategorycourses
"""
# ===============================================================================
# Modify this to change the languages and/or themes set!
#
# Full list of moodle themes (excluding MyMobile):
# Afterburner,Anomaly,Arialist,Binarius,Boxxie,Brick,Clean,Formal white,FormFactor,Fusion,Leatherbound,Magazine,Nimble,Nonzero,Overlay,Serenity,Sky High,Splash,Standard (legacy),Standard
# ===============================================================================
Examples:
| languages | browserwidth | themes |
| en,he | 1200 | Standard,Clean |