Skip to content

Commit

Permalink
Revert "MDL-71915 question: Update the behat tests"
Browse files Browse the repository at this point in the history
This reverts commit f000755.
  • Loading branch information
sharidas authored and timhunt committed Feb 15, 2022
1 parent 73aeaba commit c4e411e
Show file tree
Hide file tree
Showing 32 changed files with 63 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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:
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
38 changes: 16 additions & 22 deletions question/bank/statistics/tests/behat/statistics_values.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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"
3 changes: 1 addition & 2 deletions question/format/aiken/tests/behat/aiken_export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/format/aiken/tests/behat/aiken_import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 3 additions & 7 deletions question/format/gift/tests/behat/import_export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
16 changes: 5 additions & 11 deletions question/format/xml/tests/behat/import_export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -33,18 +32,15 @@ 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"
And following "click here" should download between "57100" and "58150" bytes

@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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion question/tests/behat/delete_questions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddimageortext/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddimageortext/tests/behat/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddmarker/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddmarker/tests/behat/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddwtos/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/type/ddwtos/tests/behat/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions question/type/description/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions question/type/description/tests/behat/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions question/type/essay/tests/behat/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit c4e411e

Please sign in to comment.