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 option to override js_errors for phantomjs #65

Merged
merged 1 commit into from
Jun 12, 2017

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented Jun 12, 2017

#64

This change enables users to tell Quke whether JavaScript errors in a web page should throw an exception, causing tests to fail.

Based on current research this seems to be an option only available to people using phantomjs (via Poltergeist. Chrome and Firefox do not appear to provide flags that would cause an exception to be raised, or even an event we could capture and perhaps look to add the functionality into Quke.

So this change

  • updates the .config.yml to add a new flag called javascript_errors
  • updates driver_configuration.rb to make use of this value when setting the Poltergeist options

#64

This change enables users to tell **Quke** whether JavaScript errors in a
web page should throw an exception, causing tests to fail.

Based on current research this seems to be an option only available to
people using [phantomjs](http://phantomjs.org/) (via
[Poltergeist](https://github.com/teampoltergeist/poltergeist). Chrome
and Firefox do not appear to provide flags that would cause an exception
to be raised, or even an event we could capture and perhaps look to add
the functionality into **Quke**.

So this change

- updates the `.config.yml` to add a new flag called `javascript_errors`
- updates `driver_configuration.rb` to make use of this value when
  setting the **Poltergeist** options
@Cruikshanks Cruikshanks added the enhancement New feature or request label Jun 12, 2017
@Cruikshanks Cruikshanks self-assigned this Jun 12, 2017
@Cruikshanks Cruikshanks merged commit 56d2fd2 into master Jun 12, 2017
@Cruikshanks Cruikshanks deleted the feature/ignore-javascript-errors branch June 12, 2017 15:36
Cruikshanks added a commit to DEFRA/quke-example that referenced this pull request Jun 12, 2017
These changes were built more to enable me to test [Quke's new
functionality](DEFRA/quke#65) which allows users
to specify whether **PhantomJS** should throw an error if a JavaScript
error is encountered.

However it does also demonstrate how you can check for a certain
exception within your test, and provide a page in the demo app with a JavaScript error
to write your own tests against.
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