1 |
efrain |
1 |
@core @core_course
|
|
|
2 |
Feature: Sections can be moved
|
|
|
3 |
In order to rearrange my course contents
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to move sections up and down
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
And the following "course" exists:
|
|
|
12 |
| fullname | Course 1 |
|
|
|
13 |
| shortname | C1 |
|
|
|
14 |
| format | topics |
|
|
|
15 |
| coursedisplay | 0 |
|
|
|
16 |
| numsections | 5 |
|
|
|
17 |
|initsections | 1 |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | name | course | idnumber | section |
|
|
|
23 |
| forum | Test forum name | C1 | forum1 | 1 |
|
|
|
24 |
|
|
|
25 |
Scenario: Move up and down a section with Javascript disabled in a single page course
|
|
|
26 |
Given I log in as "teacher1"
|
|
|
27 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
28 |
When I move down section "1"
|
|
|
29 |
Then "Section 1" "section" should appear after "Section 2" "section"
|
|
|
30 |
And I should see "Test forum name" in the "Section 1" "section"
|
|
|
31 |
And I move up section "2"
|
|
|
32 |
And "Section 2" "section" should appear after "Section 1" "section"
|
|
|
33 |
And I should see "Test forum name" in the "Section 1" "section"
|
|
|
34 |
|
|
|
35 |
Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode
|
|
|
36 |
Given I log in as "teacher1"
|
|
|
37 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
38 |
And I navigate to "Settings" in current page administration
|
|
|
39 |
And I set the following fields to these values:
|
|
|
40 |
| Course layout | Show one section per page |
|
|
|
41 |
And I press "Save and display"
|
|
|
42 |
When I move down section "1"
|
|
|
43 |
Then "Section 1" "section" should appear after "Section 2" "section"
|
|
|
44 |
And I should see "Test forum name" in the "Section 1" "section"
|
|
|
45 |
And I move up section "2"
|
|
|
46 |
And "Section 2" "section" should appear after "Section 1" "section"
|
|
|
47 |
And I should see "Test forum name" in the "Section 1" "section"
|
|
|
48 |
|
|
|
49 |
Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode
|
|
|
50 |
Given I am on the "Course 1" course page logged in as "teacher1"
|
|
|
51 |
And I navigate to "Settings" in current page administration
|
|
|
52 |
And I set the following fields to these values:
|
|
|
53 |
| Course layout | Show one section per page |
|
|
|
54 |
And I press "Save and display"
|
|
|
55 |
When I click on "Section 2" "link" in the "region-main" "region"
|
|
|
56 |
And I turn editing mode on
|
|
|
57 |
Then "Section 1" "section" should not exist
|
|
|
58 |
And "Section 3" "section" should not exist
|
|
|
59 |
And "Move down" "link" should not exist
|
|
|
60 |
And "Move up" "link" should not exist
|
|
|
61 |
|
|
|
62 |
@javascript
|
|
|
63 |
Scenario: Move section with javascript
|
|
|
64 |
Given I log in as "teacher1"
|
|
|
65 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
66 |
When I open section "1" edit menu
|
|
|
67 |
And I click on "Move" "link" in the "Section 1" "section"
|
|
|
68 |
And I click on "Section 3" "link" in the ".modal-body" "css_element"
|
|
|
69 |
Then "Section 1" "section" should appear after "Section 3" "section"
|
|
|
70 |
And I should see "Test forum name" in the "Section 1" "section"
|