-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
189 additions
and
124 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
tabWidth: 2, | ||
useTabs: false, | ||
singleQuote: true, | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Auto-inject fixtures are automatically injected into every step call. | ||
*/ | ||
|
||
import { TestInfo } from '@playwright/test'; | ||
import { BddFixtures } from './types'; | ||
import { BddWorld } from '../bddWorld'; | ||
|
||
// without explicitly passing them in the last argument of Given() / When() / Then() | ||
export type BddAutoInjectFixtures = Pick<BddFixtures, '$test' | '$tags' | '$step'> & { | ||
$testInfo: TestInfo; | ||
}; | ||
|
||
const BDD_AUTO_INJECT_FIXTURES: Record<keyof BddAutoInjectFixtures, null> = { | ||
$tags: null, | ||
$test: null, | ||
$step: null, | ||
$testInfo: null, | ||
}; | ||
|
||
export function isBddAutoInjectFixture(name: string) { | ||
return Object.prototype.hasOwnProperty.call( | ||
BDD_AUTO_INJECT_FIXTURES, | ||
name as keyof BddAutoInjectFixtures, | ||
); | ||
} | ||
|
||
export function getBddAutoInjectsFixtures(bddWorld: BddWorld): BddAutoInjectFixtures { | ||
return { | ||
$testInfo: bddWorld.testInfo, | ||
$tags: bddWorld.tags, | ||
$test: bddWorld.test, | ||
$step: bddWorld.step, | ||
}; | ||
} |
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
Oops, something went wrong.