-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jonahstanley/add more tests #10
Merged
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
62b7400
Added tests for Limited Attempt Problems and Showing the Answer
7fe206a
Sped up some Lettuce Tests
ccc253d
Sped up tab lettuce test
c27391c
Accidently left in a set_trace and forgot to include files
a49acc7
Removed the save_html line
3308bb4
Fixed pull request comments and refactored the duplicate code
cb9da2c
Potentially fixed all flakey tests
286fcec
Fixed issue of searching for text
8cc93cb
Merge branch 'master' into jonahstanley/add-more-tests
a17c487
Merged from Master
0d11eb1
Fixed typo
6af54ea
Fixed scenario wording
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from lettuce import world, step | ||
from nose.tools import assert_equals | ||
|
||
|
||
@step(u'I click on the tabs then the page title should contain the following titles:') | ||
def i_click_on_the_tab_and_check(step): | ||
for tab_title in step.hashes: | ||
tab_text = tab_title['TabName'] | ||
title = tab_title['PageTitle'] | ||
world.click_link(tab_text) | ||
assert(title in world.browser.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These scenarios should be rewritten to follow the Given-When-Then convention. It seems like what you are trying to test here should be broken out so that a test will fail discreetly if the functionality is broken. |
||
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assertions should be on outcomes. We are following the Given-When-Then pattern.
Move "you have used x of y submissions" and "final check" button from the tests an make it a separate test that will pass/fail discreetly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. You can also remove the assertions for checking that a problem is marked correct/incorrect because other test cases cover this logic.