Merge branch 'MDL-83331_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE

This commit is contained in:
Huong Nguyen
2024-10-09 14:47:46 +07:00
2 changed files with 14 additions and 1 deletions
+10 -1
View File
@@ -887,10 +887,12 @@ class behat_navigation extends behat_base {
return new moodle_url('/enrol/otherusers.php', ['id' => $courseid]);
}
// This next section handles page types starting with an activity name. For example:
// "forum activity" or "quiz activity editing".
$parts = explode(' ', $type);
if (count($parts) > 1) {
$modname = $parts[0];
if ($parts[1] === 'activity') {
$modname = $parts[0];
$cm = $this->get_cm_by_activity_name($modname, $identifier);
if (count($parts) == 2) {
@@ -912,6 +914,13 @@ class behat_navigation extends behat_base {
// Permissions page.
return new moodle_url('/admin/roles/permissions.php', ['contextid' => $cm->context->id]);
}
} else if ($parts[1] === 'index' && count($parts) == 2) {
$courseid = $this->get_course_id($identifier);
if (!$courseid) {
throw $coursenotfoundexception;
}
return new moodle_url("/mod/$modname/index.php", ['id' => $courseid]);
}
}
+4
View File
@@ -43,6 +43,10 @@ Feature: Add forum activities and discussions
And I follow "Edit"
And the field "Attachment" matches value "empty.txt"
# Check the page that lists all the forums in a course.
And I am on the "C1" "forum index" page
And I should see "Test forum name"
@javascript
Scenario: Test forum settings validation
Given the following "courses" exist: