Skip to content

Commit

Permalink
MDL-58435 behat: Update existing tests to use section editing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
NeillM committed Aug 15, 2017
1 parent 0f84b17 commit 156a0a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
8 changes: 3 additions & 5 deletions course/format/topics/tests/behat/edit_delete_sections.feature
Expand Up @@ -24,20 +24,18 @@ Feature: Sections can be edited and deleted in topics format
And I am on "Course 1" course homepage with editing mode on

Scenario: View the default name of the general section in topics format
When I click on "Edit section" "link" in the "li#section-0" "css_element"
When I edit the section "0"
Then the field "Custom" matches value "0"
And the field "New value for Section name" matches value "General"

Scenario: Edit the default name of the general section in topics format
When I click on "Edit section" "link" in the "li#section-0" "css_element"
And I set the following fields to these values:
When I edit the section "0" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the general section |
And I press "Save changes"
Then I should see "This is the general section" in the "li#section-0" "css_element"

Scenario: View the default name of the second section in topics format
When I click on "Edit topic" "link" in the "li#section-2" "css_element"
When I edit the section "2"
Then the field "Custom" matches value "0"
And the field "New value for Section name" matches value "Topic 2"

Expand Down
16 changes: 5 additions & 11 deletions course/format/weeks/tests/behat/edit_delete_sections.feature
Expand Up @@ -24,37 +24,31 @@ Feature: Sections can be edited and deleted in weeks format
And I am on "Course 1" course homepage with editing mode on

Scenario: View the default name of the general section in weeks format
When I click on "Edit section" "link" in the "li#section-0" "css_element"
When I edit the section "0"
Then the field "Custom" matches value "0"
And the field "New value for Section name" matches value "General"

Scenario: Edit the default name of the general section in weeks format
When I click on "Edit section" "link" in the "li#section-0" "css_element"
And I set the following fields to these values:
When I edit the section "0" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the general section |
And I press "Save changes"
Then I should see "This is the general section" in the "li#section-0" "css_element"

Scenario: View the default name of the second section in weeks format
When I click on "Edit week" "link" in the "li#section-2" "css_element"
When I edit the section "2"
Then the field "Custom" matches value "0"
And the field "New value for Section name" matches value "8 May - 14 May"

Scenario: Edit section summary in weeks format
When I click on "Edit week" "link" in the "li#section-2" "css_element"
And I set the following fields to these values:
When I edit the section "2" and I fill the form with:
| Summary | Welcome to section 2 |
And I press "Save changes"
Then I should see "Welcome to section 2" in the "li#section-2" "css_element"

Scenario: Edit section default name in weeks format
Given I should see "8 May - 14 May" in the "li#section-2" "css_element"
When I click on "Edit week" "link" in the "li#section-2" "css_element"
And I set the following fields to these values:
When I edit the section "2" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the second week |
And I press "Save changes"
Then I should see "This is the second week" in the "li#section-2" "css_element"
And I should not see "8 May - 14 May" in the "li#section-2" "css_element"

Expand Down

0 comments on commit 156a0a1

Please sign in to comment.