pickle-jar 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/src/feature-file-visitor.d.ts +4 -3
- package/dist/src/feature-file-visitor.js +75 -56
- package/dist/src/feature-file-visitor.js.map +1 -1
- package/dist/src/grammar/GherkinLexer.d.ts +8 -6
- package/dist/src/grammar/GherkinLexer.js +157 -150
- package/dist/src/grammar/GherkinLexer.js.map +1 -1
- package/dist/src/grammar/GherkinParser.d.ts +85 -26
- package/dist/src/grammar/GherkinParser.js +1528 -453
- package/dist/src/grammar/GherkinParser.js.map +1 -1
- package/dist/src/grammar/GherkinParserVisitor.d.ts +14 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/jest-error-listener.d.ts +8 -0
- package/dist/src/jest-error-listener.js +22 -0
- package/dist/src/jest-error-listener.js.map +1 -0
- package/dist/src/test-runner.js +18 -8
- package/dist/src/test-runner.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,10 +145,12 @@ const tagFilter = (tags: string[])=> {
|
|
|
145
145
|
return tags.indexOf("@ui") === -1;
|
|
146
146
|
}
|
|
147
147
|
```
|
|
148
|
-
There are
|
|
148
|
+
There are several builtin tags which are handled differently than custom tags:
|
|
149
149
|
|
|
150
150
|
* `@skip` - when used, the step and sub-steps are completely skipped (they are handled as Jest `describe.only` or `it.only` calls)
|
|
151
151
|
* `@only` - when used, only the steps and sub-steps are executed (they are handled as Jest `describe.only` or `it.only` calls)
|
|
152
|
+
* `@todo` - when used, the step is marked as a TODO and no step code is executed (they are handled as Jest `it.todo` calls)
|
|
153
|
+
* `@fail` - when used, the step is expected to fail (thye are handled as Jest `it.failed` calls)
|
|
152
154
|
|
|
153
155
|
## Jest configuration
|
|
154
156
|
Create a `jest.config.js` file in the project root (or update the existing one) to match the `runner.ts` file:
|
|
@@ -6,17 +6,18 @@ interface WorldObject<TWorld> {
|
|
|
6
6
|
world: TWorld;
|
|
7
7
|
}
|
|
8
8
|
export declare class FeatureFileVisitor<TWorld> extends AbstractParseTreeVisitor<void> implements GherkinParserVisitor<void> {
|
|
9
|
-
private readonly file;
|
|
10
9
|
private readonly worldFactory;
|
|
11
10
|
private readonly stepDefinitions;
|
|
12
11
|
private tagFilter;
|
|
13
|
-
constructor(
|
|
12
|
+
constructor(worldFactory: () => TWorld, stepDefinitions: StepDefinition<TWorld>[], tagFilter: (tags: string[]) => boolean);
|
|
14
13
|
visitFeatureFile(ctx: FeatureFileContext): void;
|
|
15
14
|
visitFeature(ctx: FeatureContext): void;
|
|
16
15
|
visitScenario(ctx: ScenarioContext, worldObject?: WorldObject<TWorld>): void;
|
|
17
|
-
|
|
16
|
+
setupBackground(backgroundCtx: BackgroundContext, ctx: FeatureContext): void;
|
|
18
17
|
visitScenarioOutline(ctx: ScenarioOutlineContext, worldObject?: WorldObject<TWorld>): void;
|
|
19
18
|
protected defaultResult(): void;
|
|
19
|
+
private extractTags;
|
|
20
|
+
private extractTestTags;
|
|
20
21
|
private replaceKeywords;
|
|
21
22
|
private runNextStep;
|
|
22
23
|
private defineTestStep;
|
|
@@ -5,41 +5,38 @@ const tree_1 = require("antlr4ts/tree");
|
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const GherkinParser_1 = require("./grammar/GherkinParser");
|
|
7
7
|
class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(worldFactory, stepDefinitions, tagFilter) {
|
|
9
9
|
super();
|
|
10
|
-
this.file = file;
|
|
11
10
|
this.worldFactory = worldFactory;
|
|
12
11
|
this.stepDefinitions = stepDefinitions;
|
|
13
12
|
this.tagFilter = tagFilter;
|
|
14
13
|
}
|
|
15
14
|
visitFeatureFile(ctx) {
|
|
16
|
-
|
|
17
|
-
this.visitChildren(ctx);
|
|
18
|
-
});
|
|
15
|
+
this.visitChildren(ctx);
|
|
19
16
|
}
|
|
20
17
|
visitFeature(ctx) {
|
|
21
|
-
|
|
22
|
-
const tags = (_b = (_a = ctx.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
18
|
+
const { tags, isOnly, isSkip } = this.extractTags(ctx.tags());
|
|
23
19
|
if (!this.tagFilter(tags)) {
|
|
24
20
|
return;
|
|
25
21
|
}
|
|
26
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
27
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
28
22
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
29
|
-
describeFunc(`Feature: ${ctx.
|
|
30
|
-
|
|
23
|
+
describeFunc(`Feature: ${ctx.multilineText().text.trim()}`, () => {
|
|
24
|
+
const backgroundCtx = ctx.background();
|
|
25
|
+
if (backgroundCtx) {
|
|
26
|
+
this.setupBackground(backgroundCtx, ctx);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.visitChildren(ctx);
|
|
30
|
+
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
visitScenario(ctx, worldObject) {
|
|
34
|
-
|
|
35
|
-
const tags = (_b = (_a = ctx.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
34
|
+
const { tags, isOnly, isSkip } = this.extractTags(ctx.tags());
|
|
36
35
|
if (!this.tagFilter(tags)) {
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
40
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
41
38
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
42
|
-
describeFunc(`Scenario: ${ctx.
|
|
39
|
+
describeFunc(`Scenario: ${ctx.multilineText().text.trim()}`, () => {
|
|
43
40
|
const worldObj = {};
|
|
44
41
|
beforeEach(() => {
|
|
45
42
|
if (!worldObject) {
|
|
@@ -51,35 +48,33 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
51
48
|
this.runNextStep(steps, undefined, worldObject !== null && worldObject !== void 0 ? worldObject : worldObj);
|
|
52
49
|
});
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const tags = (_b = (_a = ctx.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
51
|
+
setupBackground(backgroundCtx, ctx) {
|
|
52
|
+
const { tags, isOnly, isSkip } = this.extractTags(backgroundCtx.tags());
|
|
57
53
|
if (!this.tagFilter(tags)) {
|
|
58
54
|
return;
|
|
59
55
|
}
|
|
60
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
61
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
62
56
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
63
|
-
describeFunc(`Background: ${
|
|
57
|
+
describeFunc(`Background: ${backgroundCtx.multilineText().text.trim()}`, () => {
|
|
64
58
|
const worldObj = {};
|
|
65
59
|
beforeEach(() => {
|
|
66
60
|
worldObj.world = this.worldFactory();
|
|
67
61
|
});
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
const steps = [backgroundCtx.givenStep(), ...backgroundCtx.andGivenStep(), ...ctx.scenario(), ...ctx.scenarioOutline()];
|
|
63
|
+
this.runNextStep(steps, undefined, worldObj);
|
|
64
|
+
//
|
|
65
|
+
// const scenarios = [...backgroundCtx.scenario(), ...backgroundCtx.scenarioOutline()];
|
|
66
|
+
// for (const scenario of scenarios) {
|
|
67
|
+
// const steps = [backgroundCtx.givenStep(), ...backgroundCtx.andGivenStep(), scenario];
|
|
68
|
+
//
|
|
69
|
+
// this.runNextStep(steps, undefined, worldObj);
|
|
70
|
+
// }
|
|
73
71
|
});
|
|
74
72
|
}
|
|
75
73
|
visitScenarioOutline(ctx, worldObject) {
|
|
76
|
-
|
|
77
|
-
const tags = (_b = (_a = ctx.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
74
|
+
const { tags, isOnly, isSkip } = this.extractTags(ctx.tags());
|
|
78
75
|
if (!this.tagFilter(tags)) {
|
|
79
76
|
return;
|
|
80
77
|
}
|
|
81
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
82
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
83
78
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
84
79
|
const cellNames = ctx.examplesBlock().tableHeader().tableRow().cell().map(cell => cell.text.trim());
|
|
85
80
|
const values = ctx.examplesBlock().tableRow().map(row => row.cell().map(cell => cell.text.trim()));
|
|
@@ -90,7 +85,7 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
90
85
|
}
|
|
91
86
|
return item;
|
|
92
87
|
});
|
|
93
|
-
const scenarioName = ctx.
|
|
88
|
+
const scenarioName = ctx.multilineText().text.trim();
|
|
94
89
|
describeFunc(`Scenario outline: ${scenarioName}`, () => {
|
|
95
90
|
const worldObj = {};
|
|
96
91
|
beforeEach(() => {
|
|
@@ -108,24 +103,35 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
108
103
|
defaultResult() {
|
|
109
104
|
return;
|
|
110
105
|
}
|
|
106
|
+
extractTags(tagsContext) {
|
|
107
|
+
var _a;
|
|
108
|
+
const tags = (_a = tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.TAG().map(tag => tag.text)) !== null && _a !== void 0 ? _a : [];
|
|
109
|
+
const isOnly = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.ONLY_TAG().length);
|
|
110
|
+
const isSkip = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.SKIP_TAG().length);
|
|
111
|
+
return { tags, isOnly, isSkip };
|
|
112
|
+
}
|
|
113
|
+
extractTestTags(tagsContext) {
|
|
114
|
+
var _a;
|
|
115
|
+
const tags = (_a = tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.TAG().map(tag => tag.text)) !== null && _a !== void 0 ? _a : [];
|
|
116
|
+
const isOnly = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.ONLY_TAG().length);
|
|
117
|
+
const isSkip = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.SKIP_TAG().length);
|
|
118
|
+
const isTodo = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.TODO_TAG().length);
|
|
119
|
+
const isFail = !!(tagsContext === null || tagsContext === void 0 ? void 0 : tagsContext.FAIL_TAG().length);
|
|
120
|
+
return { tags, isOnly, isSkip, isTodo, isFail };
|
|
121
|
+
}
|
|
111
122
|
replaceKeywords(input, replacements) {
|
|
112
|
-
return input
|
|
123
|
+
return input
|
|
124
|
+
.replace(/<([^>]+)>/g, (match, keyword) => {
|
|
113
125
|
const replacement = replacements === null || replacements === void 0 ? void 0 : replacements[keyword];
|
|
114
126
|
return replacement !== undefined ? replacement.replace(/\$/g, "\\$") : match;
|
|
115
127
|
});
|
|
116
128
|
}
|
|
117
129
|
runNextStep(steps, valueMap, worldObject) {
|
|
118
|
-
var _a
|
|
130
|
+
var _a;
|
|
119
131
|
const step = steps.shift();
|
|
120
132
|
if (!step) {
|
|
121
133
|
return;
|
|
122
134
|
}
|
|
123
|
-
const tags = (_b = (_a = step.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
124
|
-
if (!this.tagFilter(tags)) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const isOnly = !!((_c = step.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
128
|
-
const isSkip = !!((_d = step.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
129
135
|
if (step instanceof GherkinParser_1.ScenarioContext) {
|
|
130
136
|
this.visitScenario(step, worldObject);
|
|
131
137
|
return;
|
|
@@ -134,43 +140,55 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
134
140
|
this.visitScenarioOutline(step, worldObject);
|
|
135
141
|
return;
|
|
136
142
|
}
|
|
143
|
+
let tags;
|
|
137
144
|
let prefix;
|
|
138
145
|
let prepare = true;
|
|
139
146
|
if (step instanceof GherkinParser_1.GivenStepContext || step instanceof GherkinParser_1.AndGivenStepContext) {
|
|
140
147
|
prefix = 'Given';
|
|
148
|
+
tags = this.extractTags(step.tags());
|
|
141
149
|
}
|
|
142
150
|
else if (step instanceof GherkinParser_1.WhenStepContext || step instanceof GherkinParser_1.AndWhenStepContext) {
|
|
143
151
|
prefix = 'When';
|
|
152
|
+
tags = this.extractTags(step.tags());
|
|
144
153
|
}
|
|
145
154
|
else if (step instanceof GherkinParser_1.ThenStepContext || step instanceof GherkinParser_1.AndStepContext) {
|
|
146
155
|
prefix = "Then";
|
|
147
156
|
prepare = false;
|
|
157
|
+
tags = this.extractTestTags(step.thenTags());
|
|
148
158
|
}
|
|
149
159
|
else {
|
|
150
160
|
prefix = 'But';
|
|
151
161
|
prepare = false;
|
|
162
|
+
tags = this.extractTestTags(step.thenTags());
|
|
152
163
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
164
|
+
if (!this.tagFilter(tags.tags)) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const name = `${prefix} ${this.replaceKeywords(step.multilineText().text.trim(), valueMap)}`;
|
|
168
|
+
const { match, step: stepCall } = this.getMatchingStepDefinition(name, !!tags.isTodo);
|
|
169
|
+
const docStringContents = (_a = step.docString()) === null || _a === void 0 ? void 0 : _a.DOC_STRING().text;
|
|
157
170
|
const args = this.extractTestArgs(match, name, docStringContents, valueMap);
|
|
158
171
|
if (prepare) {
|
|
159
|
-
this.definePrepareStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
172
|
+
this.definePrepareStep(name, stepCall, args, steps, valueMap, worldObject, tags);
|
|
160
173
|
}
|
|
161
174
|
else {
|
|
162
|
-
this.defineTestStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
175
|
+
this.defineTestStep(name, stepCall, args, steps, valueMap, worldObject, tags);
|
|
163
176
|
}
|
|
164
177
|
}
|
|
165
|
-
defineTestStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
166
|
-
const itFunc = isOnly ? it.only : isSkip ? it.skip : it;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
178
|
+
defineTestStep(name, stepCall, args, steps, valueMap, worldObject, tags) {
|
|
179
|
+
const itFunc = tags.isOnly ? it.only : tags.isSkip ? it.skip : tags.isTodo ? it.todo : tags.isFail ? it.failing : it;
|
|
180
|
+
if (tags.isTodo) {
|
|
181
|
+
itFunc(name);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
itFunc(name, () => {
|
|
185
|
+
stepCall(worldObject.world, ...args);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
170
188
|
this.runNextStep(steps, valueMap, worldObject);
|
|
171
189
|
}
|
|
172
|
-
definePrepareStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
173
|
-
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
190
|
+
definePrepareStep(name, stepCall, args, steps, valueMap, worldObject, tags) {
|
|
191
|
+
const describeFunc = tags.isOnly ? describe.only : tags.isSkip ? describe.skip : describe;
|
|
174
192
|
describeFunc(name, () => {
|
|
175
193
|
beforeEach(() => {
|
|
176
194
|
stepCall(worldObject.world, ...args);
|
|
@@ -195,17 +213,18 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
195
213
|
}
|
|
196
214
|
return args;
|
|
197
215
|
}
|
|
198
|
-
getMatchingStepDefinition(name) {
|
|
216
|
+
getMatchingStepDefinition(name, provideNopBoilerplate) {
|
|
217
|
+
var _a;
|
|
199
218
|
const matchingStepDefinitions = this.stepDefinitions.filter(def => {
|
|
200
219
|
return def.match.test(name);
|
|
201
220
|
});
|
|
202
|
-
if (!matchingStepDefinitions.length) {
|
|
221
|
+
if (!matchingStepDefinitions.length && !provideNopBoilerplate) {
|
|
203
222
|
throw new Error(`Missing step definition '${name}'`);
|
|
204
223
|
}
|
|
205
224
|
else if (matchingStepDefinitions.length > 1) {
|
|
206
225
|
throw new Error(`Multiple step definition match '${name}':\n${matchingStepDefinitions.map(rule => rule.match.toString()).join("\n")}`);
|
|
207
226
|
}
|
|
208
|
-
return matchingStepDefinitions[0];
|
|
227
|
+
return (_a = matchingStepDefinitions[0]) !== null && _a !== void 0 ? _a : { match: /^.*$/, step: undefined };
|
|
209
228
|
}
|
|
210
229
|
}
|
|
211
230
|
exports.FeatureFileVisitor = FeatureFileVisitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-file-visitor.js","sourceRoot":"","sources":["../../src/feature-file-visitor.ts"],"names":[],"mappings":";;;AAAA,wCAAuD;AACvD,2BAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"feature-file-visitor.js","sourceRoot":"","sources":["../../src/feature-file-visitor.ts"],"names":[],"mappings":";;;AAAA,wCAAuD;AACvD,2BAAuB;AACvB,2DAeiC;AAmBjC,MAAa,kBAA2B,SAAQ,+BAA8B;IAC1E,YAA6B,YAA0B,EAAmB,eAAyC,EAAU,SAAsC;QAC/J,KAAK,EAAE,CAAC;QADiB,iBAAY,GAAZ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D,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,GAAG,CAAC,CAAC;SACxD;aAAM,IAAI,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,OAAO,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1I;QACD,OAAO,MAAA,uBAAuB,CAAC,CAAC,CAAC,mCAAI,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;IAC1E,CAAC;CACJ;AAvQD,gDAuQC"}
|
|
@@ -18,12 +18,14 @@ export declare class GherkinLexer extends Lexer {
|
|
|
18
18
|
static readonly PIPE = 13;
|
|
19
19
|
static readonly ONLY_TAG = 14;
|
|
20
20
|
static readonly SKIP_TAG = 15;
|
|
21
|
-
static readonly
|
|
22
|
-
static readonly
|
|
23
|
-
static readonly
|
|
24
|
-
static readonly
|
|
25
|
-
static readonly
|
|
26
|
-
static readonly
|
|
21
|
+
static readonly TODO_TAG = 16;
|
|
22
|
+
static readonly FAIL_TAG = 17;
|
|
23
|
+
static readonly TAG = 18;
|
|
24
|
+
static readonly COMMENT = 19;
|
|
25
|
+
static readonly TEXT_CHARACTER = 20;
|
|
26
|
+
static readonly NEWLINE = 21;
|
|
27
|
+
static readonly WSS = 22;
|
|
28
|
+
static readonly DOC_STRING = 23;
|
|
27
29
|
static readonly TEXT_CHARACTER_MODE = 1;
|
|
28
30
|
static readonly channelNames: string[];
|
|
29
31
|
static readonly modeNames: string[];
|