Skip to content

Commit

Permalink
fix behat tests for new section names
Browse files Browse the repository at this point in the history
  • Loading branch information
Syxton committed Apr 9, 2024
1 parent d3a086a commit 327bd23
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
45 changes: 22 additions & 23 deletions tests/behat/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Feature: Check if all the different type of actions of the mass actions block wo
Scenario: Check if mass action 'move to section' works
When I click on "Test Activity1" "checkbox"
And I click on "Test Activity4" "checkbox"
And I set the field "target_section_moving" in the "Mass Actions" "block" to "Topic 3"
And I set the field "target_section_moving" in the "Mass Actions" "block" to "3"
And I click on "move_to_section" "button" in the "Mass Actions" "block"
Then I should see "Test Activity1" in the "Topic 3" "section"
And I should see "Test Activity4" in the "Topic 3" "section"
Then I should see "Test Activity1" in the "#section-3" "css_element"
And I should see "Test Activity4" in the "#section-3" "css_element"

@javascript
Scenario: Check if mass action 'delete' works
Expand Down Expand Up @@ -96,10 +96,9 @@ Feature: Check if all the different type of actions of the mass actions block wo
And I click on "Test Activity4" "checkbox"
And I click on "Test Activity5" "checkbox"
And I click on "Duplicate" "button" in the "Mass Actions" "block"
Then I should see "Test Activity2 (copy)" in the "Topic 1" "section"
And I should see "Test Activity4 (copy)" in the "Topic 4" "section"
And I should see "Test Activity5 (copy)" in the "Topic 4" "section"

Then I should see "Test Activity2 (copy)" in the "#section-1" "css_element"
And I should see "Test Activity4 (copy)" in the "#section-4" "css_element"
And I should see "Test Activity5 (copy)" in the "#section-4" "css_element"
@javascript
Scenario: Check if mass action 'duplicate to course' works (keeping sections)
Given the following "courses" exist:
Expand All @@ -118,9 +117,9 @@ Feature: Check if all the different type of actions of the mass actions block wo
And I click on "Keep original section number" "radio"
And I click on "Choose section" "button"
And I am on "Test course 2" course homepage
Then I should see "Test Activity2" in the "Topic 1" "section"
And I should see "Test Activity4" in the "Topic 4" "section"
And I should see "Test Activity5" in the "Topic 4" "section"
Then I should see "Test Activity2" in the "#section-1" "css_element"
And I should see "Test Activity4" in the "#section-4" "css_element"
And I should see "Test Activity5" in the "#section-4" "css_element"

@javascript
Scenario: Check if mass action 'duplicate to course' works (target section)
Expand All @@ -140,9 +139,9 @@ Feature: Check if all the different type of actions of the mass actions block wo
And I click on "Section 2" "radio"
And I click on "Choose section" "button"
And I am on "Test course 2" course homepage
Then I should see "Test Activity2" in the "Topic 2" "section"
And I should see "Test Activity4" in the "Topic 2" "section"
And I should see "Test Activity5" in the "Topic 2" "section"
Then I should see "Test Activity2" in the "#section-2" "css_element"
And I should see "Test Activity4" in the "#section-2" "css_element"
And I should see "Test Activity5" in the "#section-2" "css_element"

@javascript
Scenario: Check if mass action 'duplicate to course' works (new section)
Expand All @@ -162,23 +161,23 @@ Feature: Check if all the different type of actions of the mass actions block wo
And I click on "New Section" "radio"
And I click on "Choose section" "button"
And I am on "Test course 2" course homepage
Then I should see "Test Activity2" in the "Topic 3" "section"
And I should see "Test Activity4" in the "Topic 3" "section"
And I should see "Test Activity5" in the "Topic 3" "section"
Then I should see "Test Activity2" in the "#section-3" "css_element"
And I should see "Test Activity4" in the "#section-3" "css_element"
And I should see "Test Activity5" in the "#section-3" "css_element"

@javascript
Scenario: Check if mass action 'duplicate to section' works
When I click on "Test Activity2" "checkbox"
And I click on "Test Activity4" "checkbox"
And I click on "Test Activity5" "checkbox"
And I set the field "target_section_duplicating" in the "Mass Actions" "block" to "Topic 3"
And I set the field "target_section_duplicating" in the "Mass Actions" "block" to "3"
And I click on "duplicate_to_section" "button" in the "Mass Actions" "block"
Then I should see "Test Activity2" in the "Topic 1" "section"
And I should see "Test Activity4" in the "Topic 4" "section"
And I should see "Test Activity5" in the "Topic 4" "section"
And I should see "Test Activity2 (copy)" in the "Topic 3" "section"
And I should see "Test Activity4 (copy)" in the "Topic 3" "section"
And I should see "Test Activity5 (copy)" in the "Topic 3" "section"
Then I should see "Test Activity2" in the "#section-1" "css_element"
And I should see "Test Activity4" in the "#section-4" "css_element"
And I should see "Test Activity5" in the "#section-4" "css_element"
And I should see "Test Activity2 (copy)" in the "#section-3" "css_element"
And I should see "Test Activity4 (copy)" in the "#section-3" "css_element"
And I should see "Test Activity5 (copy)" in the "#section-3" "css_element"

@javascript
Scenario: Check if mass actions 'indent' and 'outdent' work
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Check if in format_topics block properly disables the currently not act
And I click on "Enable bulk editing" "button"
# Dropdown list is being generated by JS, so we need to wait a bit until this has been loaded.
And I wait "3" seconds
And I set the field "target_section_selecting_all" to "Topic 1"
And I set the field "target_section_selecting_all" to "1"
Then the field "Test Activity1" matches value "1"
Then the field "Test Activity2" matches value "1"
Then the field "Test Activity3" matches value "1"
Expand Down

0 comments on commit 327bd23

Please sign in to comment.