menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Tech bits ...
source image

Dev

3w

read

166

img
dot

Image Credit: Dev

Tech bits 1 - Cypress screenshot errors in headless mode

  • In Cypress headless mode, screenshots of test errors only show where the error occurred, not the cause.
  • A workaround is to create a custom screenshot displaying the error message directly on the page.
  • The provided code block listens for the fail event, creates a red banner with the error message, and takes a screenshot with the message displayed.
  • This code should be placed in the cypress/support/e2e.ts file for TypeScript or e2e.js for JavaScript.

Read Full Article

like

10 Likes

For uninterrupted reading, download the app