0
0
Cypresstesting~5 mins

Percy integration basics in Cypress - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Percy in the context of Cypress testing?
Percy is a visual testing tool that integrates with Cypress to capture screenshots and compare them over time to detect visual changes in your web application.
Click to reveal answer
beginner
How do you install Percy in a Cypress project?
You install Percy by running <code>npm install --save-dev @percy/cypress</code> and then adding <code>import '@percy/cypress'</code> in your Cypress support file.
Click to reveal answer
beginner
What command do you use to start a Percy visual test in a Cypress test?
You use cy.percySnapshot('snapshot name') inside your Cypress test to take a visual snapshot for Percy to compare.
Click to reveal answer
beginner
Why is it important to give descriptive names to Percy snapshots?
Descriptive names help you easily identify which page or component the snapshot represents when reviewing visual changes in the Percy dashboard.
Click to reveal answer
intermediate
What environment variable must be set to authenticate Percy in CI?
You must set the PERCY_TOKEN environment variable with your Percy project token to authenticate and upload snapshots during Continuous Integration.
Click to reveal answer
Which command installs Percy for Cypress?
Anpm install --save-dev @percy/cypress
Bnpm install --save-dev cypress-percy
Cnpm install percy-cypress
Dnpm install --save-dev @cypress/percy
How do you take a visual snapshot in a Cypress test using Percy?
Apercy.snapshot('name')
Bcy.snapshot('name')
Ccy.percySnapshot('name')
Dcy.takeSnapshot('name')
Where should you import '@percy/cypress' in your Cypress project?
AIn the test file
BIn the Cypress support file
CIn the Cypress plugins file
DIn the package.json
What does Percy compare to detect visual changes?
AHTML code differences
BJavaScript errors
CCSS stylesheets
DScreenshots over time
What must be set in CI to upload Percy snapshots?
APERCY_TOKEN
BCYPRESS_TOKEN
CPERFORMANCE_TOKEN
DPERCY_API_KEY
Explain how to integrate Percy with Cypress for visual testing.
Think about installation, setup, usage, and authentication.
You got /4 concepts.
    Describe why visual testing with Percy is useful in Cypress tests.
    Consider the benefits of catching visual differences early.
    You got /4 concepts.