Skip to content

Commit

Permalink
MDL-52964 Qtype: Small fixes to behat tests
Browse files Browse the repository at this point in the history
This applies some small changes to proposed behat tests:

- Geting rid of the @javascript tag when it's not needed.
- Adding some missing @_switch_window tags.
- Fixing some scenario names, previously duplicated.
- Fixing some typos and whitespace.
  • Loading branch information
stronk7 committed Feb 18, 2016
1 parent cad6799 commit 12d5994
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 53 deletions.
1 change: 0 additions & 1 deletion question/type/description/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating a Description question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create a Description question with Correct answer as False
When I add a "Description" question filling the form with:
| Question name | description-001 |
Expand Down
1 change: 0 additions & 1 deletion question/type/description/tests/behat/edit.feature
Expand Up @@ -24,7 +24,6 @@ Feature: Test editing a Description question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Edit a Description question
When I click on "Edit" "link" in the "description-001" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/description/tests/behat/export.feature
Expand Up @@ -23,7 +23,6 @@ Feature: Test exporting Description questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export a Description question
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
4 changes: 2 additions & 2 deletions question/type/description/tests/behat/preview.feature
Expand Up @@ -24,8 +24,8 @@ Feature: Preview a Description question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Preview a question and submit a correct response.
@javascript @_switch_window
Scenario: Preview a Description question and submit a correct response.
When I click on "Preview" "link" in the "description-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand Down
2 changes: 0 additions & 2 deletions question/type/essay/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating an Essay question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create an Essay question with Response format set to 'HTML editor'
When I add a "Essay" question filling the form with:
| Question name | essay-001 |
Expand All @@ -27,7 +26,6 @@ Feature: Test creating an Essay question
| Response format | HTML editor |
Then I should see "essay-001"

@javascript
Scenario: Create an Essay question with Response format set to 'HTML editor with the file picker'
When I add a "Essay" question filling the form with:
| Question name | essay-002 |
Expand Down
1 change: 0 additions & 1 deletion question/type/essay/tests/behat/edit.feature
Expand Up @@ -26,7 +26,6 @@ Feature: Test editing an Essay question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Edit an Essay question
When I click on "Edit" "link" in the "essay-001" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/essay/tests/behat/export.feature
Expand Up @@ -25,7 +25,6 @@ Feature: Test exporting Essay questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export 3 Essay questions
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
14 changes: 7 additions & 7 deletions question/type/essay/tests/behat/preview.feature
Expand Up @@ -26,27 +26,27 @@ Feature: Preview Essay questions
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Preview a question and submit a partially correct response.
@javascript @_switch_window
Scenario: Preview an Essay question and submit a partially correct response.
When I click on "Preview" "link" in the "essay-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I should see "Please write a story about a frog."
And I switch to the main window

@javascript
Scenario: Preview a question and submit a partially correct response.
@javascript @_switch_window
Scenario: Preview an Essay question and submit a partially correct response.
When I click on "Preview" "link" in the "essay-002" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
And I press "Start again with these options"
And I should see "Please write a story about a frog."
And I should see "You can drag and drop files here to add them."
And I switch to the main window
@javascript
Scenario: Preview a question and submit a partially correct response.

@javascript @_switch_window
Scenario: Preview an Essay question and submit a partially correct response.
When I click on "Preview" "link" in the "essay-003" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand Down
1 change: 0 additions & 1 deletion question/type/match/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating a Matching question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create a Matching question with 3 subquestions
When I add a "Matching" question filling the form with:
| Question name | match-001 |
Expand Down
2 changes: 1 addition & 1 deletion question/type/match/tests/behat/edit.feature
Expand Up @@ -24,7 +24,7 @@ Feature: Test editing a Matching question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
@javascript @_switch_window
Scenario: Edit a Matching question
When I click on "Edit" "link" in the "Matching for editing" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/match/tests/behat/export.feature
Expand Up @@ -23,7 +23,6 @@ Feature: Test exporting Matching questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export a Matching question
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
12 changes: 6 additions & 6 deletions question/type/match/tests/behat/preview.feature
Expand Up @@ -24,8 +24,8 @@ Feature: Preview a Matching question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Preview a question and submit a correct response.
@javascript @_switch_window
Scenario: Preview a Matching question and submit a correct response.
When I click on "Edit" "link" in the "matching-001" "table_row"
And I set the following fields to these values:
| Shuffle | 0 |
Expand All @@ -42,8 +42,8 @@ Feature: Preview a Matching question
And I should see "General feedback."
And I switch to the main window

@javascript
Scenario: Preview a question and submit a partially correct response.
@javascript @_switch_window
Scenario: Preview a Matching question and submit a partially correct response.
When I click on "Edit" "link" in the "matching-001" "table_row"
And I set the following fields to these values:
| Shuffle | 0 |
Expand All @@ -60,8 +60,8 @@ Feature: Preview a Matching question
And I should see "General feedback."
And I switch to the main window

@javascript
Scenario: Preview a question and submit an incorrect response.
@javascript @_switch_window
Scenario: Preview a Matching question and submit an incorrect response.
When I click on "Edit" "link" in the "matching-001" "table_row"
And I set the following fields to these values:
| Shuffle | 0 |
Expand Down
2 changes: 0 additions & 2 deletions question/type/multichoice/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating a Multiple choice question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create a Multiple choice question with multiple response
When I add a "Multiple choice" question filling the form with:
| Question name | Multi-choice-001 |
Expand All @@ -39,7 +38,6 @@ Feature: Test creating a Multiple choice question
| Hint 2 | Second hint |
Then I should see "Multi-choice-001"

@javascript
Scenario: Create a Multiple choice question with single response
When I add a "Multiple choice" question filling the form with:
| Question name | Multi-choice-002 |
Expand Down
2 changes: 0 additions & 2 deletions question/type/multichoice/tests/behat/edit.feature
Expand Up @@ -25,7 +25,6 @@ Feature: Test editing a Multiple choice question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Edit a Multiple choice question with multiple response (checkboxes)
When I click on "Edit" "link" in the "Multiple choice for editing" "table_row"
And I set the following fields to these values:
Expand All @@ -37,7 +36,6 @@ Feature: Test editing a Multiple choice question
And I press "id_submitbutton"
Then I should see "Edited Multiple choice name"

@javascript
Scenario: Edit a Multiple choice question with single response (radio buttons)
When I click on "Edit" "link" in the "Single choice for editing" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/multichoice/tests/behat/export.feature
Expand Up @@ -24,7 +24,6 @@ Feature: Test exporting Multiple choice questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export a Multiple choice question
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
14 changes: 7 additions & 7 deletions question/type/multichoice/tests/behat/preview.feature
Expand Up @@ -25,8 +25,8 @@ Feature: Preview a Multiple choice question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Preview a question and submit a partially correct response.
@javascript @_switch_window
Scenario: Preview a Multiple choice question and submit a partially correct response.
When I click on "Preview" "link" in the "Multi-choice-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand All @@ -40,8 +40,8 @@ Feature: Preview a Multiple choice question
And I should see "Parts, but only parts, of your response are correct."
And I switch to the main window

@javascript
Scenario: Preview a question and submit a correct response.
@javascript @_switch_window
Scenario: Preview a Multiple choice question and submit a correct response.
When I click on "Preview" "link" in the "Multi-choice-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand All @@ -57,8 +57,8 @@ Feature: Preview a Multiple choice question
And I should see "The correct answer is: One, Three"
And I switch to the main window

@javascript
Scenario: Preview a question and submit a correct response.
@javascript @_switch_window
Scenario: Preview a Multiple choice question and submit a correct response.
When I click on "Preview" "link" in the "Multi-choice-002" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand All @@ -69,4 +69,4 @@ Feature: Preview a Multiple choice question
And I should see "Mark 1.00 out of 1.00"
And I should see "Well done!"
And I should see "The correct answer is: One"
And I switch to the main window
And I switch to the main window
1 change: 0 additions & 1 deletion question/type/shortanswer/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating a Short answer question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create a Short answer question
When I add a "Short answer" question filling the form with:
| Question name | shortanswer-001 |
Expand Down
@@ -1,4 +1,4 @@
@qtype @qtype_short asnswer
@qtype @qtype_shortanswer
Feature: Test duplicating a quiz containing a Short answer question
As a teacher
In order re-use my courses containing Short answer questions
Expand Down
2 changes: 1 addition & 1 deletion question/type/shortanswer/tests/behat/edit.feature
Expand Up @@ -24,7 +24,7 @@ Feature: Test editing a Short answer question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
@javascript @_switch_window
Scenario: Edit a Short answer question
When I click on "Edit" "link" in the "shortanswer-001 for editing" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/shortanswer/tests/behat/export.feature
Expand Up @@ -23,7 +23,6 @@ Feature: Test exporting Short answer questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export a Short answer question
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
6 changes: 3 additions & 3 deletions question/type/shortanswer/tests/behat/preview.feature
Expand Up @@ -25,7 +25,7 @@ Feature: Preview a Short answer question
And I navigate to "Question bank" node in "Course administration"


@javascript
@javascript @_switch_window
Scenario: Preview a Short answer question with correct answer
When I click on "Preview" "link" in the "shortanswer-001" "table_row"
And I switch to "questionpreview" window
Expand All @@ -40,7 +40,7 @@ Feature: Preview a Short answer question
And I should see "Generalfeedback: frog or toad would have been OK."
And I should see "The correct answer is: frog"

@javascript
@javascript @_switch_window
Scenario: Preview a Short answer question with almost correct answer
When I click on "Preview" "link" in the "shortanswer-001" "table_row"
And I switch to "questionpreview" window
Expand All @@ -55,7 +55,7 @@ Feature: Preview a Short answer question
And I should see "Generalfeedback: frog or toad would have been OK."
And I should see "The correct answer is: frog"

@javascript
@javascript @_switch_window
Scenario: Preview a Short answer question with incorrect answer
When I click on "Preview" "link" in the "shortanswer-001" "table_row"
And I switch to "questionpreview" window
Expand Down
4 changes: 1 addition & 3 deletions question/type/truefalse/tests/behat/add.feature
Expand Up @@ -18,7 +18,6 @@ Feature: Test creating a True/False question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Create a True/False question with Correct answer as False
When I add a "True/False" question filling the form with:
| Question name | true-false-001 |
Expand All @@ -29,8 +28,7 @@ Feature: Test creating a True/False question
| Feedback for the response 'True'. | Well done! |
| Feedback for the response 'False'. | Read more about England. |
Then I should see "true-false-001"

@javascript

Scenario: Create a True/False question with Correct answer as True
When I add a "True/False" question filling the form with:
| Question name | true-false-002 |
Expand Down
1 change: 0 additions & 1 deletion question/type/truefalse/tests/behat/edit.feature
Expand Up @@ -24,7 +24,6 @@ Feature: Test editing a True/False question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Edit a True/False question
When I click on "Edit" "link" in the "true-false-001" "table_row"
And I set the following fields to these values:
Expand Down
1 change: 0 additions & 1 deletion question/type/truefalse/tests/behat/export.feature
Expand Up @@ -23,7 +23,6 @@ Feature: Test exporting True/False questions
And I log in as "teacher1"
And I follow "Course 1"

@javascript
Scenario: Export a True/False question
When I navigate to "Export" node in "Course administration > Question bank"
And I set the field "id_format_xml" to "1"
Expand Down
8 changes: 4 additions & 4 deletions question/type/truefalse/tests/behat/preview.feature
Expand Up @@ -24,8 +24,8 @@ Feature: Preview a Trtue/False question
And I follow "Course 1"
And I navigate to "Question bank" node in "Course administration"

@javascript
Scenario: Preview a question and submit a correct response.
@javascript @_switch_window
Scenario: Preview a True/False question and submit a correct response.
When I click on "Preview" "link" in the "true-false-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand All @@ -36,8 +36,8 @@ Feature: Preview a Trtue/False question
And I should see "The correct answer is 'True'."
And I switch to the main window

@javascript
Scenario: Preview a question and submit an incorrect response.
@javascript @_switch_window
Scenario: Preview a True/False question and submit an incorrect response.
When I click on "Preview" "link" in the "true-false-001" "table_row"
And I switch to "questionpreview" window
And I set the field "How questions behave" to "Immediate feedback"
Expand Down

0 comments on commit 12d5994

Please sign in to comment.