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 ability to set user-agent to use #60

Merged
merged 1 commit into from
Jun 5, 2017

Conversation

Cruikshanks
Copy link
Member

#58

This change allows users to specify the user agent a driver should use via the config.yml. This will only apply to the Firefox, Chrome and PhantomJS drivers.

The changes involved taking the argument passed in and
correctly configuring the underlying driver to use it. In the case of
Firefox this involved updating the profile. For Chrome it was
simply adding an additional flag.

PhantomJS proved to be more of a problem. You have to add a header
via Poltergiest, however it only last for the current session i.e
test. This means before every scenario you have to keep adding it back
in.

This meant a new before() hook was added to handle this.

Other changes include tests and documentation.

@Cruikshanks Cruikshanks added the enhancement New feature or request label Jun 5, 2017
@Cruikshanks Cruikshanks self-assigned this Jun 5, 2017
#58

This change allows users to specify the user agent a driver should use via the `config.yml`. This will only apply to the **Firefox**, **Chrome** and **PhantomJS** drivers.

The changes involved taking the argument passed in and correctly configuring the underlying driver to use it. In the case of **Firefox** this involved updating the profile. For **Chrome** it was simply adding an additional flag.

**PhantomJS** proved to be more of a problem. You have to add a header via **Poltergiest**, however it only last for the current session i.e test. This means before every scenario you have to keep adding it back in.

This meant a new `before()` hook was added to handle this.

Other changes include tests and documentation.
@Cruikshanks Cruikshanks merged commit 8d868b0 into master Jun 5, 2017
@Cruikshanks Cruikshanks deleted the feature/specify-user-agent branch June 5, 2017 21:55
Cruikshanks added a commit to DEFRA/quke-example that referenced this pull request Jun 9, 2017
This adds a new page that when requested, will output the details of the
request. It was created as part of working on [Add ability to set
user-agent to use](DEFRA/quke#60) in **Quke**.

Along with it is a feature that provides an example of how you can then
test a page for specific content. Admittedly not an amazing addition as
an example, but it gives meaning for the page being there, and is a
working example nonetheless.
Cruikshanks added a commit that referenced this pull request Jun 12, 2017
Forgot to update the version number after implementing PR #60 Add
ability to set user-agent to use.
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