Skip to content

Instantly share code, notes, and snippets.

@sakshamgurung
Last active July 7, 2021 06:18
Show Gist options
  • Save sakshamgurung/3e4bce11ca7fea6f6eeefcbde017431d to your computer and use it in GitHub Desktop.
Save sakshamgurung/3e4bce11ca7fea6f6eeefcbde017431d to your computer and use it in GitHub Desktop.
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