Overview - Screenshot capture (cy.screenshot)
What is it?
Screenshot capture with cy.screenshot is a way to take pictures of your web page during automated tests using Cypress. It helps you save the current view of the page or specific elements as image files. These images can be used to check if the page looks right or to find problems later.
Why it matters
Without screenshot capture, it is hard to see what went wrong when a test fails, especially for visual bugs. Screenshots provide a clear picture of the page state at test time, making debugging faster and easier. They also help teams communicate issues clearly and keep records of UI changes.
Where it fits
Before learning cy.screenshot, you should know basic Cypress commands and how to write simple tests. After mastering screenshots, you can explore visual testing tools and advanced debugging techniques that build on capturing page states.