Commit 62b74008 by JonahStanley

Added tests for Limited Attempt Problems and Showing the Answer

parent c3c4a0e9
......@@ -72,3 +72,4 @@ Giulio Gratta <giulio@giuliogratta.com>
David Baumgold <david@davidbaumgold.com>
Jason Bau <jbau@stanford.edu>
Frances Botsford <frances@edx.org>
Jonah Stanley <Jonah_Stanley@brown.edu>
......@@ -47,12 +47,6 @@ def i_see_the_course_in_my_courses(step):
assert world.css_has_text(course_css, 'Robot Super Course')
@step('the course is loaded$')
def course_is_loaded(step):
class_css = 'a.class-name'
assert world.css_has_text(course_css, 'Robot Super Cousre')
@step('I am on the "([^"]*)" tab$')
def i_am_on_tab(step, tab_name):
header_css = 'div.inner-wrapper h1'
......
......@@ -112,7 +112,7 @@ def all_sections_are_expanded(step):
@step(u'all sections are collapsed$')
def all_sections_are_expanded(step):
def all_sections_are_collapsed(step):
subsection_locator = 'div.subsection-list'
subsections = world.css_find(subsection_locator)
for s in subsections:
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment