pickle-jar 1.1.0 → 1.3.0
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 +79 -52
- 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 +1495 -445
- 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,33 +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
|
-
|
|
18
|
+
const { tags, isOnly, isSkip } = this.extractTags(ctx.tags());
|
|
19
|
+
if (!this.tagFilter(tags)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
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
|
+
}
|
|
23
31
|
});
|
|
24
32
|
}
|
|
25
33
|
visitScenario(ctx, worldObject) {
|
|
26
|
-
|
|
27
|
-
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());
|
|
28
35
|
if (!this.tagFilter(tags)) {
|
|
29
36
|
return;
|
|
30
37
|
}
|
|
31
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
32
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
33
38
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
34
|
-
describeFunc(`Scenario: ${ctx.
|
|
39
|
+
describeFunc(`Scenario: ${ctx.multilineText().text.trim()}`, () => {
|
|
35
40
|
const worldObj = {};
|
|
36
41
|
beforeEach(() => {
|
|
37
42
|
if (!worldObject) {
|
|
@@ -43,35 +48,33 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
43
48
|
this.runNextStep(steps, undefined, worldObject !== null && worldObject !== void 0 ? worldObject : worldObj);
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
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());
|
|
49
53
|
if (!this.tagFilter(tags)) {
|
|
50
54
|
return;
|
|
51
55
|
}
|
|
52
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
53
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
54
56
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
55
|
-
describeFunc(`Background: ${
|
|
57
|
+
describeFunc(`Background: ${backgroundCtx.multilineText().text.trim()}`, () => {
|
|
56
58
|
const worldObj = {};
|
|
57
59
|
beforeEach(() => {
|
|
58
60
|
worldObj.world = this.worldFactory();
|
|
59
61
|
});
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
// }
|
|
65
71
|
});
|
|
66
72
|
}
|
|
67
73
|
visitScenarioOutline(ctx, worldObject) {
|
|
68
|
-
|
|
69
|
-
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());
|
|
70
75
|
if (!this.tagFilter(tags)) {
|
|
71
76
|
return;
|
|
72
77
|
}
|
|
73
|
-
const isOnly = !!((_c = ctx.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
74
|
-
const isSkip = !!((_d = ctx.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
75
78
|
const describeFunc = isOnly ? describe.only : isSkip ? describe.skip : describe;
|
|
76
79
|
const cellNames = ctx.examplesBlock().tableHeader().tableRow().cell().map(cell => cell.text.trim());
|
|
77
80
|
const values = ctx.examplesBlock().tableRow().map(row => row.cell().map(cell => cell.text.trim()));
|
|
@@ -82,7 +85,7 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
82
85
|
}
|
|
83
86
|
return item;
|
|
84
87
|
});
|
|
85
|
-
const scenarioName = ctx.
|
|
88
|
+
const scenarioName = ctx.multilineText().text.trim();
|
|
86
89
|
describeFunc(`Scenario outline: ${scenarioName}`, () => {
|
|
87
90
|
const worldObj = {};
|
|
88
91
|
beforeEach(() => {
|
|
@@ -100,24 +103,35 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
100
103
|
defaultResult() {
|
|
101
104
|
return;
|
|
102
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
|
+
}
|
|
103
122
|
replaceKeywords(input, replacements) {
|
|
104
|
-
return input
|
|
123
|
+
return input
|
|
124
|
+
.replace(/<([^>]+)>/g, (match, keyword) => {
|
|
105
125
|
const replacement = replacements === null || replacements === void 0 ? void 0 : replacements[keyword];
|
|
106
126
|
return replacement !== undefined ? replacement.replace(/\$/g, "\\$") : match;
|
|
107
127
|
});
|
|
108
128
|
}
|
|
109
129
|
runNextStep(steps, valueMap, worldObject) {
|
|
110
|
-
var _a
|
|
130
|
+
var _a;
|
|
111
131
|
const step = steps.shift();
|
|
112
132
|
if (!step) {
|
|
113
133
|
return;
|
|
114
134
|
}
|
|
115
|
-
const tags = (_b = (_a = step.tags()) === null || _a === void 0 ? void 0 : _a.TAG().map(tag => tag.text)) !== null && _b !== void 0 ? _b : [];
|
|
116
|
-
if (!this.tagFilter(tags)) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const isOnly = !!((_c = step.tags()) === null || _c === void 0 ? void 0 : _c.ONLY_TAG().length);
|
|
120
|
-
const isSkip = !!((_d = step.tags()) === null || _d === void 0 ? void 0 : _d.SKIP_TAG().length);
|
|
121
135
|
if (step instanceof GherkinParser_1.ScenarioContext) {
|
|
122
136
|
this.visitScenario(step, worldObject);
|
|
123
137
|
return;
|
|
@@ -126,43 +140,55 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
126
140
|
this.visitScenarioOutline(step, worldObject);
|
|
127
141
|
return;
|
|
128
142
|
}
|
|
143
|
+
let tags;
|
|
129
144
|
let prefix;
|
|
130
145
|
let prepare = true;
|
|
131
146
|
if (step instanceof GherkinParser_1.GivenStepContext || step instanceof GherkinParser_1.AndGivenStepContext) {
|
|
132
147
|
prefix = 'Given';
|
|
148
|
+
tags = this.extractTags(step.tags());
|
|
133
149
|
}
|
|
134
150
|
else if (step instanceof GherkinParser_1.WhenStepContext || step instanceof GherkinParser_1.AndWhenStepContext) {
|
|
135
151
|
prefix = 'When';
|
|
152
|
+
tags = this.extractTags(step.tags());
|
|
136
153
|
}
|
|
137
154
|
else if (step instanceof GherkinParser_1.ThenStepContext || step instanceof GherkinParser_1.AndStepContext) {
|
|
138
155
|
prefix = "Then";
|
|
139
156
|
prepare = false;
|
|
157
|
+
tags = this.extractTestTags(step.thenTags());
|
|
140
158
|
}
|
|
141
159
|
else {
|
|
142
160
|
prefix = 'But';
|
|
143
161
|
prepare = false;
|
|
162
|
+
tags = this.extractTestTags(step.thenTags());
|
|
163
|
+
}
|
|
164
|
+
if (!this.tagFilter(tags.tags)) {
|
|
165
|
+
return;
|
|
144
166
|
}
|
|
145
|
-
const name = `${prefix} ${this.replaceKeywords(step.
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const docStringContents = (_e = step.docString()) === null || _e === void 0 ? void 0 : _e.DOC_STRING().text;
|
|
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;
|
|
149
170
|
const args = this.extractTestArgs(match, name, docStringContents, valueMap);
|
|
150
171
|
if (prepare) {
|
|
151
|
-
this.definePrepareStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
172
|
+
this.definePrepareStep(name, stepCall, args, steps, valueMap, worldObject, tags);
|
|
152
173
|
}
|
|
153
174
|
else {
|
|
154
|
-
this.defineTestStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
175
|
+
this.defineTestStep(name, stepCall, args, steps, valueMap, worldObject, tags);
|
|
155
176
|
}
|
|
156
177
|
}
|
|
157
|
-
defineTestStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
158
|
-
const itFunc = isOnly ? it.only : isSkip ? it.skip : it;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
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
|
+
}
|
|
162
188
|
this.runNextStep(steps, valueMap, worldObject);
|
|
163
189
|
}
|
|
164
|
-
definePrepareStep(name, stepCall, args, steps, valueMap, worldObject,
|
|
165
|
-
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;
|
|
166
192
|
describeFunc(name, () => {
|
|
167
193
|
beforeEach(() => {
|
|
168
194
|
stepCall(worldObject.world, ...args);
|
|
@@ -187,17 +213,18 @@ class FeatureFileVisitor extends tree_1.AbstractParseTreeVisitor {
|
|
|
187
213
|
}
|
|
188
214
|
return args;
|
|
189
215
|
}
|
|
190
|
-
getMatchingStepDefinition(name) {
|
|
216
|
+
getMatchingStepDefinition(name, provideNopBoilerplate) {
|
|
217
|
+
var _a;
|
|
191
218
|
const matchingStepDefinitions = this.stepDefinitions.filter(def => {
|
|
192
219
|
return def.match.test(name);
|
|
193
220
|
});
|
|
194
|
-
if (!matchingStepDefinitions.length) {
|
|
221
|
+
if (!matchingStepDefinitions.length && !provideNopBoilerplate) {
|
|
195
222
|
throw new Error(`Missing step definition '${name}'`);
|
|
196
223
|
}
|
|
197
224
|
else if (matchingStepDefinitions.length > 1) {
|
|
198
225
|
throw new Error(`Multiple step definition match '${name}':\n${matchingStepDefinitions.map(rule => rule.match.toString()).join("\n")}`);
|
|
199
226
|
}
|
|
200
|
-
return matchingStepDefinitions[0];
|
|
227
|
+
return (_a = matchingStepDefinitions[0]) !== null && _a !== void 0 ? _a : { match: /^.*$/, step: undefined };
|
|
201
228
|
}
|
|
202
229
|
}
|
|
203
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,YAAY,CAAc;QAAmB,oBAAe,GAAf,eAAe,CAA0B;QAAU,cAAS,GAAT,SAAS,CAA6B;IAEnK,CAAC;IAEM,gBAAgB,CAAC,GAAuB;QAC3C,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAGM,YAAY,C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AI,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[];
|