Added tests for Limited Attempt Problems and Showing the Answer

This commit is contained in:
JonahStanley
2013-05-30 14:22:37 -04:00
parent c3c4a0e9ad
commit 62b74008e6
5 changed files with 114 additions and 326 deletions

View File

@@ -84,3 +84,58 @@ Feature: Answer problems
| formula | incorrect |
| script | correct |
| script | incorrect |
Scenario: I can answer a problem with one attempt correctly
Given I am viewing a "multiple choice" problem with "1" attempt
Then I should see "You have used 0 of 1 submissions" somewhere in the page
And The "Final Check" button does appear
When I answer a "multiple choice" problem "correctly"
Then My "multiple choice" answer is marked "correct"
And The "multiple choice" problem displays a "correct" answer
And The "Reset" button does not appear
Scenario: I can answer a problem with one attempt incorrectly
Given I am viewing a "multiple choice" problem with "1" attempt
When I answer a "multiple choice" problem "incorrectly"
Then My "multiple choice" answer is marked "incorrect"
And The "multiple choice" problem displays a "incorrect" answer
And The "Reset" button does not appear
Scenario: I can answer a problem with multiple attempts correctly
Given I am viewing a "multiple choice" problem with "3" attempts
Then I should see "You have used 0 of 3 submissions" somewhere in the page
When I answer a "multiple choice" problem "correctly"
Then My "multiple choice" answer is marked "correct"
And The "multiple choice" problem displays a "correct" answer
And The "Reset" button does appear
Scenario: I can answer a problem with multiple attempts correctly on final guess
Given I am viewing a "multiple choice" problem with "3" attempts
Then I should see "You have used 0 of 3 submissions" somewhere in the page
When I answer a "multiple choice" problem "incorrectly"
Then My "multiple choice" answer is marked "incorrect"
And The "multiple choice" problem displays a "incorrect" answer
When I reset the problem
Then I should see "You have used 1 of 3 submissions" somewhere in the page
When I answer a "multiple choice" problem "incorrectly"
Then My "multiple choice" answer is marked "incorrect"
And The "multiple choice" problem displays a "incorrect" answer
When I reset the problem
Then I should see "You have used 2 of 3 submissions" somewhere in the page
And The "Final Check" button does appear
When I answer a "multiple choice" problem "correctly"
Then My "multiple choice" answer is marked "correct"
And The "multiple choice" problem displays a "correct" answer
And The "Reset" button does not appear
Scenario: I can view and hide the answer if the problem has it:
Given I am viewing a "numerical" that shows the answer "always"
Then The "Show Answer" button does appear
When I press the "Show Answer" button
Then The "Hide Answer" button does appear
And The "Show Answer" button does not appear
And I should see "4.14159" somewhere in the page
When I press the "Hide Answer" button
Then The "Show Answer" button does appear
And I do not see "4.14159" anywhere on the page