0.7.0 • Published 5 years ago
babel-typescript-sample v0.7.0
react-gears-cypress
What is this?
This is a collection of helpers for testing react-gears browser UIs with Cypress.
How do I use it?
First, install the commands in support/commands.js
import {Commands} from 'react-gears-cypress'
const gears = new Commands(cy)
Cypress.Commands.overwrite('select', gears.select)
Then, in each test file where you want to interact with gears:
import {Finders} from 'react-gears-cypress'
const gears = new Finders(cy)
gears.blockPanel('Personal Information').within(() => {
gears.datapair('First Name').contains('Alice')
gears.input('Last Name').clear().type('Liddel')
# Finds either an HTML <select> or a gears component.
# Must redefine the `select` command to interact with gears components.
gears.select('Favorite Color').select('red')
})
Building the repo
npm run build
Type-checking the repo
npm run type-check
And to run in --watch
mode:
npm run type-check:watch