Is it possible to disable custom/embedded screenshots in Cypress?

Viewed 105

There is an option to disable screenshots in cypress.json but only for "screenshotOnRunFailure", when Cypress automatically takes a screenshot when there is a failure. Is it possible to disable custom screenshot "cy.screenshot()" passing parameter in run command like for video --config video=false. For example:

  it('test screenshots', () => {

    cy.get('someElement').click(); // user is redirected to another page
    cy.screenshot();
  
    cy.get('someElement').click();
    cy.screenshot();

  });

So, I need to run a command to include and ignore screenshots.

0 Answers
Related