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 14065843cbb..8bef7f9a775 100644 --- a/admin/tool/behat/tests/behat/i_am_on_page.feature +++ b/admin/tool/behat/tests/behat/i_am_on_page.feature @@ -22,6 +22,7 @@ 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 | @@ -31,6 +32,8 @@ Feature: Use core page resolvers for the I am on the page steps | Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum | | Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion | | Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum | + | Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun | + | Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun | Scenario Outline: When I am on an instance logged in as Given the following "categories" exist: @@ -49,7 +52,7 @@ Feature: Use core page resolvers for the I am on the page steps Then I should see "" 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 | @@ -59,6 +62,8 @@ Feature: Use core page resolvers for the I am on the page steps | Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum | | Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion | | Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum | + | Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun | + | Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun | Scenario Outline: When I am on a named page Given I log in as "admin" diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index bc41125ec47..053010c6b0e 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -777,12 +777,24 @@ class behat_navigation extends behat_base { $cm = $this->get_cm_by_activity_name($modname, $identifier); if (count($parts) == 2) { + // View page. return new moodle_url($cm->url); } if ($parts[2] === 'editing') { + // Edit settings page. return new moodle_url('/course/modedit.php', ['update' => $cm->id]); } + + if ($parts[2] === 'roles') { + // Locally assigned roles page. + return new moodle_url('/admin/roles/assign.php', ['contextid' => $cm->context->id]); + } + + if ($parts[2] === 'permissions') { + // Permissions page. + return new moodle_url('/admin/roles/permissions.php', ['contextid' => $cm->context->id]); + } } }