Skip to content

Instantly share code, notes, and snippets.

@nottyo
Last active July 16, 2019 10:11
Show Gist options
  • Save nottyo/bb1da96ccefcb596be888621837db8e7 to your computer and use it in GitHub Desktop.
Save nottyo/bb1da96ccefcb596be888621837db8e7 to your computer and use it in GitHub Desktop.
cypress support file (cypress/support/index.js)
const addContext = require('mochawesome/addContext')
Cypress.on('test:after:run', (test, runnable) => {
if (test.state === 'failed') {
const screenshotFileName = `${runnable.parent.title} -- ${test.title} (failed).png`
addContext({ test }, `assets/${Cypress.spec.name}/${screenshotFileName}`)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment