Last active
July 7, 2021 06:18
-
-
Save sakshamgurung/3e4bce11ca7fea6f6eeefcbde017431d to your computer and use it in GitHub Desktop.
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
const { | |
setDefaultTimeout, | |
AfterAll, | |
BeforeAll, | |
Before, | |
After, | |
} = require('@cucumber/cucumber') | |
const { | |
startWebDriver, | |
stopWebDriver, | |
createSession, | |
closeSession, | |
} = require('nightwatch-api') | |
setDefaultTimeout(60000) | |
// before the test run | |
BeforeAll(async function () { | |
await startWebDriver({ env: 'chrome' }) | |
}) | |
// before every scenario | |
Before(async function () { | |
await createSession() | |
}) | |
// cleanup after every scenario | |
After(async function () { | |
await closeSession() | |
}) | |
// after the whole test run | |
AfterAll(async function () { | |
await stopWebDriver() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment