percy-interactor
v0.1.0
Published
A Percy SDK for taking snapshots through @bigtest/interactor
Readme
percy-interactor
A Percy SDK for taking snapshots through @bigtest/interactor.
Usage
To use percy-interactor:
yarn add -D percy-interactorornpm i -D percy-interactor- Import
snapshottableinto one of your custom interactors - Set
PERCY_TOKENwith 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]});