Commit f14dbe00 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

MDL-72179 behat: Add page resolvers for activity roles/perms

parent 950c7adb
......@@ -22,6 +22,7 @@ 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 |
......@@ -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 "<shouldsee>"
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"
......
......@@ -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]);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment