From 4110054b51ed36ca947f4d90458502994229f039 Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Mon, 11 Apr 2022 12:36:38 +0200 Subject: [PATCH 1/2] MDL-74475 behat: Option to jump to course edit page --- lib/tests/behat/behat_navigation.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/tests/behat/behat_navigation.php b/lib/tests/behat/behat_navigation.php index 714c4f0c489..71e157726fe 100644 --- a/lib/tests/behat/behat_navigation.php +++ b/lib/tests/behat/behat_navigation.php @@ -718,6 +718,7 @@ class behat_navigation extends behat_base { * | Page type | Identifier meaning | description | * | Category | category idnumber | List of courses in that category. | * | Course | course shortname | Main course home pag | + * | Course editing | course shortname | Edit settings page for the course | * | Activity | activity idnumber | Start page for that activity | * | Activity editing | activity idnumber | Edit settings page for that activity | * | [modname] Activity | activity name or idnumber | Start page for that activity | @@ -745,6 +746,14 @@ class behat_navigation extends behat_base { } return new moodle_url('/course/index.php', ['categoryid' => $categoryid]); + case 'course editing': + $courseid = $this->get_course_id($identifier); + if (!$courseid) { + throw new Exception('The specified course with shortname, fullname, or idnumber "' . + $identifier . '" does not exist'); + } + return new moodle_url('/course/edit.php', ['id' => $courseid]); + case 'course': $courseid = $this->get_course_id($identifier); if (!$courseid) { From 9d4fb0a3ad6d0c57e054ddb01d258fcf4c327260 Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Mon, 4 Jul 2022 12:49:21 +0200 Subject: [PATCH 2/2] MDL-74475 core_badges: Behat test using new step --- badges/tests/behat/award_badge_groups.feature | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/badges/tests/behat/award_badge_groups.feature b/badges/tests/behat/award_badge_groups.feature index 76b29b689e3..21b159aa68e 100644 --- a/badges/tests/behat/award_badge_groups.feature +++ b/badges/tests/behat/award_badge_groups.feature @@ -30,9 +30,7 @@ Feature: Award badges with separate groups | teacher1 | CB | | student2 | CA | | teacher2 | CA | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I navigate to "Edit settings" in current page administration + And I am on the "Course 1" "course editing" page logged in as "teacher1" And I expand all fieldsets And I set the field "Group mode" to "Separate groups" And I press "Save and display"