@uuv/cypress 2.21.0 → 2.21.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/CHANGELOG.md +8 -0
- package/dist/lib/runner-cypress.d.ts +0 -1
- package/dist/lib/runner-cypress.js +0 -7
- package/package.json +3 -4
- package/target-config/.cypress-cucumber-preprocessorrc.json +4 -0
- package/target-config/cypress.config.ts +1 -2
- package/dist/cucumber/uuv-custom-formatter.d.ts +0 -6
- package/dist/cucumber/uuv-custom-formatter.js +0 -108
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [2.21.1](https://github.com/Orange-OpenSource/uuv/compare/runner-cypress-v2.21.0...runner-cypress-v2.21.1) (2024-06-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **runner-cypress:** remove e2e.videoUploadOnPasses parameter, [#644](https://github.com/Orange-OpenSource/uuv/issues/644) ([3328e21](https://github.com/Orange-OpenSource/uuv/commit/3328e21a8bf6b7841fe18baa4aa8a05a945ce79d))
|
|
7
|
+
* **runner-cypress:** use badeball depency to generate cucumber json report, [#643](https://github.com/Orange-OpenSource/uuv/issues/643) ([caf36a3](https://github.com/Orange-OpenSource/uuv/commit/caf36a3269ab23a0c9163b45baf49b3a07bba5a6))
|
|
8
|
+
|
|
1
9
|
# [2.21.0](https://github.com/Orange-OpenSource/uuv/compare/runner-cypress-v2.20.0...runner-cypress-v2.21.0) (2024-05-31)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -9,7 +9,6 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
11
|
const junit_report_merger_1 = require("junit-report-merger");
|
|
12
|
-
const uuv_custom_formatter_1 = require("../cucumber/uuv-custom-formatter");
|
|
13
12
|
const multiple_cucumber_html_reporter_1 = __importDefault(require("multiple-cucumber-html-reporter"));
|
|
14
13
|
const cypress_1 = __importDefault(require("cypress"));
|
|
15
14
|
class UUVCliCypressRunner {
|
|
@@ -117,14 +116,8 @@ class UUVCliCypressRunner {
|
|
|
117
116
|
}
|
|
118
117
|
async generateHtmlReport(options, reportDir) {
|
|
119
118
|
console.info(chalk_1.default.blueBright("Generating Html Test Report..."));
|
|
120
|
-
await this.formatCucumberMessageFile(this.JSON_REPORT_DIR, this.CUCUMBER_MESSAGES_FILE);
|
|
121
119
|
this.generateHtmlReportFromJson(options, this.JSON_REPORT_DIR, reportDir);
|
|
122
120
|
}
|
|
123
|
-
async formatCucumberMessageFile(jsonReportDir, cucumberMessageFile) {
|
|
124
|
-
const formatter = new uuv_custom_formatter_1.UuvCustomFormatter();
|
|
125
|
-
const outputFile = `${jsonReportDir}/cucumber-report.json`;
|
|
126
|
-
await formatter.parseCucumberJson(cucumberMessageFile, outputFile);
|
|
127
|
-
}
|
|
128
121
|
generateHtmlReportFromJson(options, jsonReportDir, htmlReportDir) {
|
|
129
122
|
const UNKNOWN_VALUE = "unknown";
|
|
130
123
|
multiple_cucumber_html_reporter_1.default.generate({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuv/cypress",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "Louis Fredice NJAKO MOLOM (https://github.com/luifr10) & Stanley SERVICAL (https://github.com/stanlee974)",
|
|
6
6
|
"description": "A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and cypress",
|
|
@@ -46,11 +46,10 @@
|
|
|
46
46
|
"@badeball/cypress-cucumber-preprocessor": "20.0.5",
|
|
47
47
|
"@cypress/webpack-preprocessor": "6.0.1",
|
|
48
48
|
"@testing-library/cypress": "10.0.1",
|
|
49
|
-
"@uuv/a11y": "1.0.0-beta.
|
|
50
|
-
"@uuv/runner-commons": "2.16.
|
|
49
|
+
"@uuv/a11y": "1.0.0-beta.29",
|
|
50
|
+
"@uuv/runner-commons": "2.16.1",
|
|
51
51
|
"axe-core": "4.9.1",
|
|
52
52
|
"chai-subset": "^1.6.0",
|
|
53
|
-
"cucumber-json-report-formatter": "0.1.4",
|
|
54
53
|
"cypress": "13.10.0",
|
|
55
54
|
"cypress-axe": "1.5.0",
|
|
56
55
|
"cypress-real-events": "^1.10.0",
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UuvCustomFormatter = void 0;
|
|
4
|
-
const cucumber_json_report_formatter_1 = require("cucumber-json-report-formatter");
|
|
5
|
-
// FIXME remove this class when the PR https://github.com/vrymar/cucumber-json-report-formatter/pull/20 will be merged
|
|
6
|
-
class UuvCustomFormatter extends cucumber_json_report_formatter_1.Formatter {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
}
|
|
10
|
-
async parseCucumberJson(sourceFile, outputFile) {
|
|
11
|
-
console.info(`Start formatting file '${sourceFile}' into '${outputFile}'`);
|
|
12
|
-
const report = await this.helper.readFileIntoJson(sourceFile);
|
|
13
|
-
const gherkinDocumentJson = this.helper.getJsonFromArray(report, "gherkinDocument");
|
|
14
|
-
const cucumberReport = [];
|
|
15
|
-
gherkinDocumentJson.forEach(gherkinJson => {
|
|
16
|
-
let gherkinDocument;
|
|
17
|
-
try {
|
|
18
|
-
gherkinDocument = JSON.parse(gherkinJson).gherkinDocument;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
console.error("Error parsing JSON string.", err);
|
|
22
|
-
}
|
|
23
|
-
const feature = gherkinDocument.feature;
|
|
24
|
-
const featureChildren = feature.children;
|
|
25
|
-
const scenariosJson = [];
|
|
26
|
-
const background = {};
|
|
27
|
-
featureChildren.forEach(featureChild => {
|
|
28
|
-
if (featureChild.rule) {
|
|
29
|
-
featureChild.rule.steps = [];
|
|
30
|
-
featureChild.rule.children.forEach(ruleChildren => {
|
|
31
|
-
this.buildAndAddScenario(ruleChildren, report, background, feature, scenariosJson, featureChild.rule);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
this.buildAndAddScenario(featureChild, report, background, feature, scenariosJson, undefined);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const rootJson = {
|
|
39
|
-
comments: this.getComments(gherkinDocument.comments),
|
|
40
|
-
description: gherkinDocument.feature.description,
|
|
41
|
-
elements: scenariosJson,
|
|
42
|
-
id: feature.name,
|
|
43
|
-
keyword: feature.keyword,
|
|
44
|
-
line: feature.location.line,
|
|
45
|
-
name: feature.name,
|
|
46
|
-
uri: gherkinDocument.uri,
|
|
47
|
-
tags: this.getTags(gherkinDocument.feature.tags)
|
|
48
|
-
};
|
|
49
|
-
cucumberReport.push(rootJson);
|
|
50
|
-
});
|
|
51
|
-
await this.validateReportSchema(report);
|
|
52
|
-
const reportString = JSON.stringify(cucumberReport);
|
|
53
|
-
console.info(`Finished formatting file '${sourceFile}'`);
|
|
54
|
-
this.helper.writeFile(outputFile, reportString);
|
|
55
|
-
}
|
|
56
|
-
buildAndAddScenario(child, report, background, feature, scenariosJson, rule) {
|
|
57
|
-
let steps = [];
|
|
58
|
-
let stepJson = {};
|
|
59
|
-
// Background
|
|
60
|
-
if (child.scenario === undefined) {
|
|
61
|
-
child.background.steps.forEach(step => {
|
|
62
|
-
stepJson = this.createStepJson(step, report, 0);
|
|
63
|
-
steps.push(stepJson);
|
|
64
|
-
});
|
|
65
|
-
background = this.createScenarioJson(feature, child.background, steps, "background");
|
|
66
|
-
// eslint-disable-next-line brace-style
|
|
67
|
-
}
|
|
68
|
-
// Normal Scenario
|
|
69
|
-
else if (!child.scenario.keyword.includes("Outline")) {
|
|
70
|
-
child.scenario.steps.forEach(step => {
|
|
71
|
-
stepJson = this.createStepJson(step, report, 0);
|
|
72
|
-
steps.push(stepJson);
|
|
73
|
-
});
|
|
74
|
-
const scenario = this.createScenarioJson(feature, child.scenario, steps, "scenario");
|
|
75
|
-
if (rule) {
|
|
76
|
-
scenario.id = `${feature.name};${rule.name};${scenario.name}`;
|
|
77
|
-
}
|
|
78
|
-
if (Object.keys(background).length !== 0 && background !== undefined) {
|
|
79
|
-
scenariosJson.push(background);
|
|
80
|
-
}
|
|
81
|
-
scenariosJson.push(scenario);
|
|
82
|
-
} /* Scenario Outline */
|
|
83
|
-
else if (child.scenario.examples[0].tableBody !== undefined) {
|
|
84
|
-
const numberOfExecutions = child.scenario.examples[0].tableBody.length;
|
|
85
|
-
const numberOfStepsEachExecution = child.scenario.steps.length;
|
|
86
|
-
let scenarioIndex = 0;
|
|
87
|
-
while (scenarioIndex < numberOfExecutions) {
|
|
88
|
-
let currentStep = 0;
|
|
89
|
-
steps = [];
|
|
90
|
-
while (currentStep < numberOfStepsEachExecution) {
|
|
91
|
-
stepJson = this.createStepJson(child.scenario.steps[currentStep], report, scenarioIndex);
|
|
92
|
-
currentStep++;
|
|
93
|
-
steps.push(stepJson);
|
|
94
|
-
}
|
|
95
|
-
const scenario = this.createScenarioJson(feature, child.scenario, steps, "scenario", scenarioIndex);
|
|
96
|
-
if (rule) {
|
|
97
|
-
scenario.id = `${feature.name};${rule.name};${scenario.name}`;
|
|
98
|
-
}
|
|
99
|
-
if (Object.keys(background).length !== 0 && background !== undefined) {
|
|
100
|
-
scenariosJson.push(background);
|
|
101
|
-
}
|
|
102
|
-
scenariosJson.push(scenario);
|
|
103
|
-
scenarioIndex++;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.UuvCustomFormatter = UuvCustomFormatter;
|