Skip to content
masterclass Buddy

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.

Subscribe
  • Cypress.Screenshot.defaults()
  • screenshotsFolder
  • screenshotOnRunFailure
  • trashAssetsBeforeRuns
  • after:screenshot
  • cy.viewport()

Source: cy.screenshot() | Cypress API Documentation. Checked 2026-11-03.