1- @format @format_ucl
2- Feature : Adding a new section lands on the editing page
3- In order to add a new section
1+ @format @format_ucl @javascript
2+ Feature : Changes made using section controls are reflected in the table of contents
3+ In order to navigate my course
44 As a user
5- I need to edit a new section when one is added
5+ I need the table of contents to update when a section does
66
77 Background :
88 Given the following "course" exists:
@@ -13,16 +13,6 @@ Feature: Adding a new section lands on the editing page
1313 | numsections | 5 |
1414 | initsections | 1 |
1515
16- Scenario : Add and edit section
17- When I log in as "admin"
18- And I am on "Course 1" course homepage with editing mode on
19- And I click on ".behat-add-section" "css_element"
20- Then I should see "Edit section settings"
21- And I set the field "Section name" to "Welcome to Stamptown"
22- And I press "Save changes"
23- And "Welcome to Stamptown" "link" should appear after "Section 5" "link"
24-
25- @javascript
2616 Scenario : Section controls appear in expected order
2717 Given I log in as "admin"
2818 And I am on "Course 1" course homepage with editing mode on
@@ -34,7 +24,6 @@ Feature: Adding a new section lands on the editing page
3424 And "Duplicate" "link" should appear after "Highlight" "link"
3525 And "Delete" "link" should appear after "Duplicate" "link"
3626
37- @javascript
3827 Scenario : Hide section action updates table of contents
3928 Given I log in as "admin"
4029 And I am on "Course 1" course homepage with editing mode on
@@ -46,21 +35,23 @@ Feature: Adding a new section lands on the editing page
4635 And "[data-region='sectionvisibility']" "css_element" should be visible
4736 And "#toc [data-section='2'] .flag-hidden" "css_element" should be visible
4837
49- @javascript
50- Scenario : Move section action updates table of contents
38+ Scenario : Duplicate section action updates table of contents
5139 Given I log in as "admin"
5240 And I am on "Course 1" course homepage with editing mode on
5341 When I click on "Section 2" "link" in the "#toc" "css_element"
54- Then I should see "Section 1" in the ".behat-previous-section" "css_element"
55- And I should see "Section 3" in the ".behat-next-section" "css_element"
56- And I open ucl section "Section 2" edit menu
57- And I click on "Move" "link" in the ".section-actions" "css_element"
58- And I click on "Section 3" "link" in the "Move section" "dialogue"
59- And I should see "Section 3" in the ".behat-previous-section" "css_element"
60- And I should see "Section 4" in the ".behat-next-section" "css_element"
61-
62- @javascript
63- Scenario : Duplicate section action
42+ And I set the field "Edit section name" to "Stamptown"
43+ And I open ucl section "Stamptown" edit menu
44+ And I click on "Duplicate" "link" in the ".section-actions" "css_element"
45+ Then "Stamptown (copy)" "link" should exist in the "#toc" "css_element"
6446
65- @javascript
66- Scenario : Delete section action
47+ Scenario : Delete section action redirects to course page
48+ Given I log in as "admin"
49+ And I am on "Course 1" course homepage with editing mode on
50+ When I click on "Section 2" "link" in the "#toc" "css_element"
51+ And I open ucl section "Section 2" edit menu
52+ And I click on "Delete" "link" in the ".section-actions" "css_element"
53+ And I click on "Delete" "button" in the "Delete section?" "dialogue"
54+ # Section 2 should be removed.
55+ Then I should not see "Section 2"
56+ # The user should be redirected to the course page.
57+ And I should see "Introduction" in the "page" "region"
0 commit comments