Open tmanasi opened 3 years ago
Inside commands I skip snapshots if I am in interactive mode so it only takes snapshots in docker command.js:
if (Cypress.config('isInteractive')) {
Cypress.Commands.add('matchImageSnapshot', () => {
cy.log('Skipping snapshot');
});
} else {
addMatchImageSnapshotCommand();
}
Yes, i used a environment variable to determine that
if (Cypress.env('enableSnapshots')) {
cy.get('.pointer').matchImageSnapshot('sq-cm-arrow-pointer-down')
}
//to run
cypress open --env enableSnapshots=true
You can also add these env values in config file or in a separate environment file
Is there anyway to enable/disable taking snapshot ? Not Update I want to know if there is any way where I can choose when my snapshot test cases will run and when will not .