Revert "MDL-71915 mod_quiz: Update the behat tests"

This reverts commit 1149f255fe.
This commit is contained in:
Sujith Haridasan
2022-02-15 15:58:36 +00:00
committed by Tim Hunt
parent 24950e283c
commit 299504281e
15 changed files with 71 additions and 55 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ Feature: Add a quiz
And I log out
And I am on the "Test quiz name" "quiz activity" page logged in as student1
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "Question 1"
And I should see "Answer the first question"
And I set the field "True" to "1"
+3 -3
View File
@@ -45,7 +45,7 @@ Feature: Attempt a quiz
And I should see "Grade"
And I should see "25.00 out of 100.00"
And I follow "Finish review"
And I follow "Attempt quiz"
And I press "Re-attempt quiz"
@javascript
Scenario: Attempt a quiz with mulitple sections
@@ -73,7 +73,7 @@ Feature: Attempt a quiz
| Section 3 | 5 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "Section 1" in the "Quiz navigation" "block"
And I should see question "1" in section "Section 1" in the quiz navigation
@@ -125,7 +125,7 @@ Feature: Attempt a quiz
| TF1 | 1 |
| TF2 | 2 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "Text of the first question"
And I should not see "Text of the second question"
And I press "Next page"
+13 -13
View File
@@ -30,7 +30,7 @@ Feature: The various checks that may happen when an attept is started
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "Text of the first question"
@javascript
@@ -42,11 +42,11 @@ Feature: The various checks that may happen when an attept is started
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
Then I should see "To attempt this quiz you need to know the quiz password" in the "region-main" "region"
And I should see "Your attempt will have a time limit of 1 hour. When you " in the "region-main" "region"
And I press "Attempt quiz now"
Then I should see "To attempt this quiz you need to know the quiz password" in the "Start attempt" "dialogue"
And I should see "Your attempt will have a time limit of 1 hour. When you " in the "Start attempt" "dialogue"
And I set the field "Quiz password" to "Frog"
And I click on "Start attempt" "button" in the "region-main" "region"
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
And I should see "Text of the first question"
@javascript
@@ -58,10 +58,10 @@ Feature: The various checks that may happen when an attept is started
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I click on "Cancel" "button" in the "region-main" "region"
And I press "Attempt quiz now"
And I click on "Cancel" "button" in the "Start attempt" "dialogue"
Then I should see "Quiz 1 description"
And "Attempt quiz" "link" should be visible
And "Attempt quiz now" "button" should be visible
@javascript
Scenario: Start a quiz with time limit and password, get the password wrong first time
@@ -72,9 +72,9 @@ Feature: The various checks that may happen when an attept is started
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I set the field "Quiz password" to "Toad"
And I click on "Start attempt" "button" in the "region-main" "region"
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
Then I should see "Quiz 1 description"
And I should see "To attempt this quiz you need to know the quiz password"
And I should see "Your attempt will have a time limit of 1 hour. When you "
@@ -94,9 +94,9 @@ Feature: The various checks that may happen when an attept is started
| question | page |
| TF1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I set the field "Quiz password" to "Toad"
And I click on "Start attempt" "button" in the "region-main" "region"
And I click on "Start attempt" "button" in the "Start attempt" "dialogue"
And I should see "Quiz 1 description"
And I should see "To attempt this quiz you need to know the quiz password"
And I should see "Your attempt will have a time limit of 1 hour. When you "
@@ -106,4 +106,4 @@ Feature: The various checks that may happen when an attept is started
And I press tab key in "Quiz password" "field"
And I press "Cancel"
Then I should see "Quiz 1 description"
And "Attempt quiz" "link" should be visible
And "Attempt quiz now" "button" should be visible
@@ -34,7 +34,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
@javascript
Scenario: After completing a question, there is a redo question button that restarts the question
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Attempt quiz now"
And I click on "False" "radio" in the "First question" "question"
And I click on "Check" "button" in the "First question" "question"
And I press "Try another question like this one"
@@ -44,7 +44,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
@javascript
Scenario: The redo question button is visible but disabled for teachers
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Attempt quiz now"
And I click on "False" "radio" in the "First question" "question"
And I click on "Check" "button" in the "First question" "question"
And I log out
@@ -56,7 +56,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
@javascript
Scenario: The redo question buttons are no longer visible after the attempt is submitted.
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Attempt quiz now"
And I click on "False" "radio" in the "First question" "question"
And I click on "Check" "button" in the "First question" "question"
And I press "Finish attempt ..."
@@ -67,7 +67,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
@javascript @_switch_window
Scenario: Teachers reviewing can see all the questions attempted in a slot
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Attempt quiz now"
And I click on "False" "radio" in the "First question" "question"
And I click on "Check" "button" in the "First question" "question"
And I press "Try another question like this one"
@@ -96,7 +96,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
@javascript
Scenario: Redoing question 1 should save any changes to question 2 on the same page
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Attempt quiz now"
And I click on "False" "radio" in the "First question" "question"
And I click on "Check" "button" in the "First question" "question"
And I click on "True" "radio" in the "Second question" "question"
@@ -117,7 +117,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
| slot | actualquestion |
| 1 | TF1 |
And I am on the "Quiz 2" "mod_quiz > View" page logged in as "student"
When I follow "Attempt quiz"
When I press "Continue the last attempt"
And I should see "First question"
And I click on "False" "radio"
And I click on "Check" "button"
@@ -35,7 +35,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "First question"
And I should see "This question cannot be attempted until the previous question has been completed."
@@ -63,7 +63,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I press "Check"
@@ -88,7 +88,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I press "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
@@ -111,7 +111,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "First question"
And I should see "Second question"
@@ -135,7 +135,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| Section 1 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "First question"
And I should see "Second question"
@@ -160,7 +160,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| Section 2 | 2 | 0 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I press "Next page"
Then I should see "Second question"
@@ -181,7 +181,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "First question"
And I should see "Second question"
@@ -202,7 +202,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF2 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "First question"
And I should see "Second question"
@@ -223,7 +223,7 @@ Feature: Attempt a quiz where some questions require that the previous question
| TF1 | 1 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
Then I should see "Read me"
And I should see "First question"
@@ -41,7 +41,7 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all
And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "failed"
And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo"
And I follow "Test quiz name"
And I follow "Attempt quiz"
And I press "Re-attempt quiz"
And I set the field "<answer>" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
@@ -43,7 +43,7 @@ Feature: Set a quiz to be marked complete when the student completes a minimum a
And I am on "Course 1" course homepage
And the "Make attempts: 2" completion condition of "Test quiz name" is displayed as "todo"
And I follow "Test quiz name"
And I follow "Attempt quiz"
And I press "Re-attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
+18 -8
View File
@@ -18,6 +18,7 @@ Feature: Edit quiz page - adding things
| activity | name | intro | course | idnumber |
| quiz | Quiz 1 | Quiz 1 for testing the Add menu | C1 | quiz1 |
And I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
And I should see "Editing quiz: Quiz 1"
@javascript
Scenario: Add some new question to the quiz using '+ a new question' options of the 'Add' menu.
@@ -29,6 +30,7 @@ Feature: Edit quiz page - adding things
And I set the field "Question name" to "Essay 01 new"
And I set the field "Question text" to "Please write 200 words about Essay 01"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I open the "Page 1" add to quiz menu
@@ -39,6 +41,7 @@ Feature: Edit quiz page - adding things
And I set the field "Question name" to "Essay 02 new"
And I set the field "Question text" to "Please write 200 words about Essay 02"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
@@ -50,6 +53,7 @@ Feature: Edit quiz page - adding things
And I set the field "Question name" to "Essay 03 new"
And I set the field "Question text" to "Please write 300 words about Essay 03"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "1"
@@ -62,6 +66,7 @@ Feature: Edit quiz page - adding things
And I set the field "Question name" to "Essay 04 new"
And I set the field "Question text" to "Please write 300 words about Essay 04"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "1"
@@ -72,7 +77,7 @@ Feature: Edit quiz page - adding things
When I press "Repaginate"
Then I should see "Repaginate with"
And I set the field "menuquestionsperpage" to "2"
And I click on "Go" "button" in the "Repaginate" "dialogue"
When I click on "Go" "button" in the "Repaginate" "dialogue"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "2"
@@ -84,9 +89,10 @@ Feature: Edit quiz page - adding things
And I set the field "item_qtype_essay" to "1"
And I press "submitbutton"
Then I should see "Adding an Essay question"
And I set the field "Question name" to "Essay for page 2"
When I set the field "Question name" to "Essay for page 2"
And I set the field "Question text" to "Please write 200 words about Essay for page 2"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "2"
@@ -100,23 +106,22 @@ Feature: Edit quiz page - adding things
# Create a couple of sub categories.
When I am on "Course 1" course homepage
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
Then I should see "Add category"
Then I set the field "Parent category" to "Default for C1"
And I set the field "Name" to "Subcat 1"
And I set the field "Category info" to "This is sub category 1"
And I press "id_submitbutton"
Then I press "id_submitbutton"
And I should see "Subcat 1"
Then I set the field "Parent category" to "Default for C1"
And I set the field "Name" to "Subcat 2"
And I set the field "Category info" to "This is sub category 2"
And I press "id_submitbutton"
Then I press "id_submitbutton"
And I should see "Subcat 2"
And I select "Questions" from the "questionbankactionselect" singleselect
And I should see "Question bank"
And I click on "Questions" "link"
Then I should see "Question bank"
And I should see "Select a category"
# Create the Essay 01 question.
@@ -189,12 +194,14 @@ Feature: Edit quiz page - adding things
And I click on "Select" "checkbox" in the "Essay 03" "table_row"
Then the "Add selected questions to the quiz" "button" should be enabled
And I click on "Add to quiz" "link" in the "Essay 03" "table_row"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 03" on quiz page "1"
# Add Essay 01 from question bank.
And I open the "Page 1" add to quiz menu
And I follow "from question bank"
And I click on "Add to quiz" "link" in the "Essay 01" "table_row"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 03" on quiz page "1"
And I should see "Essay 01" on quiz page "1"
@@ -204,6 +211,7 @@ Feature: Edit quiz page - adding things
And I should see "Select a category"
And I set the field "Select a category" to "Subcat 1"
And I click on "Add to quiz" "link" in the "Essay 02" "table_row"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 03" on quiz page "1"
And I should see "Essay 01" on quiz page "1"
And I should see "Essay 02" on quiz page "1"
@@ -212,6 +220,7 @@ Feature: Edit quiz page - adding things
And I open the "Page 1" add to quiz menu
And I follow "a random question"
And I press "Add random question"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 03" on quiz page "1"
And I should see "Essay 01" on quiz page "1"
And I should see "Essay 02" on quiz page "1"
@@ -237,6 +246,7 @@ Feature: Edit quiz page - adding things
And I set the field "Question name" to "Essay for page 4"
And I set the field "Question text" to "Please write 200 words about Essay for page 4"
And I press "id_submitbutton"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 03" on quiz page "1"
And I should see "Essay 01" on quiz page "2"
And I should see "Essay 02" on quiz page "3"
@@ -25,6 +25,8 @@ Feature: Edit quiz page - pagination
Scenario: Repaginate questions with N question(s) per page as well as clicking
on "add page break" or "Remove page break" icons to repaginate in any desired format.
Then I should see "Editing quiz: Quiz 1"
# Add the first Essay question.
And I open the action menu in ".page-add-actions" "css_element"
And I follow "a new question"
@@ -34,7 +36,8 @@ Feature: Edit quiz page - pagination
And I set the field "Question name" to "Essay 01 new"
And I set the field "Question text" to "Please write 100 words about Essay 01"
And I press "id_submitbutton"
Then I should see "Essay 01 new" on quiz page "1"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
# Add the second Essay question.
And I open the action menu in ".page-add-actions" "css_element"
@@ -45,7 +48,8 @@ Feature: Edit quiz page - pagination
And I set the field "Question name" to "Essay 02 new"
And I set the field "Question text" to "Please write 200 words about Essay 02"
And I press "id_submitbutton"
Then I should see "Essay 01 new" on quiz page "1"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
# Start repaginating.
@@ -69,7 +73,8 @@ Feature: Edit quiz page - pagination
And I set the field "Question name" to "Essay 03 new"
And I set the field "Question text" to "Please write 200 words about Essay 03"
And I press "id_submitbutton"
Then I should see "Essay 01 new" on quiz page "1"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "1"
And I should not see "Page 2"
@@ -116,7 +121,8 @@ Feature: Edit quiz page - pagination
When I set the field "Question name" to "Essay 04 new"
And I set the field "Question text" to "Please write 300 words about Essay 04"
And I press "id_submitbutton"
Then I should see "Essay 01 new" on quiz page "1"
Then I should see "Editing quiz: Quiz 1"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "2"
And I should see "Essay 03 new" on quiz page "3"
And I should see "Essay 04 new" on quiz page "3"
@@ -31,7 +31,7 @@ Feature: Edit quiz marks with attempts
| Default mark | 3.0 |
And I log out
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I log out
And I log in as "teacher1"
And I am on the "Quiz 1" "mod_quiz > Edit" page
@@ -29,7 +29,7 @@ Feature: Teachers can override the grade for any question
| question | page |
| TF1 | 1 |
And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1"
And I follow "Attempt quiz"
And I press "Attempt quiz now"
And I follow "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
+1 -1
View File
@@ -44,6 +44,6 @@ Feature: Preview a quiz as a teacher
@javascript
Scenario: Preview the quiz
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
When I follow "Preview quiz"
When I press "Preview quiz now"
Then I should see "Question 1"
And "Start a new preview" "button" should exist
@@ -62,7 +62,7 @@ Feature: View activity completion in the quiz activity
And the "Receive a grade" completion condition of "Test quiz name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test quiz name" is displayed as "failed"
And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo"
And I follow "Attempt quiz"
And I press "Re-attempt quiz"
And I set the field "<answer>" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
@@ -33,7 +33,7 @@ Feature: Quiz user override
| quiz | Test quiz | C1 | quiz1 |
And I am on the "Test quiz" "mod_quiz > View" page logged in as "teacher"
And I change window size to "large"
And I navigate to "Overrides" in current page administration
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student One (student1@example.com) |
@@ -147,7 +147,7 @@ Feature: Quiz user override
| Test quiz | student1 | 2 |
| Test quiz | student2 | 2 |
And I am on the "Test quiz" "mod_quiz > View" page logged in as "helper"
When I navigate to "Overrides" in current page administration
When I navigate to "User overrides" in current page administration
Then "Student One" "table_row" should exist
And "Student Two" "table_row" should exist
And "Add user override" "button" should not exist
@@ -52,7 +52,7 @@ Feature: Settings form fields disabled if not required
# And the "id_delay2_enabled" "field" should be enabled
When I press "Save and display"
And I navigate to "Overrides" in current page administration
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student1 |
@@ -67,7 +67,7 @@ Feature: Settings form fields disabled if not required
And the "id_delay2_enabled" "field" should be enabled
When I press "Save and display"
And I navigate to "Overrides" in current page administration
And I navigate to "User overrides" in current page administration
And I click on "Edit" "link" in the "region-main" "region"
And I set the field "Attempts allowed" to "2"
And I press "Save"
@@ -80,7 +80,7 @@ Feature: Settings form fields disabled if not required
And the "id_delay2_enabled" "field" should be disabled
When I press "Save and display"
And I navigate to "Overrides" in current page administration
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
| Override user | Student2 |