Skip to content
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

Add function to open page on fail #6

Merged
merged 2 commits into from
May 13, 2016

Conversation

Cruikshanks
Copy link
Member

When testing using the selenium driver (either the Chrome or Firefox browser) in the event of a fail you are likely to want to see the page where the failure occurs to help with resolving why it failed.

This change covers

  • Adding an after hook to call save_and_open_page when a scenario fails as long as the driver is not poltergeist
  • In the same hook if the driver is poltergeist don't show a page, but close cucumber. Assumption is based on poltergiest is being used in a CI environment where fast feedback is preferred to detailed feedback

When testing using the selenium driver (either the Chrome or Firefox browser) in the event of a fail you are likely to want to see the page where the failure occurs to help with resolving why it failed.

This change covers

- Adding an after hook to call `save_and_open_page` when a scenario fails as long as the driver is not poltergeist
- In the same hook if the driver is poltergeist don't show a page, but close cucumber. Assumption is based on poltergiest is being used in a CI environment where fast feedback is preferred to detailed feedback
Experience has shown that should a major element of your service go down all your tests will start failing which means you can be swamped with output from `save_and_open_page`.

To prevent this the change in this commit adds logic to the `after` hook to keep a global count of the number of fails, and if it hits 5 it will cause cucumber to close.
@Cruikshanks Cruikshanks self-assigned this May 13, 2016
@Cruikshanks Cruikshanks added the enhancement New feature or request label May 13, 2016
@Cruikshanks Cruikshanks merged commit e6a14f2 into master May 13, 2016
@Cruikshanks Cruikshanks deleted the feature/open-web-page-on-fail branch May 13, 2016 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant