forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-72179 behat: Improve core page resolvers
This commit makes the following improvements to core page resolverss: * allows for mixed case naming (course, Course, etc.) * allows fields other than the idnumber to be specified: ** course: idnumber, shortname, fullname ** course category: idnumber, name Whilst some of these fields are not unique, they will typically be unique in most test scenarios. Where they are not then the idnumber should be used in preference.
- Loading branch information
1 parent
8c0853d
commit 730d6cb
Showing
4 changed files
with
163 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@tool @tool_behat | ||
Feature: Use core page resolvers for the I am on the page steps | ||
In order to write tests correctly | ||
As a developer | ||
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: | ||
| fullname | Economics 101 | | ||
| shortname | ECON101 | | ||
| idnumber | 2021-econ101 | | ||
And the following "activity" exists: | ||
| course | ECON101 | | ||
| activity | forum | | ||
| name | Fundamentals of Economics | | ||
| idnumber | fundamentalsofeconomics | | ||
And I log in as "admin" | ||
When I am on the <identifier> <type> page | ||
Then I should see "<shouldsee>" | ||
|
||
Examples: | ||
| 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: | ||
| fullname | Economics 101 | | ||
| shortname | ECON101 | | ||
| idnumber | 2021-econ101 | | ||
And the following "activity" exists: | ||
| course | ECON101 | | ||
| activity | forum | | ||
| name | Fundamentals of Economics | | ||
| idnumber | fundamentalsofeconomics | | ||
When I am on the <identifier> <type> page logged in as admin | ||
Then I should see "<shouldsee>" | ||
|
||
Examples: | ||
| description | identifier | type | shouldsee | | ||
| 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 a named page | ||
Given I log in as "admin" | ||
When I am on the <identifier> page | ||
Then I should see "<shouldsee>" | ||
|
||
Examples: | ||
| description | identifier | shouldsee | | ||
| Admin page | Admin | 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 | | ||
| Home page | Homepage | Recently accessed courses | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters