Fast, easy and reliable testing for anything that runs in a browser.
2 years with Cypress
npm install cypress
npx cypress open
npx @bahmutov/cly init
docker run -it -v $PWD:/e2e -w /e2e \
cypress/included:3.2.0
it('completes todo', () => {
// opens TodoMVC running at "baseUrl"
cy.visit('/')
cy.get('.new-todo').type('write tests{enter}')
cy.contains('.todo-list li', 'write tests')
.find('.toggle').check()
cy.contains('.todo-list li', 'write tests')
.should('have.class', 'completed')
})
version: 2.1
orbs:
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
- cypress/run
$ npm install -D @percy/cypress
import '@percy/cypress'
// ...
cypress/support/index.js
cy.percySnapshot('<name>')
1.
2.
3.
before(() => {
cy.task('resetCoverage',
{ isInteractive: Cypress.config('isInteractive') })
})
afterEach(() => {
cy.window().then(win => {
if (win.__coverage__) {
cy.task('combineCoverage', win.__coverage__)
}
})
})
after(() => {
cy.task('coverageReport')
})
cypress/support/index.js