-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(main): add "common" variable to beforeAll and afterAll hooks
- Loading branch information
Showing
9 changed files
with
67 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@quickpickle/playwright": patch | ||
"quickpickle": patch | ||
--- | ||
|
||
Added common variable should to BeforeAll and AfterAll hooks. | ||
In your support files, you can get or set variables that should be | ||
common (shared) across all the tests in the Feature file. | ||
|
||
In general it is not good testing practice to use this for anything | ||
other than setup and teardown; for example, you might start a server | ||
and save the port in BeforeAll, then tear it down in AfterAll. | ||
|
||
Here is a ridiculous example demonstrating the functionality: | ||
|
||
```ts | ||
import { BeforeAll, AfterAll, AfterStep } from 'quickpickle' | ||
BeforeAll(async (common) => { common.totalSteps = 0 }) | ||
AfterStep(async (world) => { world.common.totalSteps++ }) | ||
AfterAll(async(common) => { expect(common.totalSteps).not.toBeFalsy() }) | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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