-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
36 lines (31 loc) · 1.11 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as Cucumber from "cypress-cucumber-preprocessor/steps";
import { decorateFeature, decorateStep } from "./decorators";
// add cypress env var custom type
Cucumber.defineParameterType({
name: "env",
regexp: /{([^}]+)}/,
transformer: (s) => {
return Cypress.env(s);
},
});
// register class by feature name for use with decorators
export const Feature = decorateFeature;
// create decorators from cypress-cucumber-preprocessor steps
export const After = decorateStep(Cucumber.After);
export const And = decorateStep(Cucumber.And);
export const Before = decorateStep(Cucumber.Before);
export const But = decorateStep(Cucumber.But);
export const Given = decorateStep(Cucumber.Given);
export const Then = decorateStep(Cucumber.Then);
export const When = decorateStep(Cucumber.When);
// lower case support for personal preference
export const after = After;
export const and = And;
export const before = Before;
export const but = But;
export const feature = Feature;
export const given = Given;
export const then = Then;
export const when = When;
//
export const defineParameterType = Cucumber.defineParameterType;