1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Teacher can change the course format
|
|
|
3 |
In order to change course format
|
|
|
4 |
As a teacher
|
|
|
5 |
I should be able to edit a course
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Teacher can change the course format
|
|
|
9 |
Given the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
# Course format is initially set to Custom sections format
|
|
|
13 |
And the following "course" exists:
|
|
|
14 |
| fullname | Course 1 |
|
|
|
15 |
| shortname | C1 |
|
|
|
16 |
| format | topics |
|
|
|
17 |
| startdate | ## 1 day ago ## |
|
|
|
18 |
| initsections | 1 |
|
|
|
19 |
And the following "course enrolments" exist:
|
|
|
20 |
| user | course | role |
|
|
|
21 |
| teacher1 | C1 | editingteacher |
|
|
|
22 |
# Confirm that course format is Custom sections.
|
|
|
23 |
When I am on the "Course 1" course page logged in as teacher1
|
|
|
24 |
Then I should see "Section 1"
|
|
|
25 |
And I am on the "Course 1" "course editing" page
|
|
|
26 |
And I expand all fieldsets
|
|
|
27 |
# Fields that appear for Custom sections format exist
|
|
|
28 |
# Also confirm contents of Hidden sections and Course layout select box
|
|
|
29 |
And I should see "Hidden sections"
|
|
|
30 |
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
|
|
|
31 |
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
|
|
|
32 |
# Hidden sections default value is 1 (Hidden sections are completely invisible)
|
|
|
33 |
And the field "Hidden sections" matches value "1"
|
|
|
34 |
And I should see "Course layout"
|
|
|
35 |
And the "Course layout" select box should contain "Show all sections on one page"
|
|
|
36 |
And the "Course layout" select box should contain "Show one section per page"
|
|
|
37 |
# Course layout default value is 0 (Show all sections on one page)
|
|
|
38 |
And the field "Course layout" matches value "0"
|
|
|
39 |
# Set course format to Single activity format
|
|
|
40 |
And I set the field "Format" to "Single activity"
|
|
|
41 |
And I expand all fieldsets
|
|
|
42 |
# Confirm that fields that appear for Single activity format appears
|
|
|
43 |
And I should see "Type of activity"
|
|
|
44 |
And I set the field "Type of activity" to "Glossary"
|
|
|
45 |
And I press "Save and display"
|
|
|
46 |
And I set the field "Name" to "Glossary 1"
|
|
|
47 |
And I press "Save and display"
|
|
|
48 |
# Confirm that course page displays single activity of type Glossary
|
|
|
49 |
And I should see "Browse the glossary using this index"
|
|
|
50 |
And I should not see "Section 1"
|
|
|
51 |
And I am on the "Course 1" "course editing" page
|
|
|
52 |
And I expand all fieldsets
|
|
|
53 |
# Set course format.
|
|
|
54 |
And I set the field "Format" to "Weekly sections"
|
|
|
55 |
And I expand all fieldsets
|
|
|
56 |
# Confirm that fields that appear for Weekly sections format appears
|
|
|
57 |
# Also confirm contents of Hidden sections and Course layout select box
|
|
|
58 |
And I should see "Hidden sections"
|
|
|
59 |
And the "Hidden sections" select box should contain "Hidden sections are shown as not available"
|
|
|
60 |
And the "Hidden sections" select box should contain "Hidden sections are completely invisible"
|
|
|
61 |
# Hidden sections default value is 1 (Hidden sections are completely invisible)
|
|
|
62 |
And the field "Hidden sections" matches value "1"
|
|
|
63 |
And I should see "Course layout"
|
|
|
64 |
And the "Course layout" select box should contain "Show all sections on one page"
|
|
|
65 |
And the "Course layout" select box should contain "Show one section per page"
|
|
|
66 |
# Course layout default value is 0 (Show all sections on one page)
|
|
|
67 |
And the field "Course layout" matches value "0"
|
|
|
68 |
And I press "Save and display"
|
|
|
69 |
# Confirm that course page displays weekly sections
|
|
|
70 |
And I should see "Current week"
|
|
|
71 |
And I should not see "Browse the glossary using this index"
|
|
|
72 |
And I am on the "Course 1" "course editing" page
|
|
|
73 |
And I expand all fieldsets
|
|
|
74 |
# Set course format to Social format
|
|
|
75 |
And I set the field "Format" to "Social"
|
|
|
76 |
# Confirm that fields that appear for Social format appears
|
|
|
77 |
And I expand all fieldsets
|
|
|
78 |
And I should see "Number of discussions"
|
|
|
79 |
And the field "Number of discussions" matches value "10"
|
|
|
80 |
And I press "Save and display"
|
|
|
81 |
# Confirm that course page displays a forum
|
|
|
82 |
And I should see "There are no discussion topics yet in this forum"
|
|
|
83 |
And I should not see "Current week"
|