Skip to content

Commit

Permalink
Fix behat testing for 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Nov 16, 2023
1 parent 877cf08 commit 3e2a083
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
26 changes: 13 additions & 13 deletions tests/behat/ajax.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ Feature:
| Course3 | C3 | topics | CAT2 |
| Course Maths 101 | Maths101 | topics | CAT3 |
And I log in as "admin"
And I follow "Turn editing on"
And I add the "Quick Course List" block
And I configure the "Quick Course List" block
And I set the field "Page contexts" to "Display throughout the entire site"
And I turn editing mode on
And I am on course index
And I add the "EF Quick Course List" block
And I configure the "EF Quick Course List" block
And I set the field "Display on page types" to "Any page"
And I press "Save changes"
And I log out

@block_quickcourselist_default
Scenario: Search with default settings
Given I log in as "admin"
When I set the field "efquicklistsearch" to "Course"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
When I am on course index
Then I set the field "efquicklistsearch" to "Course"
And I should see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
And I should see "C2: Course2" in the "block_quickcourselist" "block"
And I should see "C3: Course3" in the "block_quickcourselist" "block"
Expand Down Expand Up @@ -61,16 +63,15 @@ Feature:
Given I log in as "admin"
And the following config values are set as admin:
| restrictcontext | 1 | block_quickcourselist |
And I am on homepage

And I am on course index
When I set the field "efquicklistsearch" to "Course"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
And I should see "C2: Course2" in the "block_quickcourselist" "block"
And I should see "C3: Course3" in the "block_quickcourselist" "block"
And I should see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I follow "Courses"
Given I am on course index
And I follow "Cat1"
When I set the field "efquicklistsearch" to "Course"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -79,7 +80,7 @@ Feature:
And I should not see "C3: Course3" in the "block_quickcourselist" "block"
And I should not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I follow "Courses"
Given I am on course index
And I follow "Cat2"
When I set the field "efquicklistsearch" to "Course"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -88,7 +89,7 @@ Feature:
And I should see "C3: Course3" in the "block_quickcourselist" "block"
And I should not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I follow "Courses"
Given I am on course index
And I follow "Cat1"
And I follow "Cat3"
When I set the field "efquicklistsearch" to "Course"
Expand Down Expand Up @@ -128,5 +129,4 @@ Feature:
| splitterms | Course short name | block_quickcourselist |
And I am on homepage
When I set the field "efquicklistsearch" to "Course 101"
And I should see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

And I should see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"
35 changes: 18 additions & 17 deletions tests/behat/quickcourselist.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ Feature:
| Course3 | C3 | topics | CAT2 |
| Course Maths 101 | Maths101 | topics | CAT3 |
And I log in as "admin"
And I follow "Turn editing on"
And I add the "Quick Course List" block
And I configure the "Quick Course List" block
And I set the field "Page contexts" to "Display throughout the entire site"
And I am on course index
And I turn editing mode on
And I add the "EF Quick Course List" block
And I configure the "EF Quick Course List" block
And I press "Save changes"
And I log out

@block_quickcourselist_default
Scenario: Search with default settings
Given I log in as "admin"
When I set the field "efquicklistsearch" to "Course"
When I am on course index
And I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
Expand Down Expand Up @@ -65,18 +66,18 @@ Feature:
Given I log in as "admin"
And the following config values are set as admin:
| restrictcontext | 1 | block_quickcourselist |
And I am on homepage

When I set the field "efquicklistsearch" to "Course"
When I am on course index
And I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
And I should see "C2: Course2" in the "block_quickcourselist" "block"
And I should see "C3: Course3" in the "block_quickcourselist" "block"
And I should see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I follow "Courses"
And I follow "Cat1"
Given I am on course index
And I click on "Cat1" "link"
When I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -85,8 +86,8 @@ Feature:
And I should not see "C3: Course3" in the "block_quickcourselist" "block"
And I should not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I set the field "categoryid" to "Cat2"
And I press "Go"
Given I am on course index
And I click on "Cat2" "link"
When I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -95,8 +96,8 @@ Feature:
And I should see "C3: Course3" in the "block_quickcourselist" "block"
And I should not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I set the field "categoryid" to "Cat3"
And I press "Go"
Given I am on course index
And I click on "Cat3" "link"
When I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -110,23 +111,23 @@ Feature:
Given I log in as "admin"
And the following config values are set as admin:
| displaymode | 1 | block_quickcourselist |
And I am on homepage
And I am on course index
When I set the field "efquicklistsearch" to "C"
And I press "quickcoursesubmit"
Then I should see "C1" in the "block_quickcourselist" "block"
And I should not see "Course1" in the "block_quickcourselist" "block"

Given the following config values are set as admin:
| displaymode | 2 | block_quickcourselist |
And I am on homepage
And I am on course index
When I set the field "efquicklistsearch" to "C"
And I press "quickcoursesubmit"
Then I should see "Course1" in the "block_quickcourselist" "block"
And I should not see "C1" in the "block_quickcourselist" "block"

Given the following config values are set as admin:
| displaymode | 3 | block_quickcourselist |
And I am on homepage
And I am on course index
When I set the field "efquicklistsearch" to "C"
And I press "quickcoursesubmit"
Then I should see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -136,7 +137,7 @@ Feature:
Given I log in as "admin"
And the following config values are set as admin:
| splitterms | Course short name | block_quickcourselist |
And I am on homepage
And I am on course index
When I set the field "efquicklistsearch" to "Course 101"
And I press "quickcoursesubmit"
And I should see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"
Expand Down

0 comments on commit 3e2a083

Please sign in to comment.