1 |
efrain |
1 |
@core @core_course @core_courseformat
|
|
|
2 |
Feature: Course content collapsed user preferences
|
|
|
3 |
In order to quickly access the course content
|
|
|
4 |
As a user
|
|
|
5 |
I need to keep the course sections collapsed when I return to the course.
|
|
|
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 "course" exists:
|
|
|
13 |
| fullname | Course 1 |
|
|
|
14 |
| shortname | C1 |
|
|
|
15 |
| category | 0 |
|
|
|
16 |
| enablecompletion | 1 |
|
|
|
17 |
| numsections | 5 |
|
|
|
18 |
| initsections | 1 |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | intro | course | idnumber | section |
|
|
|
21 |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
|
|
|
22 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
|
|
|
23 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
|
|
|
24 |
| assign | Activity sample 4 | Test assignment description | C1 | sample1 | 4 |
|
|
|
25 |
| assign | Activity sample 5 | Test assignment description | C1 | sample1 | 5 |
|
|
|
26 |
And the following "course enrolments" exist:
|
|
|
27 |
| user | course | role |
|
|
|
28 |
| student1 | C1 | student |
|
|
|
29 |
| teacher1 | C1 | editingteacher |
|
|
|
30 |
|
|
|
31 |
@javascript
|
|
|
32 |
Scenario: Course content preferences
|
|
|
33 |
Given I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
34 |
And I should see "Section 1" in the "region-main" "region"
|
|
|
35 |
And I should see "Activity sample 1" in the "region-main" "region"
|
|
|
36 |
And I should see "Section 2" in the "region-main" "region"
|
|
|
37 |
And I should see "Activity sample 2" in the "region-main" "region"
|
|
|
38 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
39 |
And I should see "Activity sample 3" in the "region-main" "region"
|
|
|
40 |
And I click on "#collapssesection1" "css_element"
|
|
|
41 |
When I reload the page
|
|
|
42 |
Then I should see "Section 1" in the "region-main" "region"
|
|
|
43 |
And I should not see "Activity sample 1" in the "region-main" "region"
|
|
|
44 |
And I should see "Section 2" in the "region-main" "region"
|
|
|
45 |
And I should see "Activity sample 2" in the "region-main" "region"
|
|
|
46 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
47 |
And I should see "Activity sample 3" in the "region-main" "region"
|
|
|
48 |
And I click on "#collapssesection2" "css_element"
|
|
|
49 |
And I reload the page
|
|
|
50 |
And I should see "Section 1" in the "region-main" "region"
|
|
|
51 |
And I should not see "Activity sample 1" in the "region-main" "region"
|
|
|
52 |
And I should see "Section 2" in the "region-main" "region"
|
|
|
53 |
And I should not see "Activity sample 2" in the "region-main" "region"
|
|
|
54 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
55 |
And I should see "Activity sample 3" in the "region-main" "region"
|
|
|
56 |
And I click on "#collapssesection3" "css_element"
|
|
|
57 |
And I reload the page
|
|
|
58 |
And I should see "Section 1" in the "region-main" "region"
|
|
|
59 |
And I should not see "Activity sample 1" in the "region-main" "region"
|
|
|
60 |
And I should see "Section 2" in the "region-main" "region"
|
|
|
61 |
And I should not see "Activity sample 2" in the "region-main" "region"
|
|
|
62 |
And I should see "Section 3" in the "region-main" "region"
|
|
|
63 |
And I should not see "Activity sample 3" in the "region-main" "region"
|
|
|
64 |
And I click on "#collapssesection2" "css_element"
|
|
|
65 |
And I click on "#collapssesection3" "css_element"
|
|
|
66 |
And I reload the page
|
|
|
67 |
And I should see "Section 1" in the "region-main" "region"
|
|
|
68 |
And I should not see "Activity sample 1" in the "region-main" "region"
|
|
|
69 |
And I click on "#collapssesection4" "css_element"
|
|
|
70 |
And I turn editing mode on
|
|
|
71 |
And I delete section "1"
|
|
|
72 |
And I click on "Delete" "button" in the ".modal" "css_element"
|
|
|
73 |
And I should not see "Activity sample 1" in the "region-main" "region"
|
|
|
74 |
And I should see "Activity sample 2" in the "region-main" "region"
|
|
|
75 |
And I should see "Activity sample 3" in the "region-main" "region"
|
|
|
76 |
And I should not see "Activity sample 4" in the "region-main" "region"
|
|
|
77 |
And I should see "Activity sample 5" in the "region-main" "region"
|