MDL-71915 question: Update the behat tests

Update the behat tests to accommodate the
changes made for the tertiary navigation.
This commit is contained in:
Sujith Haridasan 2021-08-10 10:59:39 +05:30
parent 26eabeccf4
commit f000755ba1
32 changed files with 96 additions and 51 deletions

View File

@ -27,7 +27,8 @@ 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 > Categories" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
And I set the following fields to these values:
| Name | New Category 1 |
| Parent category | Top |
@ -42,7 +43,8 @@ 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 navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
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:
@ -53,12 +55,14 @@ 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 navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
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 navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
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"

View File

@ -23,7 +23,8 @@ 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 > Categories" in current page administration
And I navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
And I set the following fields to these values:
| Name | Sub used category |
| Parent category | Used category |
@ -46,7 +47,8 @@ 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 > Categories" in current page administration
And I navigate to "Question bank" in current page administration
And I select "Categories" from the "questionbankactionselect" singleselect
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"

View File

@ -22,13 +22,11 @@ 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
And I navigate to "Question bank" in current page administration
Then I should not see "Categories"
Then "Categories" "link" should not exist in current page administration
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 I navigate to "Question bank" in current page administration
And I should see "Categories"
And "Categories" "link" should exist in current page administration
Scenario: Enable/disable the tab New category when tyring to add a random question to a quiz
Given I log in as "admin"

View File

@ -73,7 +73,8 @@ 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 > Questions" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Questions" from the "questionbankactionselect" singleselect
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"
@ -89,7 +90,8 @@ 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 > Questions" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Questions" from the "questionbankactionselect" singleselect
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"
@ -105,7 +107,10 @@ 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 > Questions" in current page administration
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"
@ -127,7 +132,8 @@ Feature: Show statistics in question bank
| 1 | True |
| 2 | False |
When I am on the "Course 1" course page logged in as admin
And I navigate to "Question bank > Questions" in current page administration
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"

View File

@ -25,7 +25,8 @@ Feature: Test exporting questions using Aiken format.
And I am on "Course 1" course homepage
Scenario: Aiken export
When I navigate to "Question bank > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing questions from Aiken format.
@javascript @_file_upload
Scenario: import some Aiken questions
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -19,7 +19,8 @@ Feature: Test importing questions from GIFT format.
@javascript @_file_upload
Scenario: import some GIFT questions
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"
@ -30,14 +31,17 @@ Feature: Test importing questions from GIFT format.
Then I should see "colours"
# Now export again.
And I follow "Export"
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 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -19,7 +19,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"
@ -32,7 +33,9 @@ Feature: Test importing questions from Moodle XML format.
Then I should see "Moodle acronym (True)"
# Now export again.
And I follow "Export"
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 set the field "id_format_xml" to "1"
And I set the field "Export category" to "TrueFalse"
And I press "Export questions to file"
@ -40,7 +43,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"
@ -52,7 +56,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"
@ -64,7 +69,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -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 click on "Preview quiz now" "button"
And I follow "Preview quiz"
And I should see "Write about whatever you want"
@javascript

View File

@ -26,7 +26,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -26,7 +26,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing drag and drop markers questions
@javascript @_file_upload
Scenario: import drag and drop markers question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -26,7 +26,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -24,7 +24,8 @@ Feature: Test exporting Description questions
And I am on "Course 1" course homepage
Scenario: Export a Description question
When I navigate to "Question bank > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing Description questions
@javascript @_file_upload
Scenario: import a Description question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -26,7 +26,8 @@ Feature: Test exporting Essay questions
And I am on "Course 1" course homepage
Scenario: Export 3 Essay questions
When I navigate to "Question bank > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -44,7 +44,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 press "Attempt quiz now"
And I follow "Attempt quiz"
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"
@ -62,7 +62,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 press "Attempt quiz now"
And I follow "Attempt quiz"
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"

View File

@ -19,7 +19,8 @@ Feature: Test importing Essay questions
@javascript @_file_upload
Scenario: import Essay question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -20,7 +20,8 @@ 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 > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"
@ -31,7 +32,9 @@ Feature: Import and export select missing words questions
And I should see "Imported Select missing words 001"
# Now export again.
When I follow "Export"
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 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

View File

@ -24,7 +24,8 @@ Feature: Test exporting Matching questions
And I am on "Course 1" course homepage
Scenario: Export a Matching question
When I navigate to "Question bank > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing Matching questions
@javascript @_file_upload
Scenario: import Matching question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -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 press "Attempt quiz now"
When I follow "Attempt quiz"
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 press "Attempt quiz now"
When I follow "Attempt quiz"
And I should see "Question One"
And I click on "Four" "qtype_multichoice > Answer" in the "Question One" "question"
And I follow "Finish attempt ..."

View File

@ -25,7 +25,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing Multiple choice questions
@javascript @_file_upload
Scenario: import Multiple choice question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -25,7 +25,8 @@ Feature: Test exporting Numerical questions
And I am on "Course 1" course homepage
Scenario: Export a Numerical question
When I navigate to "Question bank > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing Numerical questions
@javascript @_file_upload
Scenario: import Numerical question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -24,7 +24,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing Short answer questions
@javascript @_file_upload
Scenario: import Matching question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"

View File

@ -24,7 +24,8 @@ 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 > Export" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Export" from the "questionbankactionselect" singleselect
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

View File

@ -19,7 +19,8 @@ Feature: Test importing True/False questions
@javascript @_file_upload
Scenario: import a True/False question.
When I navigate to "Question bank > Import" in current page administration
When I navigate to "Question bank" in current page administration
And I select "Import" from the "questionbankactionselect" singleselect
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"