From 9fbbdc8a0a59beaf92abe644736ff20d2563a925 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Fri, 29 Jul 2022 10:33:59 +0800 Subject: [PATCH] MDL-74211 behat: replace steps to use new categories page type --- question/tests/behat/behat_core_question.php | 2 +- .../tests/behat/move_question_categories.feature | 8 ++++---- question/tests/behat/question_categories.feature | 12 +++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/question/tests/behat/behat_core_question.php b/question/tests/behat/behat_core_question.php index 104fd97eae5..ca642df37fa 100644 --- a/question/tests/behat/behat_core_question.php +++ b/question/tests/behat/behat_core_question.php @@ -72,7 +72,7 @@ class behat_core_question extends behat_question_base { ['courseid' => $this->get_course_id($identifier)]); case 'course question categories': - return new moodle_url('/question/bank/managecategories/category.php', + return new moodle_url('/question/category.php', ['courseid' => $this->get_course_id($identifier)]); case 'course question import': diff --git a/question/tests/behat/move_question_categories.feature b/question/tests/behat/move_question_categories.feature index d34e9797fd3..914d353459f 100644 --- a/question/tests/behat/move_question_categories.feature +++ b/question/tests/behat/move_question_categories.feature @@ -21,8 +21,8 @@ Feature: A teacher can move question categories in the question bank And I am on "Course 1" course homepage Scenario: A question category can be moved to another context - When I follow "Test quiz" - And I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page + And I follow "Add category" And I set the following fields to these values: | Name | Test category | | Parent category | Top for Test quiz | @@ -31,8 +31,8 @@ Feature: A teacher can move question categories in the question bank Then I should see "Test category" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' questioncategories ') and contains(concat(' ', normalize-space(@class), ' '), ' contextlevel50 ')]" "xpath_element" Scenario: A question category can be moved to top level - When I follow "Test quiz" - And I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page + And I follow "Add category" And I set the following fields to these values: | Name | Test category | | Parent category | Default for Test quiz | diff --git a/question/tests/behat/question_categories.feature b/question/tests/behat/question_categories.feature index cb792938fb1..5606377bda8 100644 --- a/question/tests/behat/question_categories.feature +++ b/question/tests/behat/question_categories.feature @@ -24,10 +24,9 @@ Feature: A teacher can put questions in categories in the question bank | questioncategory | qtype | name | questiontext | | Used category | essay | Test question to be moved | Write about whatever you want | And I log in as "teacher1" - And I am on "Course 1" course homepage Scenario: A new question category can be created - When I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page And I set the following fields to these values: | Name | New Category 1 | | Parent category | Top | @@ -39,7 +38,7 @@ Feature: A teacher can put questions in categories in the question bank And "New Category 1 [newcatidnumber]" "option" should exist in the "Parent category" "select" Scenario: A question category can be edited - When I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page And I click on "Edit this category" "link" in the "Subcategory" "list_item" And the field "parent" matches value "   Default for C1" And I set the following fields to these values: @@ -50,12 +49,12 @@ Feature: A teacher can put questions in categories in the question bank And I should see "I was edited" in the "New name" "list_item" Scenario: An empty question category can be deleted - When I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page And I click on "Delete" "link" in the "Subcategory" "list_item" Then I should not see "Subcategory" Scenario: An non-empty question category can be deleted if you move the contents elsewhere - When I navigate to "Question bank > Categories" in current page administration + When I am on the "Course 1" "core_question > course question categories" page And I click on "Delete" "link" in the "Used category" "list_item" And I should see "The category 'Used category' contains 1 questions" And I press "Save in category" @@ -94,8 +93,7 @@ Feature: A teacher can put questions in categories in the question bank And I upload "question/format/xml/tests/fixtures/multianswer.xml" file to "Import" filemanager And I press "id_submitbutton" And I press "Continue" - And I am on "Course 1" course homepage - And I navigate to "Question bank > Categories" in current page administration + And I am on the "Course 1" "core_question > course question categories" page And I click on "Delete" "link" in the "Default for Test images in backup" "list_item" And I should see "The category 'Default for Test images in backup' contains 1 questions" And I select "Used category" from the "Category" singleselect