From 7080a26ecc4dfa136b138ce144ef4efd9fe17242 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 18 Feb 2016 01:42:22 +0100 Subject: [PATCH] MDL-52964 Qtype: Small fixes to behat tests 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. --- question/type/description/tests/behat/add.feature | 1 - question/type/description/tests/behat/edit.feature | 1 - .../type/description/tests/behat/export.feature | 1 - .../type/description/tests/behat/preview.feature | 4 ++-- question/type/essay/tests/behat/add.feature | 2 -- question/type/essay/tests/behat/edit.feature | 1 - question/type/essay/tests/behat/export.feature | 1 - question/type/essay/tests/behat/preview.feature | 14 +++++++------- question/type/match/tests/behat/add.feature | 1 - question/type/match/tests/behat/edit.feature | 2 +- question/type/match/tests/behat/export.feature | 1 - question/type/match/tests/behat/preview.feature | 12 ++++++------ question/type/multichoice/tests/behat/add.feature | 2 -- question/type/multichoice/tests/behat/edit.feature | 2 -- .../type/multichoice/tests/behat/export.feature | 1 - .../type/multichoice/tests/behat/preview.feature | 14 +++++++------- question/type/shortanswer/tests/behat/add.feature | 1 - .../tests/behat/backup_and_restore.feature | 2 +- question/type/shortanswer/tests/behat/edit.feature | 2 +- .../type/shortanswer/tests/behat/export.feature | 1 - .../type/shortanswer/tests/behat/preview.feature | 6 +++--- question/type/truefalse/tests/behat/add.feature | 4 +--- question/type/truefalse/tests/behat/edit.feature | 1 - question/type/truefalse/tests/behat/export.feature | 1 - .../type/truefalse/tests/behat/preview.feature | 8 ++++---- 25 files changed, 33 insertions(+), 53 deletions(-) diff --git a/question/type/description/tests/behat/add.feature b/question/type/description/tests/behat/add.feature index 6742f7c86e9..ce3f32f9f6b 100644 --- a/question/type/description/tests/behat/add.feature +++ b/question/type/description/tests/behat/add.feature @@ -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 | diff --git a/question/type/description/tests/behat/edit.feature b/question/type/description/tests/behat/edit.feature index 2ed8a540adb..0fee2f48004 100644 --- a/question/type/description/tests/behat/edit.feature +++ b/question/type/description/tests/behat/edit.feature @@ -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: diff --git a/question/type/description/tests/behat/export.feature b/question/type/description/tests/behat/export.feature index fdad51e3b6b..9fa1a622d72 100644 --- a/question/type/description/tests/behat/export.feature +++ b/question/type/description/tests/behat/export.feature @@ -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" diff --git a/question/type/description/tests/behat/preview.feature b/question/type/description/tests/behat/preview.feature index f6f47060807..4db33536501 100644 --- a/question/type/description/tests/behat/preview.feature +++ b/question/type/description/tests/behat/preview.feature @@ -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" diff --git a/question/type/essay/tests/behat/add.feature b/question/type/essay/tests/behat/add.feature index 152cc063087..a0accccb174 100644 --- a/question/type/essay/tests/behat/add.feature +++ b/question/type/essay/tests/behat/add.feature @@ -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 | @@ -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 | diff --git a/question/type/essay/tests/behat/edit.feature b/question/type/essay/tests/behat/edit.feature index 9f032147f51..3fcff2f0a92 100644 --- a/question/type/essay/tests/behat/edit.feature +++ b/question/type/essay/tests/behat/edit.feature @@ -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: diff --git a/question/type/essay/tests/behat/export.feature b/question/type/essay/tests/behat/export.feature index 9b5810a656a..1c56f1968b7 100644 --- a/question/type/essay/tests/behat/export.feature +++ b/question/type/essay/tests/behat/export.feature @@ -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" diff --git a/question/type/essay/tests/behat/preview.feature b/question/type/essay/tests/behat/preview.feature index dd8ef442e77..49a4fb0b069 100644 --- a/question/type/essay/tests/behat/preview.feature +++ b/question/type/essay/tests/behat/preview.feature @@ -26,8 +26,8 @@ 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" @@ -35,8 +35,8 @@ Feature: Preview Essay questions 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" @@ -44,9 +44,9 @@ Feature: Preview Essay questions 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" diff --git a/question/type/match/tests/behat/add.feature b/question/type/match/tests/behat/add.feature index 911348529f6..8d8ed5b0b09 100644 --- a/question/type/match/tests/behat/add.feature +++ b/question/type/match/tests/behat/add.feature @@ -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 | diff --git a/question/type/match/tests/behat/edit.feature b/question/type/match/tests/behat/edit.feature index 40663ae205f..e052ccaddf6 100644 --- a/question/type/match/tests/behat/edit.feature +++ b/question/type/match/tests/behat/edit.feature @@ -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: diff --git a/question/type/match/tests/behat/export.feature b/question/type/match/tests/behat/export.feature index 6d1420db436..ae4a54139e8 100644 --- a/question/type/match/tests/behat/export.feature +++ b/question/type/match/tests/behat/export.feature @@ -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" diff --git a/question/type/match/tests/behat/preview.feature b/question/type/match/tests/behat/preview.feature index 2d219104fc6..f2a67545d9d 100644 --- a/question/type/match/tests/behat/preview.feature +++ b/question/type/match/tests/behat/preview.feature @@ -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 | @@ -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 | @@ -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 | diff --git a/question/type/multichoice/tests/behat/add.feature b/question/type/multichoice/tests/behat/add.feature index a883f28f31e..6151c9ea2da 100644 --- a/question/type/multichoice/tests/behat/add.feature +++ b/question/type/multichoice/tests/behat/add.feature @@ -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 | @@ -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 | diff --git a/question/type/multichoice/tests/behat/edit.feature b/question/type/multichoice/tests/behat/edit.feature index be91edad76a..b906b956cfb 100644 --- a/question/type/multichoice/tests/behat/edit.feature +++ b/question/type/multichoice/tests/behat/edit.feature @@ -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: @@ -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: diff --git a/question/type/multichoice/tests/behat/export.feature b/question/type/multichoice/tests/behat/export.feature index 731c7ea54c8..bd3b86b64f2 100644 --- a/question/type/multichoice/tests/behat/export.feature +++ b/question/type/multichoice/tests/behat/export.feature @@ -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" diff --git a/question/type/multichoice/tests/behat/preview.feature b/question/type/multichoice/tests/behat/preview.feature index 10563c3b05e..aa7d7cd9090 100644 --- a/question/type/multichoice/tests/behat/preview.feature +++ b/question/type/multichoice/tests/behat/preview.feature @@ -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" @@ -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" @@ -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" @@ -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 \ No newline at end of file + And I switch to the main window diff --git a/question/type/shortanswer/tests/behat/add.feature b/question/type/shortanswer/tests/behat/add.feature index a61571dacf4..d5e61b13f5a 100644 --- a/question/type/shortanswer/tests/behat/add.feature +++ b/question/type/shortanswer/tests/behat/add.feature @@ -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 | diff --git a/question/type/shortanswer/tests/behat/backup_and_restore.feature b/question/type/shortanswer/tests/behat/backup_and_restore.feature index 11d7fa7999f..707ca47507e 100644 --- a/question/type/shortanswer/tests/behat/backup_and_restore.feature +++ b/question/type/shortanswer/tests/behat/backup_and_restore.feature @@ -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 diff --git a/question/type/shortanswer/tests/behat/edit.feature b/question/type/shortanswer/tests/behat/edit.feature index 6dd528aa11a..4e30dba0aaa 100644 --- a/question/type/shortanswer/tests/behat/edit.feature +++ b/question/type/shortanswer/tests/behat/edit.feature @@ -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: diff --git a/question/type/shortanswer/tests/behat/export.feature b/question/type/shortanswer/tests/behat/export.feature index 1722cfff1d1..d8f1f91b2e2 100644 --- a/question/type/shortanswer/tests/behat/export.feature +++ b/question/type/shortanswer/tests/behat/export.feature @@ -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" diff --git a/question/type/shortanswer/tests/behat/preview.feature b/question/type/shortanswer/tests/behat/preview.feature index a9b6ebc4ec1..b41bdf174e0 100644 --- a/question/type/shortanswer/tests/behat/preview.feature +++ b/question/type/shortanswer/tests/behat/preview.feature @@ -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 @@ -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 @@ -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 diff --git a/question/type/truefalse/tests/behat/add.feature b/question/type/truefalse/tests/behat/add.feature index 8e0750b113a..4c09263e5f0 100644 --- a/question/type/truefalse/tests/behat/add.feature +++ b/question/type/truefalse/tests/behat/add.feature @@ -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 | @@ -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 | diff --git a/question/type/truefalse/tests/behat/edit.feature b/question/type/truefalse/tests/behat/edit.feature index 71313710ca4..4d9a8c98650 100644 --- a/question/type/truefalse/tests/behat/edit.feature +++ b/question/type/truefalse/tests/behat/edit.feature @@ -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: diff --git a/question/type/truefalse/tests/behat/export.feature b/question/type/truefalse/tests/behat/export.feature index a80ec25ee69..48d54bc90a4 100644 --- a/question/type/truefalse/tests/behat/export.feature +++ b/question/type/truefalse/tests/behat/export.feature @@ -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" diff --git a/question/type/truefalse/tests/behat/preview.feature b/question/type/truefalse/tests/behat/preview.feature index 32190e35351..d109a0807ca 100644 --- a/question/type/truefalse/tests/behat/preview.feature +++ b/question/type/truefalse/tests/behat/preview.feature @@ -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" @@ -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"