MDL-72179 behat: Fix page resolvers to remove ambiguity

The simple pattern matches were conflicting in some situations. To make
this backwards compatable we need to convert it to a Regex pattern match
instead, and provide the quoted and unquoted variants.
This commit is contained in:
Andrew Nicols
2021-07-23 20:43:47 +08:00
parent 63df6e1ee2
commit 3d4b232a4a
2 changed files with 38 additions and 7 deletions
@@ -5,7 +5,10 @@ Feature: Use core page resolvers for the I am on the page steps
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "course" exists:
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
@@ -19,13 +22,19 @@ Feature: Use core page resolvers for the I am on the page steps
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
Scenario Outline: When I am on an instance logged in as
Given the following "course" exists:
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
@@ -39,6 +48,9 @@ Feature: Use core page resolvers for the I am on the page steps
Examples:
| description | identifier | type | shouldsee |
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
@@ -51,13 +63,14 @@ Feature: Use core page resolvers for the I am on the page steps
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@javascript
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |