From 7b2a5e566369b691fceca6b3f8aaaa508c61a0d4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 10 Mar 2014 12:32:39 +0000 Subject: [PATCH] MDL-44534 increase core_question Behat test robustness. --- question/tests/behat/behat_question.php | 2 +- question/tests/behat/copy_questions.feature | 16 ++++++++-------- question/tests/behat/edit_questions.feature | 2 +- question/tests/behat/question_categories.feature | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/question/tests/behat/behat_question.php b/question/tests/behat/behat_question.php index 35b2da43fe1..5b2a7f55916 100644 --- a/question/tests/behat/behat_question.php +++ b/question/tests/behat/behat_question.php @@ -62,7 +62,7 @@ class behat_question extends behat_base { new Given('I click on "' . $this->escape($questiontypexpath) . '" "xpath_element"'), new Given('I click on "#chooseqtype_submit" "css_element"'), new Given('I set the following fields to these values:', $questiondata), - new Given('I press "' . get_string('savechanges') . '"') + new Given('I press "id_submitbutton"') ); } diff --git a/question/tests/behat/copy_questions.feature b/question/tests/behat/copy_questions.feature index e529566114a..49a1ce25768 100644 --- a/question/tests/behat/copy_questions.feature +++ b/question/tests/behat/copy_questions.feature @@ -7,18 +7,18 @@ Feature: A teacher can duplicate questions in the question bank @javascript Scenario: copy a previously created question Given the following "users" exists: - | username | firstname | lastname | email | - | teacher1 | Teacher | 1 | teacher1@asd.com | + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@asd.com | And the following "courses" exists: | fullname | shortname | format | - | Course 1 | C1 | weeks | + | Course 1 | C1 | weeks | And the following "course enrolments" exists: - | user | course | role | - | teacher1 | C1 | editingteacher | + | user | course | role | + | teacher1 | C1 | editingteacher | And I log in as "admin" And I follow "Course 1" And I add a "Essay" question filling the form with: - | Question name | Test question to be copied | + | Question name | Test question to be copied | | Question text | Write about whatever you want | And I log out And I log in as "teacher1" @@ -26,9 +26,9 @@ Feature: A teacher can duplicate questions in the question bank And I follow "Question bank" When I click on "Duplicate" "link" in the "Test question to be copied" "table_row" And I set the following fields to these values: - | Question name | Duplicated question name | + | Question name | Duplicated question name | | Question text | Write a lot about duplicating questions | - And I press "Save changes" + And I press "id_submitbutton" Then I should see "Duplicated question name" And I should see "Test question to be copied" And I should see "Teacher 1" in the ".categoryquestionscontainer tbody tr.r0 .creatorname" "css_element" diff --git a/question/tests/behat/edit_questions.feature b/question/tests/behat/edit_questions.feature index 702ed90cfd1..3e19a0a246a 100644 --- a/question/tests/behat/edit_questions.feature +++ b/question/tests/behat/edit_questions.feature @@ -28,7 +28,7 @@ Feature: A teacher can edit questions in the question bank And I set the following fields to these values: | Question name | Edited question name | | Question text | Write a lot about what you want | - And I press "Save changes" + And I press "id_submitbutton" Then I should see "Edited question name" And I should not see "Test question to be edited" And I should see "Admin User" in the ".categoryquestionscontainer tbody .creatorname" "css_element" diff --git a/question/tests/behat/question_categories.feature b/question/tests/behat/question_categories.feature index 3517ecd2a09..50a73798494 100644 --- a/question/tests/behat/question_categories.feature +++ b/question/tests/behat/question_categories.feature @@ -49,7 +49,7 @@ Feature: A teacher can put questions in categories in the question bank When I click on "Edit" "link" in the "my test question" "table_row" And I click on "Use this category" "checkbox" And I set the field "Save in category" to "New Category 2" - And I press "Save changes" + And I press "id_submitbutton" Then I should see "my test question" And the "category" select box should contain "New Category 2 (1)" And the "category" select box should not contain "New Category 1 (1)"