Created
August 28, 2020 20:20
-
-
Save cvan/c5d05693c762e555bd04fe39e9ac7372 to your computer and use it in GitHub Desktop.
cypress helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const enableCypressDebug = win => { | |
if (process.env.DEBUG === '1') { | |
win.localStorage.setItem('debug', 'cypress:*'); | |
} | |
}; | |
beforeEach(enableCypressDebug); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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