diff --git a/admin/tool/behat/tests/behat/i_am_on_page.feature b/admin/tool/behat/tests/behat/i_am_on_page.feature index 10312f1969a..bb04f9e4a4c 100644 --- a/admin/tool/behat/tests/behat/i_am_on_page.feature +++ b/admin/tool/behat/tests/behat/i_am_on_page.feature @@ -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 "" 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 page logged in as admin Then I should see "" Examples: | description | identifier | shouldsee | + | Admin page | "Admin notifications" | Check for available updates | | Home page | Homepage | Recently accessed courses | diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index d457797c3bd..593a720c8df 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -543,7 +543,9 @@ class behat_navigation extends behat_base { * * For pages belonging to core, the 'core > ' bit is omitted. * - * @When I am on the :page page + * @When /^I am on the (?[^ "]*) page$/ + * @When /^I am on the "(?[^"]*)" page$/ + * * @param string $page the component and page name. * E.g. 'Admin notifications' or 'core_user > Preferences'. * @throws Exception if the specified page cannot be determined. @@ -561,7 +563,11 @@ class behat_navigation extends behat_base { * but with the advantage that you go straight to the desired page, without * having to wait for the Dashboard to load. * - * @When I am on the :page page logged in as :username + * @When /^I am on the (?[^ "]*) page logged in as (?[^ "]*)$/ + * @When /^I am on the "(?[^"]*)" page logged in as (?[^ "]*)$/ + * @When /^I am on the (?[^ "]*) page logged in as "(?[^ "]*)"$/ + * @When /^I am on the "(?[^"]*)" page logged in as "(?[^ "]*)"$/ + * * @param string $page the type of page. E.g. 'Admin notifications' or 'core_user > Preferences'. * @param string $username the name of the user to log in as. E.g. 'admin'. * @throws Exception if the specified page cannot be determined. @@ -622,7 +628,11 @@ class behat_navigation extends behat_base { * * For pages belonging to core, the 'core > ' bit is omitted. * - * @When I am on the :identifier :type page + * @When /^I am on the (?[^ "]*) (?[^ "]*) page$/ + * @When /^I am on the "(?[^"]*)" "(?[^"]*)" page$/ + * @When /^I am on the (?[^ "]*) "(?[^"]*)" page$/ + * @When /^I am on the "(?[^"]*)" (?[^ "]*) page$/ + * * @param string $identifier identifies the particular page. E.g. 'Test quiz'. * @param string $type the component and page type. E.g. 'mod_quiz > View'. * @throws Exception if the specified page cannot be determined. @@ -640,7 +650,15 @@ class behat_navigation extends behat_base { * but with the advantage that you go straight to the desired page, without * having to wait for the Dashboard to load. * - * @When I am on the :identifier :type page logged in as :username + * @When /^I am on the (?[^ "]*) (?[^ "]*) page logged in as (?[^ "]*)$/ + * @When /^I am on the "(?[^"]*)" "(?[^"]*)" page logged in as (?[^ "]*)$/ + * @When /^I am on the (?[^ "]*) "(?[^"]*)" page logged in as (?[^ "]*)$/ + * @When /^I am on the "(?[^"]*)" (?[^ "]*) page logged in as (?[^ "]*)$/ + * @When /^I am on the (?[^ "]*) (?[^ "]*) page logged in as "(?[^"]*)"$/ + * @When /^I am on the "(?[^"]*)" "(?[^"]*)" page logged in as "(?[^"]*)"$/ + * @When /^I am on the (?[^ "]*) "(?[^"]*)" page logged in as "(?[^"]*)"$/ + * @When /^I am on the "(?[^"]*)" (?[^ "]*) page logged in as "(?[^"]*)"$/ + * * @param string $identifier identifies the particular page. E.g. 'Test quiz'. * @param string $type the component and page type. E.g. 'mod_quiz > View'. * @param string $username the name of the user to log in as. E.g. 'student'.