From c4e411e48ba99747bb3ef15c7e38ee2f253e0ad0 Mon Sep 17 00:00:00 2001 From: Sujith Haridasan Date: Sun, 9 Jan 2022 14:15:53 +0530 Subject: [PATCH] Revert "MDL-71915 question: Update the behat tests" This reverts commit f000755ba1f4357f1a4e697e7e72dcb752f1ce07. --- .../tests/behat/question_categories.feature | 12 ++---- .../question_categories_idnumber.feature | 6 +-- .../view_manage_categories_plugin.feature | 6 ++- .../tests/behat/statistics_values.feature | 38 ++++++++----------- .../aiken/tests/behat/aiken_export.feature | 3 +- .../aiken/tests/behat/aiken_import.feature | 3 +- .../gift/tests/behat/import_export.feature | 10 ++--- .../xml/tests/behat/import_export.feature | 16 +++----- question/tests/behat/delete_questions.feature | 2 +- .../ddimageortext/tests/behat/export.feature | 3 +- .../ddimageortext/tests/behat/import.feature | 3 +- .../type/ddmarker/tests/behat/export.feature | 3 +- .../type/ddmarker/tests/behat/import.feature | 3 +- .../type/ddwtos/tests/behat/export.feature | 3 +- .../type/ddwtos/tests/behat/import.feature | 3 +- .../description/tests/behat/export.feature | 3 +- .../description/tests/behat/import.feature | 3 +- .../type/essay/tests/behat/export.feature | 3 +- .../tests/behat/file_type_restriction.feature | 4 +- .../type/essay/tests/behat/import.feature | 3 +- .../gapselect/tests/behat/import_test.feature | 7 +--- .../type/match/tests/behat/export.feature | 3 +- .../type/match/tests/behat/import.feature | 3 +- .../tests/behat/clearanswers.feature | 4 +- .../multichoice/tests/behat/export.feature | 3 +- .../multichoice/tests/behat/import.feature | 3 +- .../type/numerical/tests/behat/export.feature | 3 +- .../type/numerical/tests/behat/import.feature | 3 +- .../shortanswer/tests/behat/export.feature | 3 +- .../shortanswer/tests/behat/import.feature | 3 +- .../type/truefalse/tests/behat/export.feature | 3 +- .../type/truefalse/tests/behat/import.feature | 3 +- 32 files changed, 63 insertions(+), 108 deletions(-) diff --git a/question/bank/managecategories/tests/behat/question_categories.feature b/question/bank/managecategories/tests/behat/question_categories.feature index 9e4263cecb5..70b4b936457 100644 --- a/question/bank/managecategories/tests/behat/question_categories.feature +++ b/question/bank/managecategories/tests/behat/question_categories.feature @@ -27,8 +27,7 @@ Feature: A teacher can put questions in categories in the question bank And I am on "Course 1" course homepage Scenario: A new question category can be created - When I navigate to "Question bank" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Categories" in current page administration And I set the following fields to these values: | Name | New Category 1 | | Parent category | Top | @@ -43,8 +42,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" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Categories" in current page administration 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: @@ -55,14 +53,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" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Categories" in current page administration 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" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Categories" in current page administration 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" diff --git a/question/bank/managecategories/tests/behat/question_categories_idnumber.feature b/question/bank/managecategories/tests/behat/question_categories_idnumber.feature index c81e95d0f1b..95226aa5046 100644 --- a/question/bank/managecategories/tests/behat/question_categories_idnumber.feature +++ b/question/bank/managecategories/tests/behat/question_categories_idnumber.feature @@ -23,8 +23,7 @@ Feature: A teacher can put questions with idnumbers in categories with idnumbers | contextlevel | reference | questioncategory | name | idnumber | | Course | C1 | Top | top | | | Course | C1 | top | Used category | c1used | - And I navigate to "Question bank" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + And I navigate to "Question bank > Categories" in current page administration And I set the following fields to these values: | Name | Sub used category | | Parent category | Used category | @@ -47,8 +46,7 @@ Feature: A teacher can put questions with idnumbers in categories with idnumbers | contextlevel | reference | questioncategory | name | idnumber | | Course | C1 | Top | top | | | Course | C1 | top | Used category | c1used | - And I navigate to "Question bank" in current page administration - And I select "Categories" from the "questionbankactionselect" singleselect + And I navigate to "Question bank > Categories" in current page administration And I click on "Edit this category" "link" in the "Used category" "list_item" And I press "Save changes" Then I should not see "This ID number is already in use" diff --git a/question/bank/managecategories/tests/behat/view_manage_categories_plugin.feature b/question/bank/managecategories/tests/behat/view_manage_categories_plugin.feature index 18a1150bb35..b74387bdc53 100644 --- a/question/bank/managecategories/tests/behat/view_manage_categories_plugin.feature +++ b/question/bank/managecategories/tests/behat/view_manage_categories_plugin.feature @@ -22,11 +22,13 @@ Feature: Use the qbank plugin manager page for managecategories And I should see "Manage categories" And I click on "Disable" "link" in the "Manage categories" "table_row" And I am on the "Test quiz" "quiz activity" page - Then "Categories" "link" should not exist in current page administration + And I navigate to "Question bank" in current page administration + Then I should not see "Categories" And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration And I click on "Enable" "link" in the "Manage categories" "table_row" And I am on the "Test quiz" "quiz activity" page - And "Categories" "link" should exist in current page administration + And I navigate to "Question bank" in current page administration + And I should see "Categories" Scenario: Enable/disable the tab New category when tyring to add a random question to a quiz Given I log in as "admin" diff --git a/question/bank/statistics/tests/behat/statistics_values.feature b/question/bank/statistics/tests/behat/statistics_values.feature index 35ee73a47a2..26015d44e48 100644 --- a/question/bank/statistics/tests/behat/statistics_values.feature +++ b/question/bank/statistics/tests/behat/statistics_values.feature @@ -73,8 +73,7 @@ Feature: Show statistics in question bank | 1 | True | | 2 | True | When I am on the "Course 1" course page logged in as admin - When I navigate to "Question bank" in current page administration - And I select "Questions" from the "questionbankactionselect" singleselect + And I navigate to "Question bank > Questions" in current page administration And I should see "50.00%" in the "TF1" "table_row" And I should see "75.00%" in the "TF2" "table_row" And I should see "75.00%" in the "TF3" "table_row" @@ -90,8 +89,7 @@ Feature: Show statistics in question bank | 1 | True | | 2 | True | When I am on the "Course 1" course page logged in as admin - When I navigate to "Question bank" in current page administration - And I select "Questions" from the "questionbankactionselect" singleselect + And I navigate to "Question bank > Questions" in current page administration And I should see "50.00%" in the "TF1" "table_row" And I should see "75.00%" in the "TF2" "table_row" And I should see "75.00%" in the "TF3" "table_row" @@ -107,16 +105,13 @@ Feature: Show statistics in question bank | 1 | True | | 2 | True | When I am on the "Course 1" course page logged in as admin - And I navigate to "Question bank" in current page administration - And I select "Questions" from the "questionbankactionselect" singleselect - When I navigate to "Question bank" in current page administration - And I select "Questions" from the "questionbankactionselect" singleselect - And I should see "Likely" in the "TF1" "table_row" - And I should see "Unlikely" in the "TF2" "table_row" - And I should see "Unlikely" in the "TF3" "table_row" - And I should see "Likely" in the "TF4" "table_row" - And I should see "Likely" in the ".alert-warning" "css_element" - And I should see "Unlikely" in the ".alert-success" "css_element" + And I navigate to "Question bank > Questions" in current page administration + And I should see "likely" in the "TF1" "table_row" + And I should see "unlikely" in the "TF2" "table_row" + And I should see "unlikely" in the "TF3" "table_row" + And I should see "likely" in the "TF4" "table_row" + And I should see "likely" in the ".alert-warning" "css_element" + And I should see "unlikely" in the ".alert-success" "css_element" Scenario: View discrimination index in question bank, bad questions Given user "student1" has attempted "Quiz 2" with responses: @@ -132,11 +127,10 @@ Feature: Show statistics in question bank | 1 | True | | 2 | False | When I am on the "Course 1" course page logged in as admin - When I navigate to "Question bank" in current page administration - And I select "Questions" from the "questionbankactionselect" singleselect - And I should see "Likely" in the "TF1" "table_row" - And I should see "Very likely" in the "TF2" "table_row" - And I should see "Very likely" in the "TF3" "table_row" - And I should see "Likely" in the "TF4" "table_row" - And I should see "Very likely" in the ".alert-danger" "css_element" - And I should see "Likely" in the ".alert-warning" "css_element" + And I navigate to "Question bank > Questions" in current page administration + And I should see "likely" in the "TF1" "table_row" + And I should see "very likely" in the "TF2" "table_row" + And I should see "very likely" in the "TF3" "table_row" + And I should see "likely" in the "TF4" "table_row" + And I should see "very likely" in the ".alert-danger" "css_element" + And I should see "likely" in the ".alert-warning" "css_element" diff --git a/question/format/aiken/tests/behat/aiken_export.feature b/question/format/aiken/tests/behat/aiken_export.feature index 9f937a7c22d..13bddf67dea 100644 --- a/question/format/aiken/tests/behat/aiken_export.feature +++ b/question/format/aiken/tests/behat/aiken_export.feature @@ -25,8 +25,7 @@ Feature: Test exporting questions using Aiken format. And I am on "Course 1" course homepage Scenario: Aiken export - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_aiken" to "1" When I press "Export questions to file" Then following "click here" should download between "68" and "70" bytes diff --git a/question/format/aiken/tests/behat/aiken_import.feature b/question/format/aiken/tests/behat/aiken_import.feature index 807e7f80f02..520b2ef2259 100644 --- a/question/format/aiken/tests/behat/aiken_import.feature +++ b/question/format/aiken/tests/behat/aiken_import.feature @@ -19,8 +19,7 @@ Feature: Test importing questions from Aiken format. @javascript @_file_upload Scenario: import some Aiken questions - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_aiken" to "1" And I upload "question/format/aiken/tests/fixtures/questions.aiken.txt" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/format/gift/tests/behat/import_export.feature b/question/format/gift/tests/behat/import_export.feature index e398594c95f..48f0227321f 100644 --- a/question/format/gift/tests/behat/import_export.feature +++ b/question/format/gift/tests/behat/import_export.feature @@ -19,8 +19,7 @@ Feature: Test importing questions from GIFT format. @javascript @_file_upload Scenario: import some GIFT questions - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_gift" to "1" And I upload "question/format/gift/tests/fixtures/questions.gift.txt" file to "Import" filemanager And I press "id_submitbutton" @@ -31,17 +30,14 @@ Feature: Test importing questions from GIFT format. Then I should see "colours" # Now export again. - And I am on "Course 1" course homepage - And I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + And I follow "Export" And I set the field "id_format_gift" to "1" And I press "Export questions to file" And following "click here" should download between "1500" and "1800" bytes @javascript @_file_upload Scenario: import a GIFT file which specifies the category - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_gift" to "1" And I upload "question/format/gift/tests/fixtures/questions_in_category.gift.txt" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/format/xml/tests/behat/import_export.feature b/question/format/xml/tests/behat/import_export.feature index 48e2cca5e77..0be26d71ddc 100644 --- a/question/format/xml/tests/behat/import_export.feature +++ b/question/format/xml/tests/behat/import_export.feature @@ -19,8 +19,7 @@ Feature: Test importing questions from Moodle XML format. @javascript @_file_upload Scenario: import some true/false questions from Moodle XML format - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/format/xml/tests/fixtures/truefalse.xml" file to "Import" filemanager And I press "id_submitbutton" @@ -33,9 +32,7 @@ Feature: Test importing questions from Moodle XML format. Then I should see "Moodle acronym (True)" # Now export again. - And I am on "Course 1" course homepage - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + And I follow "Export" And I set the field "id_format_xml" to "1" And I set the field "Export category" to "TrueFalse" And I press "Export questions to file" @@ -43,8 +40,7 @@ Feature: Test importing questions from Moodle XML format. @javascript @_file_upload Scenario: import some multiple choice questions from Moodle XML format - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/format/xml/tests/fixtures/multichoice.xml" file to "Import" filemanager And I press "id_submitbutton" @@ -56,8 +52,7 @@ Feature: Test importing questions from Moodle XML format. @javascript @_file_upload Scenario: import some multi-answer questions from Moodle XML format - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/format/xml/tests/fixtures/multianswer.xml" file to "Import" filemanager And I press "id_submitbutton" @@ -69,8 +64,7 @@ Feature: Test importing questions from Moodle XML format. @javascript @_file_upload Scenario: import some questions with legacy-style images from Moodle XML format - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/format/xml/tests/fixtures/sample_questions_with_old_image_tag.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/tests/behat/delete_questions.feature b/question/tests/behat/delete_questions.feature index d61054c90c3..428ee233493 100644 --- a/question/tests/behat/delete_questions.feature +++ b/question/tests/behat/delete_questions.feature @@ -60,7 +60,7 @@ Feature: A teacher can delete questions in the question bank And I click on "Also show old questions" "checkbox" And I should see "Test used question to be deleted" And I am on the "Test quiz" "quiz activity" page - And I follow "Preview quiz" + And I click on "Preview quiz now" "button" And I should see "Write about whatever you want" @javascript diff --git a/question/type/ddimageortext/tests/behat/export.feature b/question/type/ddimageortext/tests/behat/export.feature index 62265d391ab..61f582f1a5e 100644 --- a/question/type/ddimageortext/tests/behat/export.feature +++ b/question/type/ddimageortext/tests/behat/export.feature @@ -26,8 +26,7 @@ Feature: Test exporting drag and drop onto image questions @javascript Scenario: Export a drag and drop onto image question # Import sample file. - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" And following "click here" should download between "18600" and "19150" bytes diff --git a/question/type/ddimageortext/tests/behat/import.feature b/question/type/ddimageortext/tests/behat/import.feature index d10b432d9a9..65c64db824f 100644 --- a/question/type/ddimageortext/tests/behat/import.feature +++ b/question/type/ddimageortext/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing drag and drop onto image questions @javascript @_file_upload Scenario: import drag and drop onto image question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/ddimageortext/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/ddmarker/tests/behat/export.feature b/question/type/ddmarker/tests/behat/export.feature index 8b196229822..80928780368 100644 --- a/question/type/ddmarker/tests/behat/export.feature +++ b/question/type/ddmarker/tests/behat/export.feature @@ -26,8 +26,7 @@ Feature: Test exporting drag and drop markers questions @javascript Scenario: Export a drag and drop markers question # Import sample file. - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" And following "click here" should download between "233700" and "233950" bytes diff --git a/question/type/ddmarker/tests/behat/import.feature b/question/type/ddmarker/tests/behat/import.feature index ba32882d9d0..38ddf880fa4 100644 --- a/question/type/ddmarker/tests/behat/import.feature +++ b/question/type/ddmarker/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing drag and drop markers questions @javascript @_file_upload Scenario: import drag and drop markers question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/ddmarker/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/ddwtos/tests/behat/export.feature b/question/type/ddwtos/tests/behat/export.feature index ae6151892db..03729a1c9eb 100644 --- a/question/type/ddwtos/tests/behat/export.feature +++ b/question/type/ddwtos/tests/behat/export.feature @@ -26,8 +26,7 @@ Feature: Test exporting drag and drop into text questions @javascript Scenario: Export a drag and drop into text question # Import sample file. - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" And following "click here" should download between "1550" and "1700" bytes diff --git a/question/type/ddwtos/tests/behat/import.feature b/question/type/ddwtos/tests/behat/import.feature index 2659d869cf9..9785350456d 100644 --- a/question/type/ddwtos/tests/behat/import.feature +++ b/question/type/ddwtos/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing drag and drop into text questions @javascript @_file_upload Scenario: import drag and drop into text question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/ddwtos/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/description/tests/behat/export.feature b/question/type/description/tests/behat/export.feature index 91c300fda38..a630926060c 100644 --- a/question/type/description/tests/behat/export.feature +++ b/question/type/description/tests/behat/export.feature @@ -24,8 +24,7 @@ Feature: Test exporting Description questions And I am on "Course 1" course homepage Scenario: Export a Description question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "650" and "900" bytes diff --git a/question/type/description/tests/behat/import.feature b/question/type/description/tests/behat/import.feature index 3b7cf52f85d..53bdb1964ea 100644 --- a/question/type/description/tests/behat/import.feature +++ b/question/type/description/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Description questions @javascript @_file_upload Scenario: import a Description question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/description/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/essay/tests/behat/export.feature b/question/type/essay/tests/behat/export.feature index a3b7aa59188..deef3d77558 100644 --- a/question/type/essay/tests/behat/export.feature +++ b/question/type/essay/tests/behat/export.feature @@ -26,8 +26,7 @@ Feature: Test exporting Essay questions And I am on "Course 1" course homepage Scenario: Export 3 Essay questions - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "3000" and "3500" bytes diff --git a/question/type/essay/tests/behat/file_type_restriction.feature b/question/type/essay/tests/behat/file_type_restriction.feature index fe7983fe796..d44c89ea983 100644 --- a/question/type/essay/tests/behat/file_type_restriction.feature +++ b/question/type/essay/tests/behat/file_type_restriction.feature @@ -46,7 +46,7 @@ I need to limit the submittable file types And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I press "Save changes" And I am on the "Quiz 1" "quiz activity" page - And I follow "Attempt quiz" + And I press "Attempt quiz now" And I should see "First question" And I should see "You can drag and drop files here to add them." And I click on "Add..." "button" @@ -64,7 +64,7 @@ I need to limit the submittable file types And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager And I press "Save changes" And I am on the "Quiz 1" "quiz activity" page - And I follow "Attempt quiz" + And I press "Attempt quiz now" And I should see "First question" And I should see "You can drag and drop files here to add them." And I click on "Add..." "button" diff --git a/question/type/essay/tests/behat/import.feature b/question/type/essay/tests/behat/import.feature index e756b8f6eb1..e365569e370 100644 --- a/question/type/essay/tests/behat/import.feature +++ b/question/type/essay/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Essay questions @javascript @_file_upload Scenario: import Essay question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/essay/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/gapselect/tests/behat/import_test.feature b/question/type/gapselect/tests/behat/import_test.feature index 24cb258f747..a7d5018de8e 100644 --- a/question/type/gapselect/tests/behat/import_test.feature +++ b/question/type/gapselect/tests/behat/import_test.feature @@ -20,8 +20,7 @@ Feature: Import and export select missing words questions @javascript @_file_upload Scenario: Import and export select missing words questions # Import sample file. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/gapselect/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" @@ -32,9 +31,7 @@ Feature: Import and export select missing words questions And I should see "Imported Select missing words 001" # Now export again. - And I am on "Course 1" course homepage - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I follow "Export" And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "1650" and "1800" bytes diff --git a/question/type/match/tests/behat/export.feature b/question/type/match/tests/behat/export.feature index 0df927c1ca2..4b1b08db9ae 100644 --- a/question/type/match/tests/behat/export.feature +++ b/question/type/match/tests/behat/export.feature @@ -24,8 +24,7 @@ Feature: Test exporting Matching questions And I am on "Course 1" course homepage Scenario: Export a Matching question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "1600" and "1750" bytes diff --git a/question/type/match/tests/behat/import.feature b/question/type/match/tests/behat/import.feature index a7511298eec..99308528b2e 100644 --- a/question/type/match/tests/behat/import.feature +++ b/question/type/match/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Matching questions @javascript @_file_upload Scenario: import Matching question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/match/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/multichoice/tests/behat/clearanswers.feature b/question/type/multichoice/tests/behat/clearanswers.feature index fe9548a259b..95c7c5d27df 100644 --- a/question/type/multichoice/tests/behat/clearanswers.feature +++ b/question/type/multichoice/tests/behat/clearanswers.feature @@ -40,7 +40,7 @@ Feature: Clear my answers @javascript Scenario: Attempt a quiz and reset my chosen answer. Given I am on the "Quiz 1" "quiz activity" page logged in as student1 - When I follow "Attempt quiz" + When I press "Attempt quiz now" And I should see "Question One" And I click on "Four" "qtype_multichoice > Answer" in the "Question One" "question" And I should see "Clear my choice" @@ -52,7 +52,7 @@ Feature: Clear my answers @javascript Scenario: Attempt a quiz and revisit a cleared answer. Given I am on the "Quiz 1" "quiz activity" page logged in as student1 - When I follow "Attempt quiz" + When I press "Attempt quiz now" And I should see "Question One" And I click on "Four" "qtype_multichoice > Answer" in the "Question One" "question" And I follow "Finish attempt ..." diff --git a/question/type/multichoice/tests/behat/export.feature b/question/type/multichoice/tests/behat/export.feature index 1d4c8a22763..27fd30eb613 100644 --- a/question/type/multichoice/tests/behat/export.feature +++ b/question/type/multichoice/tests/behat/export.feature @@ -25,8 +25,7 @@ Feature: Test exporting Multiple choice questions And I am on "Course 1" course homepage Scenario: Export a Multiple choice question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "3900" and "4100" bytes diff --git a/question/type/multichoice/tests/behat/import.feature b/question/type/multichoice/tests/behat/import.feature index 79e7dc9abc7..53744321b2e 100644 --- a/question/type/multichoice/tests/behat/import.feature +++ b/question/type/multichoice/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Multiple choice questions @javascript @_file_upload Scenario: import Multiple choice question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/multichoice/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/numerical/tests/behat/export.feature b/question/type/numerical/tests/behat/export.feature index d77074457da..7d3f920819c 100644 --- a/question/type/numerical/tests/behat/export.feature +++ b/question/type/numerical/tests/behat/export.feature @@ -25,8 +25,7 @@ Feature: Test exporting Numerical questions And I am on "Course 1" course homepage Scenario: Export a Numerical question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "3650" and "3750" bytes diff --git a/question/type/numerical/tests/behat/import.feature b/question/type/numerical/tests/behat/import.feature index b7026ea5748..6995a63dc0f 100644 --- a/question/type/numerical/tests/behat/import.feature +++ b/question/type/numerical/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Numerical questions @javascript @_file_upload Scenario: import Numerical question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/numerical/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/shortanswer/tests/behat/export.feature b/question/type/shortanswer/tests/behat/export.feature index d83243fecb1..e80449a994c 100644 --- a/question/type/shortanswer/tests/behat/export.feature +++ b/question/type/shortanswer/tests/behat/export.feature @@ -24,8 +24,7 @@ Feature: Test exporting Short answer questions And I am on "Course 1" course homepage Scenario: Export a Short answer question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "1200" and "1450" bytes diff --git a/question/type/shortanswer/tests/behat/import.feature b/question/type/shortanswer/tests/behat/import.feature index a8df6faea91..48908094429 100644 --- a/question/type/shortanswer/tests/behat/import.feature +++ b/question/type/shortanswer/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing Short answer questions @javascript @_file_upload Scenario: import Matching question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/shortanswer/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton" diff --git a/question/type/truefalse/tests/behat/export.feature b/question/type/truefalse/tests/behat/export.feature index 81b9de39ade..1f0f4ad9c66 100644 --- a/question/type/truefalse/tests/behat/export.feature +++ b/question/type/truefalse/tests/behat/export.feature @@ -24,8 +24,7 @@ Feature: Test exporting True/False questions And I am on "Course 1" course homepage Scenario: Export a True/False question - When I navigate to "Question bank" in current page administration - And I select "Export" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Export" in current page administration And I set the field "id_format_xml" to "1" And I press "Export questions to file" Then following "click here" should download between "1000" and "1200" bytes diff --git a/question/type/truefalse/tests/behat/import.feature b/question/type/truefalse/tests/behat/import.feature index 4bf13dceb86..7a3bd4c1174 100644 --- a/question/type/truefalse/tests/behat/import.feature +++ b/question/type/truefalse/tests/behat/import.feature @@ -19,8 +19,7 @@ Feature: Test importing True/False questions @javascript @_file_upload Scenario: import a True/False question. - When I navigate to "Question bank" in current page administration - And I select "Import" from the "questionbankactionselect" singleselect + When I navigate to "Question bank > Import" in current page administration And I set the field "id_format_xml" to "1" And I upload "question/type/truefalse/tests/fixtures/testquestion.moodle.xml" file to "Import" filemanager And I press "id_submitbutton"