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

Switch from PhantomJS to Chrome #975

Merged
merged 7 commits into from
Jul 19, 2018

Conversation

andrewgarner
Copy link
Contributor

@andrewgarner andrewgarner commented Jul 19, 2018

PhantomJS development has now been abandoned and there are some outstanding bugs that will not be fixed.

Contains various fixes that ensure the test suite is compatible with the behaviour of Chrome.

https://trello.com/c/zrQWOwDl


Visual regression results:
https://government-frontend-pr-975.surge.sh/gallery.html

Component guide for this PR:
https://government-frontend-pr-975.herokuapp.com/component-guide

PhantomJS development has now been abandoned and there are some
outstanding bugs that will not be fixed.

See https://docs.publishing.service.gov.uk/manual/migrate-testing-from-phantomjs-to-selenium-chrome.html
Using Chrome instead of PhantomJS means cache headers are being
correctly observed.

A number of test cases share the same content item fixture, but make
changes to the body of the content item for the specific test case. We
therefore need to add a cachebust string to the URL as the content
item base path remains the same.
Using Chrome instead of PhantomJS means that whitespace is interpreted
differently. Our assertions ignore things like new line breaks which
are returned by Capybara.
Using Chrome instead of PhantomJS means we can no longer manipulate the
browser by executing a script on the page.

This is not something a user would typically do therefore Selenium
prevents it.
Using Chrome instead of PhantomJS means we can no access the status
code.

This is not something a user would typically do therefore Selenium
prevents it.

Instead we look for a `govuk-content-id` meta tag with the correct
content attribute that will be rendered if the page is successfully
rendered.
Using Chrome instead of PhantomJS means we can no do this. This isn’t
part of user acceptance so I’ve removed the assertion.
Requesting the atom feed through Chrome gives us a HTML
response. Instead we make a direct request and parse it using Ruby’s
RSS library.
@andrewgarner andrewgarner merged commit 9033278 into master Jul 19, 2018
@andrewgarner andrewgarner deleted the switch-from-phantomjs-to-chromedriver branch July 19, 2018 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants