percy-interactor

0.1.0 • Public • Published

percy-interactor

A Percy SDK for taking snapshots through @bigtest/interactor.

Usage

To use percy-interactor:

  • yarn add -D percy-interactor or npm 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]});

Readme

Keywords

none

Package Sidebar

Install

npm i percy-interactor

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

21 kB

Total Files

4

Last publish

Collaborators

  • robdel12