Skip to content

Commit

Permalink
MDL-38957 behat: New test
Browse files Browse the repository at this point in the history
According to MDLQA-94, a teacher can
sort questions in the question bank.
  • Loading branch information
David Monllao committed Apr 11, 2013
1 parent a97d274 commit d72a183
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions question/tests/behat/sort_questions.feature
@@ -0,0 +1,53 @@
@core_question
Feature: A teacher can sort questions in the question bank
In order to order the question bank's questions
As a teacher
I need to sort the questions list using different sort orders

@javascript
Scenario: Sort using question name, question type and created by sort order links
Given the following "users" exists:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exists:
| fullname | shortname | format |
| Course 1 | C1 | weeks |
And the following "course enrolments" exists:
| 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 | A question 1 name |
| Question text | A question 1 text |
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I add a "Essay" question filling the form with:
| Question name | B question 2 name |
| Question text | B question 2 text |
And I add a "Numerical" question filling the form with:
| Question name | C question 3 name |
| Question text | C question 3 text |
| answer[0] | 2 |
| fraction[0] | 100% |
| answer[1] | 1 |
| fraction[1] | None |
When I follow "Sort by Question ascending"
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
And I follow "Sort by Question descending"
And "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
And I follow "Sort by Question type ascending"
And "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
And I follow "Sort by Question type descending"
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
And I follow "Sort by First name ascending"
And "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
And I follow "Sort by First name descending"
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
And I click on "Show question text in the question list" "checkbox"
And I should see "A question 1 text"
And I should see "B question 2 text"
And I should see "C question 3 text"

0 comments on commit d72a183

Please sign in to comment.