0
0
Cypresstesting~20 mins

Percy integration basics in Cypress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Percy Integration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Percy snapshot command output
What is the output result of running this Cypress test code with Percy integration?
Cypress
describe('Visual test', () => {
  it('takes a Percy snapshot', () => {
    cy.visit('https://example.com')
    cy.percySnapshot('Homepage')
  })
})
ATest passes and a Percy snapshot named 'Homepage' is sent to Percy service
BTest fails with 'cy.percySnapshot is not a function' error
CTest passes but no snapshot is sent to Percy
DTest fails with a timeout error on cy.visit
Attempts:
2 left
💡 Hint
Check if Percy plugin is properly installed and configured in Cypress.
assertion
intermediate
2:00remaining
Correct assertion for Percy snapshot existence
Which assertion correctly verifies that a Percy snapshot was created during a Cypress test run?
Cypress
cy.percySnapshot('Login Page')
// What assertion verifies snapshot creation?
Acy.contains('Snapshot created').should('be.visible')
BNo direct Cypress assertion; snapshot success is verified in Percy dashboard
Ccy.get('.percy-snapshot').should('exist')
Dcy.percySnapshot('Login Page').should('be.called')
Attempts:
2 left
💡 Hint
Percy snapshots are sent to an external service, not visible in the DOM.
🔧 Debug
advanced
2:00remaining
Debugging Percy snapshot failure in Cypress
You run a Cypress test with cy.percySnapshot but no snapshots appear in Percy dashboard. What is the most likely cause?
AThe tested page URL is invalid causing cy.visit to fail
Bcy.percySnapshot command is misspelled as cy.percySnapShot
CPercy token environment variable is missing or incorrect
DThe test does not include any cy.visit command
Attempts:
2 left
💡 Hint
Check environment variables and Percy configuration.
🧠 Conceptual
advanced
2:00remaining
Understanding Percy snapshot timing in Cypress tests
When is the best time to call cy.percySnapshot in a Cypress test to capture the correct visual state?
AAfter all UI elements have loaded and any animations have completed
BBefore cy.visit to capture the previous page state
CImmediately after cy.visit, before any UI changes or waits
DAt the very end of the test, after cy.clearCookies
Attempts:
2 left
💡 Hint
Think about when the page is fully ready visually.
framework
expert
2:00remaining
Configuring Percy with Cypress in CI environment
Which configuration step is essential to ensure Percy snapshots are uploaded during CI runs with Cypress?
AInstall Percy CLI globally on the CI machine only
BDisable all Cypress retries to avoid duplicate snapshots
CRun Cypress tests with --headless flag only
DSet the PERCY_TOKEN environment variable in the CI environment
Attempts:
2 left
💡 Hint
Think about authentication with Percy service in CI.