percy-interactor
v0.1.0
Published
A Percy SDK for taking snapshots through @bigtest/interactor
Downloads
2
Readme
percy-interactor
A Percy SDK for taking snapshots through @bigtest/interactor
.
Usage
To use percy-interactor
:
yarn add -D percy-interactor
ornpm i -D percy-interactor
- Import
snapshottable
into one of your custom interactors - Set
PERCY_TOKEN
with your projects token:export PERCY_TOKEN=abc
- Wrap your test command with
percy exec
:percy exec -- yarn test
For example:
import snapshottable from 'percy-interactor';
@interactor class LoginInteractor {
snapshot = snapshottable();
}
await new LoginInteractor().snapshot('Initial login state');
You can also pass options (widths
& minHeight
) when using it in
tests:
await new LoginInteractor()
.snapshot('Initial login state responsive', { widths: [768, 992, 1200]});