allure-cucumberjs 2.0.0-beta.16 → 2.0.0-beta.19
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 +16 -8
- package/dist/src/CucumberAllureInterface.js +3 -10
- package/dist/src/CucumberAllureInterface.js.map +1 -1
- package/dist/src/CucumberJSAllureReporter.d.ts +48 -65
- package/dist/src/CucumberJSAllureReporter.js +298 -237
- package/dist/src/CucumberJSAllureReporter.js.map +1 -1
- package/package.json +18 -10
- package/dist/src/events/Example.d.ts +0 -8
- package/dist/src/events/Example.js +0 -26
- package/dist/src/events/Example.js.map +0 -1
- package/dist/src/events/GherkinDocument.d.ts +0 -17
- package/dist/src/events/GherkinDocument.js +0 -10
- package/dist/src/events/GherkinDocument.js.map +0 -1
- package/dist/src/events/GherkinExample.d.ts +0 -15
- package/dist/src/events/GherkinExample.js +0 -7
- package/dist/src/events/GherkinExample.js.map +0 -1
- package/dist/src/events/GherkinStep.d.ts +0 -17
- package/dist/src/events/GherkinStep.js +0 -7
- package/dist/src/events/GherkinStep.js.map +0 -1
- package/dist/src/events/GherkinTestCase.d.ts +0 -18
- package/dist/src/events/GherkinTestCase.js +0 -11
- package/dist/src/events/GherkinTestCase.js.map +0 -1
- package/dist/src/events/Result.d.ts +0 -5
- package/dist/src/events/Result.js +0 -7
- package/dist/src/events/Result.js.map +0 -1
- package/dist/src/events/SourceLocation.d.ts +0 -11
- package/dist/src/events/SourceLocation.js +0 -10
- package/dist/src/events/SourceLocation.js.map +0 -1
- package/dist/src/events/TestHookDefinition.d.ts +0 -8
- package/dist/src/events/TestHookDefinition.js +0 -3
- package/dist/src/events/TestHookDefinition.js.map +0 -1
- package/dist/src/utilities.d.ts +0 -7
- package/dist/src/utilities.js +0 -58
- package/dist/src/utilities.js.map +0 -1
package/README.md
CHANGED
|
@@ -13,20 +13,28 @@ export default class Reporter extends CucumberJSAllureFormatter {
|
|
|
13
13
|
options,
|
|
14
14
|
new AllureRuntime({ resultsDir: "./allure-results" }),
|
|
15
15
|
{
|
|
16
|
-
labels:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
labels: [
|
|
17
|
+
{
|
|
18
|
+
pattern: [/@feature:(.*)/],
|
|
19
|
+
name: "epic"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
pattern: [/@severity:(.*)/],
|
|
23
|
+
name: "severity"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
links: [
|
|
27
|
+
{
|
|
22
28
|
pattern: [/@issue=(.*)/],
|
|
29
|
+
type: "issue",
|
|
23
30
|
urlTemplate: "http://localhost:8080/issue/%s"
|
|
24
31
|
},
|
|
25
|
-
|
|
32
|
+
{
|
|
26
33
|
pattern: [/@tms=(.*)/],
|
|
34
|
+
type: "tms",
|
|
27
35
|
urlTemplate: "http://localhost:8080/tms/%s"
|
|
28
36
|
}
|
|
29
|
-
|
|
37
|
+
]
|
|
30
38
|
}
|
|
31
39
|
);
|
|
32
40
|
}
|
|
@@ -42,11 +42,11 @@ class CucumberAllureInterface extends allure_js_commons_1.Allure {
|
|
|
42
42
|
step.endStep();
|
|
43
43
|
}
|
|
44
44
|
attachment(name, content, options) {
|
|
45
|
-
const file = this.
|
|
45
|
+
const file = this.runtime.writeAttachment(content, options);
|
|
46
46
|
this.currentExecutable.addAttachment(name, options, file);
|
|
47
47
|
}
|
|
48
48
|
testAttachment(name, content, options) {
|
|
49
|
-
const file = this.
|
|
49
|
+
const file = this.runtime.writeAttachment(content, options);
|
|
50
50
|
this.currentTest.addAttachment(name, options, file);
|
|
51
51
|
}
|
|
52
52
|
addParameter(name, value) {
|
|
@@ -62,11 +62,7 @@ class CucumberAllureInterface extends allure_js_commons_1.Allure {
|
|
|
62
62
|
this.currentTest.addTmsLink(url, name);
|
|
63
63
|
}
|
|
64
64
|
get currentExecutable() {
|
|
65
|
-
|
|
66
|
-
if (result === null) {
|
|
67
|
-
throw new Error("No executable!");
|
|
68
|
-
}
|
|
69
|
-
return result;
|
|
65
|
+
throw new Error("No executable!");
|
|
70
66
|
}
|
|
71
67
|
get currentTest() {
|
|
72
68
|
if (this.reporter.currentTest === null) {
|
|
@@ -76,7 +72,6 @@ class CucumberAllureInterface extends allure_js_commons_1.Allure {
|
|
|
76
72
|
}
|
|
77
73
|
startStep(name) {
|
|
78
74
|
const allureStep = this.currentExecutable.startStep(name);
|
|
79
|
-
this.reporter.pushStep(allureStep);
|
|
80
75
|
return new WrappedStep(this.reporter, allureStep);
|
|
81
76
|
}
|
|
82
77
|
}
|
|
@@ -88,7 +83,6 @@ class WrappedStep {
|
|
|
88
83
|
}
|
|
89
84
|
startStep(name) {
|
|
90
85
|
const step = this.step.startStep(name);
|
|
91
|
-
this.reporter.pushStep(step);
|
|
92
86
|
return new WrappedStep(this.reporter, step);
|
|
93
87
|
}
|
|
94
88
|
setStatus(status) {
|
|
@@ -100,7 +94,6 @@ class WrappedStep {
|
|
|
100
94
|
this.step.detailsTrace = error.stack;
|
|
101
95
|
}
|
|
102
96
|
endStep() {
|
|
103
|
-
this.reporter.popStep();
|
|
104
97
|
this.step.endStep();
|
|
105
98
|
}
|
|
106
99
|
run(body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CucumberAllureInterface.js","sourceRoot":"","sources":["../../src/CucumberAllureInterface.ts"],"names":[],"mappings":";;;AAAA,yDAW2B;AAG3B,MAAa,uBAAwB,SAAQ,0BAAM;IACjD,YAA6B,QAAmC,EAAE,OAAsB;QACtF,KAAK,CAAC,OAAO,CAAC,CAAC;QADY,aAAQ,GAAR,QAAQ,CAA2B;IAEhE,CAAC;IAED,IAAI,CAAI,IAAY,EAAE,IAAgC;QACpD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,MAAM,CAAC;QACX,IAAI;YACF,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAA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C,EACnC,IAAgB;QADhB,aAAQ,GAAR,QAAQ,CAA2B;QACnC,SAAI,GAAJ,IAAI,CAAY;IAChC,CAAC;IAEJ,SAAS,CAAC,IAAY;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEvC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,SAAS,CAAC,MAAe;QACvB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,KAAY;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,0BAAM,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC;IACvC,CAAC;IAED,OAAO;QAEL,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,GAAG,CAAI,IAAgC;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAChC,CAAC;CACF;AA9BD,kCA8BC"}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { GherkinDocument } from "./events/GherkinDocument";
|
|
5
|
-
import { Result } from "./events/Result";
|
|
6
|
-
import { SourceLocation } from "./events/SourceLocation";
|
|
1
|
+
import { World as CucumberWorld, Formatter } from "@cucumber/cucumber";
|
|
2
|
+
import { IFormatterOptions } from "@cucumber/cucumber/lib/formatter";
|
|
3
|
+
import { Allure, AllureGroup, AllureRuntime, AllureTest, ExecutableItemWrapper } from "allure-js-commons";
|
|
7
4
|
export { Allure } from "allure-js-commons";
|
|
8
5
|
export interface World extends CucumberWorld {
|
|
9
6
|
allure: Allure;
|
|
10
7
|
}
|
|
8
|
+
export declare type LabelMatcher = {
|
|
9
|
+
pattern: RegExp[];
|
|
10
|
+
name: "epic" | "severity" | string;
|
|
11
|
+
};
|
|
12
|
+
export declare type LinkMatcher = {
|
|
13
|
+
pattern: RegExp[];
|
|
14
|
+
urlTemplate: string;
|
|
15
|
+
type: "tms" | "issue" | string;
|
|
16
|
+
};
|
|
11
17
|
export declare class CucumberJSAllureFormatterConfig {
|
|
12
18
|
exceptionFormatter?: (message: string) => string;
|
|
13
|
-
labels?:
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
links?: {
|
|
17
|
-
issue?: {
|
|
18
|
-
pattern: RegExp[];
|
|
19
|
-
urlTemplate: string;
|
|
20
|
-
};
|
|
21
|
-
tms?: {
|
|
22
|
-
pattern: RegExp[];
|
|
23
|
-
urlTemplate: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
19
|
+
labels?: LabelMatcher[];
|
|
20
|
+
links?: LinkMatcher[];
|
|
26
21
|
}
|
|
27
22
|
export declare class CucumberJSAllureFormatter extends Formatter {
|
|
28
23
|
private readonly allureRuntime;
|
|
@@ -34,52 +29,40 @@ export declare class CucumberJSAllureFormatter extends Formatter {
|
|
|
34
29
|
private readonly afterHooks;
|
|
35
30
|
private readonly beforeHooks;
|
|
36
31
|
private readonly exceptionFormatter;
|
|
32
|
+
private readonly labelsMathers;
|
|
33
|
+
private readonly linksMatchers;
|
|
34
|
+
private stepStack;
|
|
35
|
+
private hostname;
|
|
36
|
+
private readonly documentMap;
|
|
37
37
|
private readonly featureMap;
|
|
38
|
-
private readonly
|
|
39
|
-
private readonly
|
|
38
|
+
private readonly scenarioMap;
|
|
39
|
+
private readonly stepMap;
|
|
40
|
+
private readonly testStepMap;
|
|
41
|
+
private readonly pickleStepMap;
|
|
42
|
+
private readonly stepDefinitionMap;
|
|
43
|
+
private readonly testCaseTestStepsResults;
|
|
44
|
+
private readonly pickleMap;
|
|
45
|
+
private readonly hookMap;
|
|
40
46
|
private readonly sourceMap;
|
|
41
|
-
private
|
|
42
|
-
private readonly
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} & SourceLocation): void;
|
|
63
|
-
onTestCaseStarted(data: SourceLocation): void;
|
|
64
|
-
onTestStepAttachment(data: {
|
|
65
|
-
index: number;
|
|
66
|
-
data: string;
|
|
67
|
-
media: {
|
|
68
|
-
type: string;
|
|
69
|
-
};
|
|
70
|
-
testCase: SourceLocation;
|
|
71
|
-
}): void;
|
|
72
|
-
onTestStepFinished(data: {
|
|
73
|
-
index: number;
|
|
74
|
-
result: Result;
|
|
75
|
-
testCase: SourceLocation;
|
|
76
|
-
}): void;
|
|
77
|
-
onTestStepStarted(data: {
|
|
78
|
-
index: number;
|
|
79
|
-
testCase: SourceLocation;
|
|
80
|
-
}): void;
|
|
81
|
-
popStep(): void;
|
|
82
|
-
pushStep(step: AllureStep): void;
|
|
83
|
-
writeAttachment(content: Buffer | string, options: ContentType | string | AttachmentOptions): string;
|
|
84
|
-
private setException;
|
|
47
|
+
private readonly testCaseMap;
|
|
48
|
+
private readonly testCaseStartedMap;
|
|
49
|
+
private readonly allureSteps;
|
|
50
|
+
private runningTestsMap;
|
|
51
|
+
constructor(options: IFormatterOptions, allureRuntime: AllureRuntime, config: CucumberJSAllureFormatterConfig);
|
|
52
|
+
private get tagsIgnorePatterns();
|
|
53
|
+
private parseEnvelope;
|
|
54
|
+
private parseTagsLabels;
|
|
55
|
+
private parseTagsLinks;
|
|
56
|
+
private onGherkinDocument;
|
|
57
|
+
private onScenario;
|
|
58
|
+
private onPickle;
|
|
59
|
+
private onTestCase;
|
|
60
|
+
private onTestCaseStarted;
|
|
61
|
+
private onAttachment;
|
|
62
|
+
private onTestCaseFinished;
|
|
63
|
+
private onHook;
|
|
64
|
+
private onSource;
|
|
65
|
+
private onTestStepStarted;
|
|
66
|
+
private onTestStepFinished;
|
|
67
|
+
private convertStatus;
|
|
85
68
|
}
|