cypress-qase-reporter 2.0.2 → 2.0.3
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 +0 -2
- package/changelog.md +7 -0
- package/dist/child.d.ts +1 -0
- package/dist/child.js +7 -0
- package/dist/reporter.d.ts +8 -1
- package/dist/reporter.js +34 -13
- package/package.json +1 -1
- package/tsconfig.build.json +1 -1
package/README.md
CHANGED
package/changelog.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# cypress-qase-reporter@2.0.3
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Cypress doesn't finish the process after the last test.
|
|
6
|
+
The reporter will wait for all results to be sent to Qase and will not block the process after sending.
|
|
7
|
+
|
|
1
8
|
# cypress-qase-reporter@2.0.2
|
|
2
9
|
|
|
3
10
|
## What's new
|
package/dist/child.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare function runChild(): Promise<void>;
|
package/dist/child.js
ADDED
package/dist/reporter.d.ts
CHANGED
|
@@ -58,8 +58,15 @@ export declare class CypressQaseReporter extends reporters.Base {
|
|
|
58
58
|
*/
|
|
59
59
|
private addTestResult;
|
|
60
60
|
/**
|
|
61
|
+
* @param {Test} test
|
|
62
|
+
* @param {number[]} ids
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
private getSignature;
|
|
66
|
+
/**
|
|
67
|
+
* @param {Suite} suite
|
|
61
68
|
* @private
|
|
62
69
|
*/
|
|
63
|
-
private
|
|
70
|
+
private getFile;
|
|
64
71
|
}
|
|
65
72
|
export {};
|
package/dist/reporter.js
CHANGED
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CypressQaseReporter = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
9
10
|
const mocha_1 = require("mocha");
|
|
10
11
|
const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
11
12
|
const traverse_dir_1 = require("./utils/traverse-dir");
|
|
12
13
|
const configSchema_1 = require("./configSchema");
|
|
13
14
|
const { EVENT_TEST_FAIL, EVENT_TEST_PASS, EVENT_TEST_PENDING, EVENT_RUN_END, EVENT_RUN_BEGIN, } = mocha_1.Runner.constants;
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
15
|
-
const _exit = process.exit;
|
|
16
15
|
/**
|
|
17
16
|
* @class CypressQaseReporter
|
|
18
17
|
* @extends reporters.Base
|
|
@@ -84,11 +83,8 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
|
|
|
84
83
|
runner.on(EVENT_RUN_BEGIN, () => this.reporter.startTestRun());
|
|
85
84
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
86
85
|
runner.once(EVENT_RUN_END, async () => {
|
|
87
|
-
this.preventExit();
|
|
88
86
|
await this.reporter.publish();
|
|
89
|
-
|
|
90
|
-
process.exit(process.exitCode);
|
|
91
|
-
}
|
|
87
|
+
(0, child_process_1.spawnSync)('node', [`${__dirname}/child.js`], { stdio: 'inherit' });
|
|
92
88
|
});
|
|
93
89
|
}
|
|
94
90
|
/**
|
|
@@ -124,7 +120,7 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
|
|
|
124
120
|
params: {},
|
|
125
121
|
relations: relations,
|
|
126
122
|
run_id: null,
|
|
127
|
-
signature:
|
|
123
|
+
signature: this.getSignature(test, ids),
|
|
128
124
|
steps: [],
|
|
129
125
|
id: test.id,
|
|
130
126
|
execution: {
|
|
@@ -143,14 +139,39 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
|
|
|
143
139
|
void this.reporter.addTestResult(result);
|
|
144
140
|
}
|
|
145
141
|
/**
|
|
142
|
+
* @param {Test} test
|
|
143
|
+
* @param {number[]} ids
|
|
146
144
|
* @private
|
|
147
145
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
146
|
+
getSignature(test, ids) {
|
|
147
|
+
let signature = '';
|
|
148
|
+
const file = test.parent ? this.getFile(test.parent) : undefined;
|
|
149
|
+
if (file) {
|
|
150
|
+
signature = file.split('/').join('::');
|
|
151
|
+
}
|
|
152
|
+
if (test.parent) {
|
|
153
|
+
for (const suite of test.parent.titlePath()) {
|
|
154
|
+
signature += '::' + suite.toLowerCase().replace(/\s/g, '_');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
signature += '::' + test.title.toLowerCase().replace(/\s/g, '_');
|
|
158
|
+
if (ids.length > 0) {
|
|
159
|
+
signature += '::' + ids.join('::');
|
|
160
|
+
}
|
|
161
|
+
return signature;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @param {Suite} suite
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
getFile(suite) {
|
|
168
|
+
if (suite.file) {
|
|
169
|
+
return suite.file;
|
|
170
|
+
}
|
|
171
|
+
if (suite.parent) {
|
|
172
|
+
return this.getFile(suite.parent);
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
154
175
|
}
|
|
155
176
|
}
|
|
156
177
|
exports.CypressQaseReporter = CypressQaseReporter;
|
package/package.json
CHANGED
package/tsconfig.build.json
CHANGED