Skip to content

Commit

Permalink
MDL-61132 Questions: Fix behat failures
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Feb 5, 2018
1 parent 869320c commit b0ae7d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion question/tests/behat/copy_questions.feature
Expand Up @@ -46,4 +46,4 @@ Feature: A teacher can duplicate questions in the question bank
When I click on "Duplicate" "link" in the "Test question to be copied" "table_row"
And I press "Cancel"
Then I should see "Test question to be copied"
And the field "Select a category" matches value "Test questions (1)"
And the field "Select a category" matches value "   Test questions (1)"
13 changes: 7 additions & 6 deletions question/tests/behat/question_categories.feature
@@ -1,4 +1,4 @@
@core @core_question
@core @core_question @javascript
Feature: A teacher can put questions in categories in the question bank
In order to organize my questions
As a teacher
Expand All @@ -16,9 +16,10 @@ Feature: A teacher can put questions in categories in the question bank
| teacher1 | C1 | editingteacher |
And the following "question categories" exist:
| contextlevel | reference | questioncategory | name |
| Course | C1 | Top | Default for C1 |
| Course | C1 | Top | top |
| Course | C1 | top | Default for C1 |
| Course | C1 | Default for C1 | Subcategory |
| Course | C1 | Top | Used category |
| Course | C1 | top | Used category |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Used category | essay | Test question to be moved | Write about whatever you want |
Expand All @@ -38,7 +39,7 @@ Feature: A teacher can put questions in categories in the question bank
Scenario: A question category can be edited
When I navigate to "Categories" node in "Course administration > Question bank"
And I click on "Edit" "link" in the "Subcategory" "list_item"
And the field "parent" matches value "   Default for C1"
And the field "parent" matches value "   Default for C1"
And I set the following fields to these values:
| Name | New name |
| Category info | I was edited |
Expand Down Expand Up @@ -67,7 +68,7 @@ Feature: A teacher can put questions in categories in the question bank
And I set the field "Question category" to "Subcategory"
And I press "Move to >>"
Then I should see "Test question to be moved"
And the field "Select a category" matches value "   Subcategory (1)"
And the field "Select a category" matches value "      Subcategory (1)"
And the "Select a category" select box should contain "Used category"
And the "Select a category" select box should not contain "Used category (1)"

Expand All @@ -80,6 +81,6 @@ Feature: A teacher can put questions in categories in the question bank
And I set the field "Save in category" to "Subcategory"
And I press "id_submitbutton"
Then I should see "Test question to be moved"
And the field "Select a category" matches value "   Subcategory (1)"
And the field "Select a category" matches value "      Subcategory (1)"
And the "Select a category" select box should contain "Used category"
And the "Select a category" select box should not contain "Used category (1)"

0 comments on commit b0ae7d0

Please sign in to comment.