Skip to content

Commit f3f80a8

Browse files
committed
CTP-6247 Extend behat tests
1 parent 5f8783d commit f3f80a8

6 files changed

Lines changed: 72 additions & 30 deletions

File tree

templates/widgets/contacts/contact.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
{{/custom}}
6565

6666
{{! TODO - can we add subject or body = course code, student number? }}
67+
{{! https://stackoverflow.com/questions/4782068/can-i-set-subject-content-of-email-using-mailto }}
6768
<a href="mailto:{{{email}}}" target="_blank">
6869
<i class="fa-regular fa-envelope mr-1"></i>{{{email}}}
6970
</a>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@format @format_ucl
2+
Feature: Adding a new section lands on the editing page
3+
In order to add a new section
4+
As a user
5+
I need to edit a new section when one is added
6+
7+
Background:
8+
Given the following "course" exists:
9+
| fullname | Course 1 |
10+
| shortname | C1 |
11+
| format | ucl |
12+
| coursedisplay | 0 |
13+
| numsections | 5 |
14+
| initsections | 1 |
15+
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"
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Feature: Initial section has custom layout
33
In order to to quickly find important course information
44
As a user
5-
I need to see consistent layout
5+
I need to see a consistent layout in the initial section
66

77
Background:
88
Given the following "courses" exist:
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@format @format_ucl
2+
Feature: Adding a new section lands on the editing page
3+
In order to add a new section
4+
As a user
5+
I need to edit a new section when one is added
6+
7+
Background:
8+
Given the following "course" exists:
9+
| fullname | Course 1 |
10+
| shortname | C1 |
11+
| format | ucl |
12+
| coursedisplay | 0 |
13+
| numsections | 5 |
14+
| initsections | 1 |
15+
16+
@javascript
17+
Scenario: Move section action updates section navigation
18+
Given I log in as "admin"
19+
And I am on "Course 1" course homepage with editing mode on
20+
When I click on "Section 2" "link" in the "#toc" "css_element"
21+
Then I should see "Section 1" in the ".behat-previous-section" "css_element"
22+
And I should see "Section 3" in the ".behat-next-section" "css_element"
23+
And I open ucl section "Section 2" edit menu
24+
And I click on "Move" "link" in the ".section-actions" "css_element"
25+
And I click on "Section 3" "link" in the "Move section" "dialogue"
26+
And I should see "Section 3" in the ".behat-previous-section" "css_element"
27+
And I should see "Section 4" in the ".behat-next-section" "css_element"

0 commit comments

Comments
 (0)