Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
f14dbe00
Commit
f14dbe00
authored
Jul 23, 2021
by
Andrew Nicols
Browse files
MDL-72179 behat: Add page resolvers for activity roles/perms
parent
950c7adb
Changes
2
Hide whitespace changes
Inline
Side-by-side
admin/tool/behat/tests/behat/i_am_on_page.feature
View file @
f14dbe00
...
...
@@ -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"
...
...
lib/tests/behat/behat_navigation.php
View file @
f14dbe00
...
...
@@ -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
]);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment