2 Feature: Activities can be moved between sections
3 In order to rearrange my course contents
5 I need to move activities between sections
8 Given the following "users" exists:
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@asd.com |
11 And the following "courses" exists:
12 | fullname | shortname | format | coursedisplay | numsections |
13 | Course 1 | C1 | topics | 0 | 5 |
14 And the following "course enrolments" exists:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "teacher1"
18 And I follow "Course 1"
19 And I turn editing mode on
20 And I follow "Delete Recent activity block"
22 And I follow "Configure Navigation block"
23 And I fill the moodle form with:
25 And I press "Save changes"
26 And I add a "Forum" to section "1" and I fill the form with:
27 | Forum name | Test forum name |
28 | Description | Test forum description |
30 @javascript @_cross_browser
31 Scenario: Move activities in a single page course with Javascript enabled
32 When I move "Test forum name" activity to section "2"
34 Then I should see "Test forum name" in the "#section-2" "css_element"
35 And I should not see "Test forum name" in the "#section-1" "css_element"
37 @javascript @_cross_browser
38 Scenario: Move activities in the course home with Javascript enabled using paged mode
39 Given I follow "Edit settings"
40 And I fill the moodle form with:
41 | Course layout | Show one section per page |
42 And I press "Save changes"
43 When I move "Test forum name" activity to section "2"
44 # This reload step is added because of drap&drop & yui dd problem
46 Then I should see "Test forum name" in the "#section-2" "css_element"
47 And I should not see "Test forum name" in the "#section-1" "css_element"
49 Scenario: Move activities in a single page course with Javascript disabled
50 When I move "Test forum name" activity to section "2"
51 Then I should see "Test forum name" in the "#section-2" "css_element"
52 And I should not see "Test forum name" in the "#section-1" "css_element"
54 Scenario: Move activities in the course home with Javascript disabled using paged mode
55 Given I follow "Edit settings"
56 And I fill the moodle form with:
57 | Course layout | Show one section per page |
58 And I press "Save changes"
59 When I move "Test forum name" activity to section "2"
60 Then I should see "Test forum name" in the "#section-2" "css_element"
61 And I should not see "Test forum name" in the "#section-1" "css_element"
63 Scenario: Move activities in a course section with Javascript disabled using paged mode
64 Given I follow "Edit settings"
65 And I fill the moodle form with:
66 | Course layout | Show one section per page |
67 And I press "Save changes"
68 And I add a "Forum" to section "1" and I fill the form with:
69 | Forum name | Second forum name |
70 | Description | Second forum description |
71 And I follow "Topic 1"
72 When I move "Second forum name" activity to section "1"
73 Then "Second forum name" "link" should appear before "Test forum name" "link"