Cypress · Method
cy.screenshot
Captures a PNG of the application, an element, or the Cypress runner. You can control the capture area, file name, masking, cropping, and other screenshot behavior.
Last updated
Syntax
cy.screenshot()
cy.screenshot(fileName)
cy.screenshot(options)
cy.screenshot(fileName, options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Cypress.Screenshot.defaults()screenshotsFolderscreenshotOnRunFailuretrashAssetsBeforeRunsafter:screenshotcy.viewport()