Skip to content

Instantly share code, notes, and snippets.

@cvan
Created August 28, 2020 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvan/c5d05693c762e555bd04fe39e9ac7372 to your computer and use it in GitHub Desktop.
Save cvan/c5d05693c762e555bd04fe39e9ac7372 to your computer and use it in GitHub Desktop.
cypress helpers
const enableCypressDebug = win => {
if (process.env.DEBUG === '1') {
win.localStorage.setItem('debug', 'cypress:*');
}
};
beforeEach(enableCypressDebug);
afterEach(function stopOnFailure() {
if (this.currentTest.state === 'failed') {
Cypress.runner.stop();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment