-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added before and after hooks to Cypress
- Loading branch information
1 parent
3e0eb15
commit 889c909
Showing
5 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
after(() => { | ||
console.info("Running after hook from 'cypress/support/after.ts'"); | ||
// disable debugging | ||
window.localStorage.removeItem("debug"); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Initialize debug with NPM debug | ||
* | ||
* Note: this is a client-side file, prefix environment variables with CYPRESS_ if necessary | ||
*/ | ||
before(() => { | ||
console.info("Running Cypress before hook from 'cypress/support/before.ts'"); | ||
const debugEnv = Cypress.env("DEBUG"); // Set CYPRESS_DEBUG if you want this variable to be defined (the CYPRESS_ prefix is scrapped out automatically) | ||
if (!(debugEnv && debugEnv === "false")) { | ||
const debugLevel = debugEnv || "vns:*"; | ||
console.info("Enabling debug with namespace", debugLevel); | ||
console.info( | ||
"Run Cypress with CYPRESS_DEBUG=false to disable, or CYPRESS_DEBUG=<your-namespace> to change the debug namespace" | ||
); | ||
window.localStorage.setItem("debug", debugLevel); | ||
} | ||
}); |
This file contains 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
This file contains 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