The Get Snappy client is for collection of DOM snapshots with Get Snappy in Ember.js applications. It captures the state of your components and pages as HTML snapshots that are then used to render out images to compare to know good images.
Import the snap
function to take DOM snapshots in your tests:
When passing the QUnit assert
object, the snapshot name is automatically generated based on the test module and test name.
You can provide a custom name for your snapshot:
The snap
function accepts an options object as the second parameter:
Snappy supports parallel testing via ember-exam
. In order to run your snapshots in parallel, you need to add a little extra configuration.
First we need to ensure there's two environment variables set:
GET_SNAPPY_UNIQUE_IDENTIFIER
needs to be a value that can be used in all parallel partitions to identify this specific build. Using the commit SHA isn't good enough because there may be multiple builds associated with a single SHA.
Finally, as a separate step that runs after your parallel test run you need to execute get-snappy finalize-build
(ensuring the same environment variables above are set)
snap(incomingTest, options?)
Takes a snapshot of the current DOM state.
Parameters:
incomingTest
: Assert | string
- Either a QUnit Assert object (for auto-generated names) or a string (for custom snapshot name)options
: Options
(optional) - Configuration optionsOptions Interface: