This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PR description from PR #1 as README
- Loading branch information
Showing
1 changed file
with
38 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,38 @@ | ||
# govuk-visual-regression | ||
An app that wraps Wraith for automated visual regression testing | ||
# Minimum viable visual regression testing of components | ||
An app that wraps Wraith for automated visual regression testing that uploads generated galleries to surge.sh for manual review. | ||
|
||
* A small sinatra app that runs on Heroku and listens to POST requests to `/run` | ||
* When a Github webhook makes a request to `/run`, pull out the environment from the [deployment object](https://developer.github.com/v3/activity/events/types/#deploymentevent) and use it to set the domains for the wraith config | ||
* Run an initial spider task that collects all the component preview URLs on the review app | ||
* Use spider results to create wraith config and run regression against them | ||
* Upload results to surge.sh using credentials in the environment | ||
* Example output from Heroku logs: https://gist.github.com/fofr/20fc117011d6cc52a9a7defd880ec4cf | ||
* Example gallery: http://government-frontend-pr-459.surge.sh/gallery.html | ||
|
||
## Steps | ||
|
||
* Raise PR, eg https://github.com/alphagov/government-frontend/pull/459 | ||
* Automatically deployed a review app: https://government-frontend-pr-459.herokuapp.com | ||
* Triggers a Github deployment webhook on successful deploy with environment set to `government-frontend-pr-459` | ||
* Run visual regression comparing https://government-frontend-pr-459.herokuapp.com/component-guide with https://government-frontend.herokuapp.com/component-guide | ||
* Upload gallery to https://government-frontend-pr-459.surge.sh/gallery.html | ||
|
||
## How to test locally | ||
|
||
* Run app on VM using: `bundle exec ruby app.rb` | ||
* App should be available at http://www.dev.gov.uk:4567/run | ||
|
||
Fake a webhook, where `deployment_payload.json` is the file in 210c55a: | ||
``` | ||
curl -X POST -d @deployment_payload.json http://www.dev.gov.uk:4567/run --header "Content-Type:application/json" | ||
``` | ||
|
||
* Rake tasks are also available with REVIEW_DOMAIN and LIVE_DOMAIN environment variables | ||
|
||
Part of: | ||
https://trello.com/c/iXflEn6F/106-3-build-automated-visual-regression-proof-of-concept | ||
|
||
Follow on from: | ||
|
||
https://github.com/alphagov/government-frontend/pull/458 | ||
https://github.com/alphagov/government-frontend/pull/472 |