- yarn
- ruby 2.5.1
$ bin/setup
$ bin/rails s
This boilerplate uses the Ruby on Rails application for the test target, but you can use any other application that works on the browser.
$ yarn run backstop test
$ yarn run backstop test --filter="<scenario label>"
$ yarn run backstop reference
$ yarn run backstop approve
$ yarn run backstop openReport
Copy and paste them ๐
.gitignore
backstop.json
backstop_data/
lib/tasks/
package.json
and write your scenarios in backstop_data/scenarios
!
Now, following features only available on the engine chromy
.
(I want to support puppet too ...)
[
{
"clickSelectors": [".foo", ".bar"]
}
]
See ./backstop_data/engine_scripts/chromy/clickAndHoverHelper.js
See ./backstop_data/engine_scripts/chromy/onBefore.js
backstop_data/engine_scripts/cookies.json
is set as a default cookie- It is useful for a login required application
- Suppress logging cookie unless
VERBOSE=1
is specified
See ./backstop_data/engine_scripts/chromy/loadCookies.js
backstop_data/scenarios
is the palce for scenarios and you can put multiple JSON files separated with human friendly contexts.
./backstop_data/scenarios/index.js bundles all jsons and ./backstop_data/runner.js loads the bundled scenraio to pass the backstop.
Use ${}
for interpolate variables into the scenario jsons.
{ "url": "http://localhost:3000/posts/${post_id}" }
Variables should be defined in backstop_data/variables.json
.
See ./backstop_data/interpolate.js
Using rake task like this is useful for preparing the variables on the other environments.