-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from Papooch/fix/scenario-outline-with-placeh…
…olders Fix scenario outline title placeholder to work with autoBindSteps
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
examples/typescript/specs/step-definitions/auto-step-binding-outline.steps.ts
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,27 @@ | ||
import { StepDefinitions, autoBindSteps, loadFeature } from '../../../../src'; | ||
import { OnlineSales } from '../../src/online-sales'; | ||
|
||
export const salesSteps: StepDefinitions = ({ given, when, then }) => { | ||
let onlineSales: OnlineSales; | ||
let salesPrice: number | null; | ||
|
||
beforeEach(() => { | ||
onlineSales = new OnlineSales(); | ||
}); | ||
|
||
given(/^I have a\(n\) (.+)$/, (item: string) => { | ||
onlineSales.listItem(item); | ||
}); | ||
|
||
when(/^I sell the (.+)$/, (item: string) => { | ||
salesPrice = onlineSales.sellItem(item); | ||
}); | ||
|
||
then(/^I should get \$(\d+)$/, (expectedSalesPrice: string) => { | ||
expect(salesPrice).toBe(parseInt(expectedSalesPrice, 10)); | ||
}); | ||
}; | ||
|
||
const feature = loadFeature('./examples/typescript/specs/features/scenario-outlines.feature'); | ||
|
||
autoBindSteps([feature], [salesSteps]); |
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