Challenge - 5 Problems
Full-page Screenshot Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the result of this Cypress command?
Consider the following Cypress test code snippet that takes a full-page screenshot. What will be the outcome after running this test?
Cypress
cy.visit('https://example.com') cy.screenshot({ capture: 'fullPage' })
Attempts:
2 left
💡 Hint
The 'capture' option controls what part of the page is captured in the screenshot.
✗ Incorrect
Using cy.screenshot with { capture: 'fullPage' } tells Cypress to capture the entire scrollable page, not just the visible part.
❓ assertion
intermediate2:00remaining
Which assertion correctly verifies a full-page screenshot was taken?
You want to confirm that a full-page screenshot was saved with the correct file name pattern after running cy.screenshot({ capture: 'fullPage' }). Which assertion is correct?
Cypress
cy.screenshot('homepage', { capture: 'fullPage' }) // Which assertion below correctly checks the screenshot file?
Attempts:
2 left
💡 Hint
Screenshots are saved as files in the screenshots folder.
✗ Incorrect
The screenshot is saved as a file. Using cy.readFile to check the file exists is a valid way to assert the screenshot was taken.
🔧 Debug
advanced2:00remaining
Why does this full-page screenshot command fail?
This Cypress test tries to take a full-page screenshot but fails with an error. What is the most likely cause?
Cypress
cy.visit('https://example.com') cy.screenshot({ capture: 'fullpage' })
Attempts:
2 left
💡 Hint
Check the exact spelling and casing of option values.
✗ Incorrect
The 'capture' option value is case-sensitive. It must be 'fullPage' with capital P, not 'fullpage'.
❓ framework
advanced2:00remaining
How to configure Cypress to always take full-page screenshots on test failure?
You want Cypress to automatically take full-page screenshots whenever a test fails. Which configuration snippet achieves this?
Attempts:
2 left
💡 Hint
Look for the official Cypress config option names for screenshots.
✗ Incorrect
The correct config uses screenshotOnRunFailure: true and screenshotOptions with capture: 'fullPage'.
🧠 Conceptual
expert2:00remaining
What is a limitation of full-page screenshots in Cypress?
Which of the following is a known limitation when using Cypress to capture full-page screenshots?
Attempts:
2 left
💡 Hint
Think about what content is outside the main page DOM.
✗ Incorrect
Cypress cannot capture content inside iframes in full-page screenshots because iframes are separate documents.