Hide Input Fields Before Taking A Screenshot | Cypress examples (v13.8.1)

PHOTO EMBED

Wed May 08 2024 08:41:45 GMT+0000 (Coordinated Universal Time)

Saved by @al.thedigital #javascript

// change the account input element to "type=password" to hide the value
cy.get('#account-id').invoke('attr', 'type', 'password')
// now take the screenshot
cy.get('#account').screenshot('account', {
  overwrite: true,
})
content_copyCOPY

https://glebbahmutov.com/cypress-examples/recipes/hide-input-fields.html