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?
✗ Incorrect
The correct package name is '@percy/cypress' installed with npm using --save-dev.
How do you take a visual snapshot in a Cypress test using Percy?
✗ Incorrect
The correct command is cy.percySnapshot('name') to capture a Percy snapshot.
Where should you import '@percy/cypress' in your Cypress project?
✗ Incorrect
You import '@percy/cypress' in the Cypress support file to make Percy commands available globally.
What does Percy compare to detect visual changes?
✗ Incorrect
Percy compares screenshots taken at different times to find visual differences.
What must be set in CI to upload Percy snapshots?
✗ Incorrect
The environment variable PERCY_TOKEN must be set with your Percy project token.
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.