Percy helps you catch visual changes in your app by taking screenshots during tests. It makes sure your app looks right after updates.
Percy integration basics in Cypress
cy.percySnapshot('snapshot-name')Use cy.percySnapshot() inside your Cypress test to take a visual snapshot.
The snapshot name helps you identify the screenshot in Percy dashboard.
cy.visit('https://example.com') cy.percySnapshot('Homepage')
cy.get('button').click() cy.percySnapshot('After button click')
This test visits the homepage and takes a Percy snapshot named 'Homepage'. Percy will compare this snapshot with previous ones to find visual differences.
describe('Visual test with Percy', () => { it('checks homepage appearance', () => { cy.visit('https://example.com') cy.percySnapshot('Homepage') }) })
Make sure Percy is installed and configured in your Cypress project before using cy.percySnapshot().
Snapshots are uploaded to Percy service, so you need internet connection during test runs.
Use meaningful snapshot names to easily track visual changes in Percy dashboard.
Percy integration lets you catch visual bugs by taking screenshots during Cypress tests.
Use cy.percySnapshot('name') to capture snapshots at any test step.
Review visual changes in Percy dashboard to keep your app looking great.