Skip to content

Commit

Permalink
Update behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Nov 16, 2023
1 parent 860b06a commit b68efcf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ jobs:
with:
#Grunt fails due to CSS styling needing an !important.
disable_release : true
disable_phpunit : true
release_branches: main
min_php : 7.4
10 changes: 1 addition & 9 deletions tests/behat/ajax.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@block @block_quickcourselist @javascript
Feature:
Feature: Test ajax search in quick course list block
As an admin
In order to navigate to course pages quickly
I need to be able to search for courses by name
Expand Down Expand Up @@ -36,21 +36,18 @@ Feature:
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"

When I set the field "efquicklistsearch" to "Course1"
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 not see "C2: Course2" in the "block_quickcourselist" "block"
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"

When I set the field "efquicklistsearch" to "1a"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
And I should not see "C2: Course2" in the "block_quickcourselist" "block"
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"

When I set the field "efquicklistsearch" to "Maths101"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
And I should not see "C1a: Course1a" in the "block_quickcourselist" "block"
Expand All @@ -70,7 +67,6 @@ Feature:
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 am on course index
And I follow "Cat1"
When I set the field "efquicklistsearch" to "Course"
Expand All @@ -79,7 +75,6 @@ Feature:
And I should not see "C2: Course2" in the "block_quickcourselist" "block"
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 am on course index
And I follow "Cat2"
When I set the field "efquicklistsearch" to "Course"
Expand All @@ -88,7 +83,6 @@ Feature:
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 not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I am on course index
And I follow "Cat1"
And I follow "Cat3"
Expand All @@ -108,14 +102,12 @@ Feature:
When I set the field "efquicklistsearch" to "C"
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
When I set the field "efquicklistsearch" to "C"
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
Expand Down
12 changes: 1 addition & 11 deletions tests/behat/quickcourselist.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@block @block_quickcourselist
Feature:
Feature: Test different settings in quick course list block
As an admin
In order to navigate to course pages quickly
I need to be able to search for courses by name
Expand Down Expand Up @@ -36,23 +36,20 @@ Feature:
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"

When I set the field "efquicklistsearch" to "Course1"
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 not see "C2: Course2" in the "block_quickcourselist" "block"
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"

When I set the field "efquicklistsearch" to "1a"
And I press "quickcoursesubmit"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
And I should see "C1a: Course1a" in the "block_quickcourselist" "block"
And I should not see "C2: Course2" in the "block_quickcourselist" "block"
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"

When I set the field "efquicklistsearch" to "Maths101"
And I press "quickcoursesubmit"
Then I should not see "C1: Course1" in the "block_quickcourselist" "block"
Expand All @@ -66,7 +63,6 @@ Feature:
Given I log in as "admin"
And the following config values are set as admin:
| restrictcontext | 1 | block_quickcourselist |

When I am on course index
And I set the field "efquicklistsearch" to "Course"
And I press "quickcoursesubmit"
Expand All @@ -75,7 +71,6 @@ Feature:
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 am on course index
And I click on "Cat1" "link"
When I set the field "efquicklistsearch" to "Course"
Expand All @@ -85,7 +80,6 @@ Feature:
And I should not see "C2: Course2" in the "block_quickcourselist" "block"
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 am on course index
And I click on "Cat2" "link"
When I set the field "efquicklistsearch" to "Course"
Expand All @@ -95,7 +89,6 @@ Feature:
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 not see "Maths101: Course Maths 101" in the "block_quickcourselist" "block"

Given I am on course index
And I click on "Cat1" "link"
And I click on "Cat3" "link"
Expand All @@ -117,15 +110,13 @@ Feature:
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 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 course index
Expand All @@ -142,4 +133,3 @@ Feature:
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"

0 comments on commit b68efcf

Please sign in to comment.