I found a trick, havent perfected it yet but its b...
# help
m
I found a trick, havent perfected it yet but its based on the metaprogramming page of Gleb. I have now in my e2e.js file the following code.
Copy code
js
import './commands'

var isFailed = false;
var failedTitle;

Cypress.on('fail', (error, runnable) => {
  
  failedTitle = runnable.fullTitle();
  isFailed = true

  throw error
})

afterEach(function() {
  if(isFailed){
    cy.screenshot(`The failed test is ${failedTitle}`,{capture: "fullPage"})
    isFailed = false
  }
})
This gives you 2 screenshots one the default when it failed. And the second a screenshot that makes a fullpage with the failed test title. Hope this will help you