allure-cucumberjs 2.15.1 → 3.0.0-beta.2
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 +123 -129
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/legacy.js +121 -0
- package/dist/cjs/legacy.js.map +1 -0
- package/dist/cjs/model.js +2 -0
- package/dist/cjs/model.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/reporter.js +385 -0
- package/dist/cjs/reporter.js.map +1 -0
- package/dist/cjs/runtime.js +38 -0
- package/dist/cjs/runtime.js.map +1 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/legacy.js +113 -0
- package/dist/esm/legacy.js.map +1 -0
- package/dist/esm/model.js +2 -0
- package/dist/esm/model.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/reporter.js +377 -0
- package/dist/esm/reporter.js.map +1 -0
- package/dist/esm/runtime.js +31 -0
- package/dist/esm/runtime.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/legacy.d.ts +128 -0
- package/dist/types/model.d.ts +16 -0
- package/dist/types/reporter.d.ts +38 -0
- package/dist/types/runtime.d.ts +10 -0
- package/package.json +47 -25
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -14
- package/dist/index.js.map +0 -1
- package/dist/src/CucumberAllureWorld.d.ts +0 -25
- package/dist/src/CucumberAllureWorld.js +0 -103
- package/dist/src/CucumberAllureWorld.js.map +0 -1
- package/dist/src/CucumberJSAllureReporter.d.ts +0 -59
- package/dist/src/CucumberJSAllureReporter.js +0 -396
- package/dist/src/CucumberJSAllureReporter.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { World } from "@cucumber/cucumber";
|
|
3
|
+
import type { ParameterOptions } from "allure-js-commons";
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated please use api exported by "allure-js-commons" instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface AllureCucumberLegacyApi {
|
|
8
|
+
label: (name: string, value: string) => Promise<void>;
|
|
9
|
+
link: (type: string, url: string, name?: string) => Promise<void>;
|
|
10
|
+
parameter: (name: string, value: string, options?: ParameterOptions) => Promise<void>;
|
|
11
|
+
description: (markdown: string) => Promise<void>;
|
|
12
|
+
descriptionHtml: (html: string) => Promise<void>;
|
|
13
|
+
testCaseId: (id: string) => Promise<void>;
|
|
14
|
+
historyId: (id: string) => Promise<void>;
|
|
15
|
+
allureId: (id: string) => Promise<void>;
|
|
16
|
+
displayName: (name: string) => Promise<void>;
|
|
17
|
+
attachment: (name: string, content: Buffer | string, type: string) => Promise<void>;
|
|
18
|
+
issue: (name: string, url: string) => Promise<void>;
|
|
19
|
+
tms: (name: string, url: string) => Promise<void>;
|
|
20
|
+
epic: (name: string) => Promise<void>;
|
|
21
|
+
feature: (name: string) => Promise<void>;
|
|
22
|
+
story: (name: string) => Promise<void>;
|
|
23
|
+
suite: (name: string) => Promise<void>;
|
|
24
|
+
parentSuite: (name: string) => Promise<void>;
|
|
25
|
+
subSuite: (name: string) => Promise<void>;
|
|
26
|
+
owner: (name: string) => Promise<void>;
|
|
27
|
+
severity: (name: string) => Promise<void>;
|
|
28
|
+
layer: (name: string) => Promise<void>;
|
|
29
|
+
tag: (name: string) => Promise<void>;
|
|
30
|
+
step: (name: string, body: () => Promise<void>) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated please use api exported by "allure-js-commons" instead.
|
|
34
|
+
*/
|
|
35
|
+
export declare class AllureCucumberWorld extends World implements AllureCucumberLegacyApi {
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated please use import { label } from "allure-js-commons" instead.
|
|
38
|
+
*/
|
|
39
|
+
label: (name: string, value: string) => Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated please use import { link } from "allure-js-commons" instead.
|
|
42
|
+
*/
|
|
43
|
+
link: (type: string, url: string, name?: string) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated please use import { parameter } from "allure-js-commons" instead.
|
|
46
|
+
*/
|
|
47
|
+
parameter: (name: string, value: string, options?: ParameterOptions) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated please use import { description } from "allure-js-commons" instead.
|
|
50
|
+
*/
|
|
51
|
+
description: (value: string) => Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated please use import { descriptionHtml } from "allure-js-commons" instead.
|
|
54
|
+
*/
|
|
55
|
+
descriptionHtml: (html: string) => Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated please use import { testCaseId } from "allure-js-commons" instead.
|
|
58
|
+
*/
|
|
59
|
+
testCaseId: (id: string) => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated please use import { historyId } from "allure-js-commons" instead.
|
|
62
|
+
*/
|
|
63
|
+
historyId: (id: string) => Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated please use import { allureId } from "allure-js-commons" instead.
|
|
66
|
+
*/
|
|
67
|
+
allureId: (id: string) => Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated please use import { displayName } from "allure-js-commons" instead.
|
|
70
|
+
*/
|
|
71
|
+
displayName: (name: string) => Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated please use import { attachment } from "allure-js-commons" instead.
|
|
74
|
+
*/
|
|
75
|
+
attachment: (name: string, content: Buffer | string, type: string) => Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated please use import { issue } from "allure-js-commons" instead.
|
|
78
|
+
*/
|
|
79
|
+
issue: (name: string, url: string) => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated please use import { tms } from "allure-js-commons" instead.
|
|
82
|
+
*/
|
|
83
|
+
tms: (name: string, url: string) => Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated please use import { epic } from "allure-js-commons" instead.
|
|
86
|
+
*/
|
|
87
|
+
epic: (name: string) => Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated please use import { feature } from "allure-js-commons" instead.
|
|
90
|
+
*/
|
|
91
|
+
feature: (name: string) => Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated please use import { story } from "allure-js-commons" instead.
|
|
94
|
+
*/
|
|
95
|
+
story: (name: string) => Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated please use import { suite } from "allure-js-commons" instead.
|
|
98
|
+
*/
|
|
99
|
+
suite: (name: string) => Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated please use import { parentSuite } from "allure-js-commons" instead.
|
|
102
|
+
*/
|
|
103
|
+
parentSuite: (name: string) => Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated please use import { subSuite } from "allure-js-commons" instead.
|
|
106
|
+
*/
|
|
107
|
+
subSuite: (name: string) => Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated please use import { owner } from "allure-js-commons" instead.
|
|
110
|
+
*/
|
|
111
|
+
owner: (name: string) => Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated please use import { severity } from "allure-js-commons" instead.
|
|
114
|
+
*/
|
|
115
|
+
severity: (name: string) => Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated please use import { layer } from "allure-js-commons" instead.
|
|
118
|
+
*/
|
|
119
|
+
layer: (name: string) => Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated please use import { tag } from "allure-js-commons" instead.
|
|
122
|
+
*/
|
|
123
|
+
tag: (name: string) => Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated please use import { step } from "allure-js-commons" instead.
|
|
126
|
+
*/
|
|
127
|
+
step: (name: string, body: () => any) => Promise<void>;
|
|
128
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LabelName, LinkType } from "allure-js-commons";
|
|
2
|
+
import type { Config } from "allure-js-commons/sdk/reporter";
|
|
3
|
+
export type LabelConfig = {
|
|
4
|
+
pattern: RegExp[];
|
|
5
|
+
name: LabelName | string;
|
|
6
|
+
};
|
|
7
|
+
export type LinkConfig = {
|
|
8
|
+
pattern: RegExp[];
|
|
9
|
+
urlTemplate: string;
|
|
10
|
+
type: LinkType | string;
|
|
11
|
+
};
|
|
12
|
+
export interface AllureCucumberReporterConfig extends Omit<Config, "writer" | "links"> {
|
|
13
|
+
testMode?: boolean;
|
|
14
|
+
links?: LinkConfig[];
|
|
15
|
+
labels?: LabelConfig[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IFormatterOptions } from "@cucumber/cucumber";
|
|
2
|
+
import { Formatter } from "@cucumber/cucumber";
|
|
3
|
+
export default class AllureCucumberReporter extends Formatter {
|
|
4
|
+
private readonly afterHooks;
|
|
5
|
+
private readonly beforeHooks;
|
|
6
|
+
private linksConfigs;
|
|
7
|
+
private labelsConfigs;
|
|
8
|
+
private runtime;
|
|
9
|
+
private readonly documentMap;
|
|
10
|
+
private readonly scenarioMap;
|
|
11
|
+
private readonly stepMap;
|
|
12
|
+
private readonly testStepMap;
|
|
13
|
+
private readonly pickleStepMap;
|
|
14
|
+
private readonly testCaseTestStepsResults;
|
|
15
|
+
private readonly pickleMap;
|
|
16
|
+
private readonly hookMap;
|
|
17
|
+
private readonly testCaseMap;
|
|
18
|
+
private readonly testCaseStartedMap;
|
|
19
|
+
private readonly allureResultsUuids;
|
|
20
|
+
constructor(options: IFormatterOptions);
|
|
21
|
+
private get tagsIgnorePatterns();
|
|
22
|
+
private parseEnvelope;
|
|
23
|
+
private parseTagsLabels;
|
|
24
|
+
private parsePickleTags;
|
|
25
|
+
private parseTagsLinks;
|
|
26
|
+
private parseStatus;
|
|
27
|
+
private onRule;
|
|
28
|
+
private onGherkinDocument;
|
|
29
|
+
private onScenario;
|
|
30
|
+
private onPickle;
|
|
31
|
+
private onTestCase;
|
|
32
|
+
private onTestCaseStarted;
|
|
33
|
+
private onTestCaseFinished;
|
|
34
|
+
private onTestStepStarted;
|
|
35
|
+
private onTestStepFinished;
|
|
36
|
+
private onHook;
|
|
37
|
+
private onAttachment;
|
|
38
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IWorld, IWorldOptions } from "@cucumber/cucumber";
|
|
2
|
+
import type { RuntimeMessage } from "allure-js-commons/sdk";
|
|
3
|
+
import { MessageTestRuntime } from "allure-js-commons/sdk/runtime";
|
|
4
|
+
export declare class AllureCucumberTestRuntime extends MessageTestRuntime implements IWorld {
|
|
5
|
+
readonly attach: IWorldOptions["attach"];
|
|
6
|
+
readonly log: IWorldOptions["log"];
|
|
7
|
+
readonly parameters: IWorldOptions["parameters"];
|
|
8
|
+
constructor({ attach, log, parameters }: IWorldOptions);
|
|
9
|
+
sendMessage(message: RuntimeMessage): Promise<void>;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-cucumberjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"description": "Allure Cucumber.JS integration",
|
|
5
5
|
"homepage": "https://allurereport.org/",
|
|
6
6
|
"repository": {
|
|
@@ -14,56 +14,78 @@
|
|
|
14
14
|
"email": "allure@qameta.io",
|
|
15
15
|
"url": "https://qameta.io/"
|
|
16
16
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/esm/index.js",
|
|
20
|
+
"require": "./dist/cjs/index.js",
|
|
21
|
+
"types": "./dist/types/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./reporter": {
|
|
24
|
+
"import": "./dist/esm/reporter.js",
|
|
25
|
+
"require": "./dist/cjs/reporter.js",
|
|
26
|
+
"types": "./dist/types/reporter.d.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/cjs/index.js",
|
|
30
|
+
"module": "./dist/esm/index.js",
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
19
32
|
"files": [
|
|
20
|
-
"dist
|
|
21
|
-
"dist/index.*"
|
|
33
|
+
"dist"
|
|
22
34
|
],
|
|
23
35
|
"scripts": {
|
|
24
36
|
"clean": "rimraf ./dist ./out",
|
|
25
|
-
"compile": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
37
|
+
"compile": "run-s 'compile:*'",
|
|
38
|
+
"compile:esm": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps",
|
|
39
|
+
"compile:cjs": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions '.ts' --source-maps",
|
|
40
|
+
"compile:types": "tsc",
|
|
41
|
+
"compile:fixup": "node ./scripts/fixup.mjs",
|
|
42
|
+
"lint": "eslint ./src ./test --ext .ts",
|
|
43
|
+
"lint:fix": "eslint --fix ./src ./test --ext .ts",
|
|
44
|
+
"test": "vitest run"
|
|
30
45
|
},
|
|
31
46
|
"dependencies": {
|
|
32
|
-
"@cucumber/cucumber": "^
|
|
33
|
-
"@cucumber/gherkin": "^
|
|
47
|
+
"@cucumber/cucumber": "^10.4.0",
|
|
48
|
+
"@cucumber/gherkin": "^28.0.0",
|
|
34
49
|
"@cucumber/gherkin-streams": "^5.0.1",
|
|
35
|
-
"@cucumber/gherkin-utils": "^
|
|
50
|
+
"@cucumber/gherkin-utils": "^9.0.0",
|
|
36
51
|
"@cucumber/message-streams": "^4.0.1",
|
|
37
|
-
"@cucumber/messages": "^
|
|
38
|
-
"allure-js-commons": "
|
|
52
|
+
"@cucumber/messages": "^24.1.0",
|
|
53
|
+
"allure-js-commons": "3.0.0-beta.2"
|
|
39
54
|
},
|
|
40
55
|
"devDependencies": {
|
|
56
|
+
"@babel/cli": "^7.24.6",
|
|
57
|
+
"@babel/core": "^7.24.6",
|
|
58
|
+
"@babel/plugin-transform-modules-commonjs": "^7.24.6",
|
|
59
|
+
"@babel/preset-env": "^7.24.6",
|
|
60
|
+
"@babel/preset-typescript": "^7.24.6",
|
|
61
|
+
"@types/babel__core": "^7",
|
|
62
|
+
"@types/babel__preset-env": "^7",
|
|
41
63
|
"@types/chai": "^4.3.6",
|
|
42
64
|
"@types/chai-like": "^1.1.1",
|
|
43
65
|
"@types/chai-things": "^0.0.36",
|
|
44
66
|
"@types/eslint": "^8",
|
|
45
67
|
"@types/glob": "^8.1.0",
|
|
46
|
-
"@types/mocha": "^10.0.1",
|
|
47
68
|
"@types/node": "^20.6.3",
|
|
48
69
|
"@types/sinon": "^17.0.0",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
50
|
-
"@typescript-eslint/parser": "^
|
|
51
|
-
"allure-
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
71
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
72
|
+
"allure-vitest": "^3.0.0-beta.2",
|
|
73
|
+
"babel-plugin-add-module-exports": "^1.0.4",
|
|
52
74
|
"chai": "^4.3.8",
|
|
53
75
|
"chai-like": "^1.1.1",
|
|
54
76
|
"chai-things": "^0.2.0",
|
|
55
|
-
"eslint": "^8.
|
|
77
|
+
"eslint": "^8.57.0",
|
|
56
78
|
"eslint-config-prettier": "^9.0.0",
|
|
57
79
|
"eslint-plugin-import": "^2.28.1",
|
|
58
80
|
"eslint-plugin-jsdoc": "^48.0.0",
|
|
81
|
+
"eslint-plugin-n": "^17.0.0",
|
|
59
82
|
"eslint-plugin-no-null": "^1.0.2",
|
|
60
83
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
61
|
-
"
|
|
62
|
-
"mocha": "^10.2.0",
|
|
63
|
-
"mocha-multi-reporters": "^1.5.1",
|
|
84
|
+
"npm-run-all2": "^6.1.2",
|
|
64
85
|
"rimraf": "^5.0.1",
|
|
65
|
-
"sinon": "^
|
|
86
|
+
"sinon": "^18.0.0",
|
|
66
87
|
"ts-node": "^10.9.1",
|
|
67
|
-
"typescript": "^5.2.2"
|
|
88
|
+
"typescript": "^5.2.2",
|
|
89
|
+
"vitest": "^1.4.0"
|
|
68
90
|
}
|
|
69
91
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { Allure, CucumberJSAllureFormatter, CucumberJSAllureFormatterConfig } from "./src/CucumberJSAllureReporter";
|
|
2
|
-
export { CucumberAllureWorld } from "./src/CucumberAllureWorld";
|
|
3
|
-
export { AllureRuntime, AllureConfig, ContentType, Severity, ExecutorInfo, Category } from "allure-js-commons";
|
package/dist/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Severity = exports.ContentType = exports.AllureRuntime = exports.CucumberAllureWorld = exports.CucumberJSAllureFormatterConfig = exports.CucumberJSAllureFormatter = exports.Allure = void 0;
|
|
4
|
-
var CucumberJSAllureReporter_1 = require("./src/CucumberJSAllureReporter");
|
|
5
|
-
Object.defineProperty(exports, "Allure", { enumerable: true, get: function () { return CucumberJSAllureReporter_1.Allure; } });
|
|
6
|
-
Object.defineProperty(exports, "CucumberJSAllureFormatter", { enumerable: true, get: function () { return CucumberJSAllureReporter_1.CucumberJSAllureFormatter; } });
|
|
7
|
-
Object.defineProperty(exports, "CucumberJSAllureFormatterConfig", { enumerable: true, get: function () { return CucumberJSAllureReporter_1.CucumberJSAllureFormatterConfig; } });
|
|
8
|
-
var CucumberAllureWorld_1 = require("./src/CucumberAllureWorld");
|
|
9
|
-
Object.defineProperty(exports, "CucumberAllureWorld", { enumerable: true, get: function () { return CucumberAllureWorld_1.CucumberAllureWorld; } });
|
|
10
|
-
var allure_js_commons_1 = require("allure-js-commons");
|
|
11
|
-
Object.defineProperty(exports, "AllureRuntime", { enumerable: true, get: function () { return allure_js_commons_1.AllureRuntime; } });
|
|
12
|
-
Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return allure_js_commons_1.ContentType; } });
|
|
13
|
-
Object.defineProperty(exports, "Severity", { enumerable: true, get: function () { return allure_js_commons_1.Severity; } });
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,2EAEwC;AADtC,kHAAA,MAAM,OAAA;AAAE,qIAAA,yBAAyB,OAAA;AAAE,2IAAA,+BAA+B,OAAA;AAEpE,iEAEmC;AADjC,0HAAA,mBAAmB,OAAA;AAErB,uDAE2B;AADzB,kHAAA,aAAa,OAAA;AAAgB,gHAAA,WAAW,OAAA;AAAE,6GAAA,QAAQ,OAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { World } from "@cucumber/cucumber";
|
|
2
|
-
import { AllureCommandStep, ParameterOptions, StepBodyFunction } from "allure-js-commons";
|
|
3
|
-
type AllureWorld = Omit<AllureCommandStep, "attach" | "name" | "attachments" | "metadata">;
|
|
4
|
-
export declare class CucumberAllureWorld extends World implements AllureWorld {
|
|
5
|
-
label(label: string, value: string): Promise<void>;
|
|
6
|
-
link(url: string, name?: string, type?: string): Promise<void>;
|
|
7
|
-
parameter(name: string, value: any, options?: ParameterOptions): Promise<void>;
|
|
8
|
-
description(markdown: string): Promise<void>;
|
|
9
|
-
descriptionHtml(html: string): Promise<void>;
|
|
10
|
-
step(name: string, body: StepBodyFunction): Promise<void>;
|
|
11
|
-
id(allureId: string): Promise<void>;
|
|
12
|
-
epic(epic: string): Promise<void>;
|
|
13
|
-
layer(layer: string): Promise<void>;
|
|
14
|
-
feature(feature: string): Promise<void>;
|
|
15
|
-
story(story: string): Promise<void>;
|
|
16
|
-
suite(name: string): Promise<void>;
|
|
17
|
-
parentSuite(name: string): Promise<void>;
|
|
18
|
-
subSuite(name: string): Promise<void>;
|
|
19
|
-
owner(owner: string): Promise<void>;
|
|
20
|
-
severity(severity: string): Promise<void>;
|
|
21
|
-
tag(tag: string): Promise<void>;
|
|
22
|
-
issue(name: string, url: string): Promise<void>;
|
|
23
|
-
tms(name: string, url: string): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CucumberAllureWorld = void 0;
|
|
4
|
-
const cucumber_1 = require("@cucumber/cucumber");
|
|
5
|
-
const allure_js_commons_1 = require("allure-js-commons");
|
|
6
|
-
const internal_1 = require("allure-js-commons/internal");
|
|
7
|
-
class CucumberAllureWorld extends cucumber_1.World {
|
|
8
|
-
async label(label, value) {
|
|
9
|
-
const msgBody = {
|
|
10
|
-
labels: [
|
|
11
|
-
{
|
|
12
|
-
name: label,
|
|
13
|
-
value,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
};
|
|
17
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
18
|
-
}
|
|
19
|
-
async link(url, name, type) {
|
|
20
|
-
const msgBody = {
|
|
21
|
-
links: [
|
|
22
|
-
{
|
|
23
|
-
name,
|
|
24
|
-
url,
|
|
25
|
-
type,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
};
|
|
29
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
30
|
-
}
|
|
31
|
-
async parameter(name, value, options) {
|
|
32
|
-
const msgBody = {
|
|
33
|
-
parameter: [
|
|
34
|
-
{
|
|
35
|
-
name,
|
|
36
|
-
value: JSON.stringify(value),
|
|
37
|
-
excluded: (options === null || options === void 0 ? void 0 : options.excluded) || false,
|
|
38
|
-
mode: options === null || options === void 0 ? void 0 : options.mode,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
};
|
|
42
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
43
|
-
}
|
|
44
|
-
async description(markdown) {
|
|
45
|
-
const msgBody = {
|
|
46
|
-
description: markdown,
|
|
47
|
-
};
|
|
48
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
49
|
-
}
|
|
50
|
-
async descriptionHtml(html) {
|
|
51
|
-
const msgBody = {
|
|
52
|
-
descriptionHtml: html,
|
|
53
|
-
};
|
|
54
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
55
|
-
}
|
|
56
|
-
async step(name, body) {
|
|
57
|
-
const testStep = new allure_js_commons_1.AllureCommandStepExecutable(name);
|
|
58
|
-
await testStep.run(body, async (msgBody) => {
|
|
59
|
-
await this.attach(JSON.stringify(msgBody), internal_1.ALLURE_METADATA_CONTENT_TYPE);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async id(allureId) {
|
|
63
|
-
await this.label(allure_js_commons_1.LabelName.ALLURE_ID, allureId);
|
|
64
|
-
}
|
|
65
|
-
async epic(epic) {
|
|
66
|
-
await this.label(allure_js_commons_1.LabelName.EPIC, epic);
|
|
67
|
-
}
|
|
68
|
-
async layer(layer) {
|
|
69
|
-
await this.label(allure_js_commons_1.LabelName.LAYER, layer);
|
|
70
|
-
}
|
|
71
|
-
async feature(feature) {
|
|
72
|
-
await this.label(allure_js_commons_1.LabelName.FEATURE, feature);
|
|
73
|
-
}
|
|
74
|
-
async story(story) {
|
|
75
|
-
await this.label(allure_js_commons_1.LabelName.STORY, story);
|
|
76
|
-
}
|
|
77
|
-
async suite(name) {
|
|
78
|
-
await this.label(allure_js_commons_1.LabelName.SUITE, name);
|
|
79
|
-
}
|
|
80
|
-
async parentSuite(name) {
|
|
81
|
-
await this.label(allure_js_commons_1.LabelName.PARENT_SUITE, name);
|
|
82
|
-
}
|
|
83
|
-
async subSuite(name) {
|
|
84
|
-
await this.label(allure_js_commons_1.LabelName.SUB_SUITE, name);
|
|
85
|
-
}
|
|
86
|
-
async owner(owner) {
|
|
87
|
-
await this.label(allure_js_commons_1.LabelName.OWNER, owner);
|
|
88
|
-
}
|
|
89
|
-
async severity(severity) {
|
|
90
|
-
await this.label(allure_js_commons_1.LabelName.SEVERITY, severity);
|
|
91
|
-
}
|
|
92
|
-
async tag(tag) {
|
|
93
|
-
await this.label(allure_js_commons_1.LabelName.TAG, tag);
|
|
94
|
-
}
|
|
95
|
-
async issue(name, url) {
|
|
96
|
-
await this.link(url, name, allure_js_commons_1.LinkType.ISSUE);
|
|
97
|
-
}
|
|
98
|
-
async tms(name, url) {
|
|
99
|
-
await this.link(url, name, allure_js_commons_1.LinkType.TMS);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.CucumberAllureWorld = CucumberAllureWorld;
|
|
103
|
-
//# sourceMappingURL=CucumberAllureWorld.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CucumberAllureWorld.js","sourceRoot":"","sources":["../../src/CucumberAllureWorld.ts"],"names":[],"mappings":";;;AAAA,iDAA2C;AAC3C,yDAQ2B;AAC3B,yDAA0E;AAI1E,MAAa,mBAAoB,SAAQ,gBAAK;IACrC,KAAK,CAAC,KAAK,CAAC,KAAa,EAAE,KAAa;QAC7C,MAAM,OAAO,GAAoB;YAC/B,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,KAAK;oBACX,KAAK;iBACN;aACF;SACF,CAAC;QAGF,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,uCAA4B,CAAC,CAAC;IAC3E,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,GAAW,EAAE,IAAa,EAAE,IAAa;QACzD,MAAM,OAAO,GAAoB;YAC/B,KAAK,EAAE;gBACL;oBACE,IAAI;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CAAC,KAAK,CAAC,6BAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,QAAgB;QACpC,MAAM,IAAI,CAAC,KAAK,CAAC,6BAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAW;QAC1B,MAAM,IAAI,CAAC,KAAK,CAAC,6BAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,GAAW;QAC1C,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,4BAAQ,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,GAAW;QACxC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,4BAAQ,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;CACF;AA5HD,kDA4HC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Formatter } from "@cucumber/cucumber";
|
|
2
|
-
import { IFormatterOptions } from "@cucumber/cucumber/lib/formatter";
|
|
3
|
-
import { Allure, AllureRuntime } from "allure-js-commons";
|
|
4
|
-
export { Allure };
|
|
5
|
-
export type LabelMatcher = {
|
|
6
|
-
pattern: RegExp[];
|
|
7
|
-
name: "epic" | "severity" | string;
|
|
8
|
-
};
|
|
9
|
-
export type LinkMatcher = {
|
|
10
|
-
pattern: RegExp[];
|
|
11
|
-
urlTemplate: string;
|
|
12
|
-
type: "tms" | "issue" | string;
|
|
13
|
-
};
|
|
14
|
-
export declare class CucumberJSAllureFormatterConfig {
|
|
15
|
-
exceptionFormatter?: (message: string) => string;
|
|
16
|
-
labels?: LabelMatcher[];
|
|
17
|
-
links?: LinkMatcher[];
|
|
18
|
-
}
|
|
19
|
-
export declare class CucumberJSAllureFormatter extends Formatter {
|
|
20
|
-
private readonly allureRuntime;
|
|
21
|
-
private readonly currentTestsMap;
|
|
22
|
-
private readonly hostname;
|
|
23
|
-
private readonly afterHooks;
|
|
24
|
-
private readonly beforeHooks;
|
|
25
|
-
private readonly exceptionFormatter;
|
|
26
|
-
private readonly labelsMatchers;
|
|
27
|
-
private readonly linksMatchers;
|
|
28
|
-
private readonly documentMap;
|
|
29
|
-
private readonly scenarioMap;
|
|
30
|
-
private readonly stepMap;
|
|
31
|
-
private readonly testStepMap;
|
|
32
|
-
private readonly pickleStepMap;
|
|
33
|
-
private readonly testCaseTestStepsResults;
|
|
34
|
-
private readonly pickleMap;
|
|
35
|
-
private readonly hookMap;
|
|
36
|
-
private readonly sourceMap;
|
|
37
|
-
private readonly testCaseMap;
|
|
38
|
-
private readonly testCaseStartedMap;
|
|
39
|
-
private readonly allureSteps;
|
|
40
|
-
constructor(options: IFormatterOptions, allureRuntime: AllureRuntime, config: CucumberJSAllureFormatterConfig);
|
|
41
|
-
private get tagsIgnorePatterns();
|
|
42
|
-
private parseEnvelope;
|
|
43
|
-
private parseTagsLabels;
|
|
44
|
-
private parseTagsLinks;
|
|
45
|
-
private onGherkinDocument;
|
|
46
|
-
private onRule;
|
|
47
|
-
private onScenario;
|
|
48
|
-
private onPickle;
|
|
49
|
-
private onTestCase;
|
|
50
|
-
private onTestCaseStarted;
|
|
51
|
-
private onAttachment;
|
|
52
|
-
private handleAllureAttachment;
|
|
53
|
-
private onTestCaseFinished;
|
|
54
|
-
private onHook;
|
|
55
|
-
private onSource;
|
|
56
|
-
private onTestStepStarted;
|
|
57
|
-
private onTestStepFinished;
|
|
58
|
-
private convertStatus;
|
|
59
|
-
}
|