cypress-qase-reporter 2.2.0 → 2.2.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 +3 -0
- package/changelog.md +20 -0
- package/dist/metadata/manager.d.ts +1 -0
- package/dist/metadata/manager.js +5 -5
- package/dist/reporter.d.ts +6 -0
- package/dist/reporter.js +13 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -98,6 +98,9 @@ parameterize your tests.
|
|
|
98
98
|
- `qase.groupParameters` - set the group parameters of the test case
|
|
99
99
|
- `qase.ignore` - ignore the test case in Qase. The test will be executed, but the results will not be sent to Qase.
|
|
100
100
|
- `qase.step` - create a step in the test case
|
|
101
|
+
- `qase.attach` - attach a file or content to the test case
|
|
102
|
+
|
|
103
|
+
For detailed instructions on using annotations and methods, refer to [Usage](docs/usage.md).
|
|
101
104
|
|
|
102
105
|
For example:
|
|
103
106
|
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# cypress-qase-reporter@2.2.2
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Fixed an issue with metadata. When specifying the path to the Cypress config located outside the root directory, metadata was not added to the test case.
|
|
6
|
+
|
|
7
|
+
# cypress-qase-reporter@2.2.1
|
|
8
|
+
|
|
9
|
+
## What's new
|
|
10
|
+
|
|
11
|
+
When specifying test names, QaseIDs are now excluded from the final test name.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
// The test name will be 'Example', not 'Example (Qase ID: 1)'
|
|
15
|
+
qase(1,it('Example', () => {
|
|
16
|
+
expect(true).to.equal(true);
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
```
|
|
20
|
+
|
|
1
21
|
# cypress-qase-reporter@2.2.0
|
|
2
22
|
|
|
3
23
|
## What's new
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Attach, Metadata } from './models';
|
|
2
2
|
import { Attachment } from 'qase-javascript-commons';
|
|
3
3
|
export declare class MetadataManager {
|
|
4
|
+
static metadataPath: string;
|
|
4
5
|
static getMetadata(): Metadata | undefined;
|
|
5
6
|
static setIgnore(): void;
|
|
6
7
|
static addStepStart(name: string): void;
|
package/dist/metadata/manager.js
CHANGED
|
@@ -8,7 +8,6 @@ const fs_1 = require("fs");
|
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
11
|
-
const metadataPath = 'qaseMetadata';
|
|
12
11
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
13
12
|
class MetadataManager {
|
|
14
13
|
static getMetadata() {
|
|
@@ -30,7 +29,7 @@ class MetadataManager {
|
|
|
30
29
|
stepAttachments: {},
|
|
31
30
|
};
|
|
32
31
|
try {
|
|
33
|
-
const data = (0, fs_1.readFileSync)(metadataPath, 'utf8');
|
|
32
|
+
const data = (0, fs_1.readFileSync)(this.metadataPath, 'utf8');
|
|
34
33
|
metadata = JSON.parse(data);
|
|
35
34
|
return metadata;
|
|
36
35
|
}
|
|
@@ -126,7 +125,7 @@ class MetadataManager {
|
|
|
126
125
|
static setMetadata(metadata) {
|
|
127
126
|
try {
|
|
128
127
|
const data = JSON.stringify(metadata);
|
|
129
|
-
(0, fs_1.writeFileSync)(metadataPath, data);
|
|
128
|
+
(0, fs_1.writeFileSync)(this.metadataPath, data);
|
|
130
129
|
}
|
|
131
130
|
catch (err) {
|
|
132
131
|
console.error('Error writing metadata file:', err);
|
|
@@ -137,14 +136,14 @@ class MetadataManager {
|
|
|
137
136
|
return;
|
|
138
137
|
}
|
|
139
138
|
try {
|
|
140
|
-
(0, fs_1.unlinkSync)(metadataPath);
|
|
139
|
+
(0, fs_1.unlinkSync)(this.metadataPath);
|
|
141
140
|
}
|
|
142
141
|
catch (err) {
|
|
143
142
|
console.error('Error clearing state file:', err);
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
static isExists() {
|
|
147
|
-
return (0, fs_1.existsSync)(metadataPath);
|
|
146
|
+
return (0, fs_1.existsSync)(this.metadataPath);
|
|
148
147
|
}
|
|
149
148
|
static prepareAttach(attach) {
|
|
150
149
|
const attachments = [];
|
|
@@ -190,3 +189,4 @@ class MetadataManager {
|
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
exports.MetadataManager = MetadataManager;
|
|
192
|
+
MetadataManager.metadataPath = path_1.default.resolve(__dirname, 'qaseMetadata');
|
package/dist/reporter.d.ts
CHANGED
|
@@ -70,6 +70,12 @@ export declare class CypressQaseReporter extends reporters.Base {
|
|
|
70
70
|
* @private
|
|
71
71
|
*/
|
|
72
72
|
private getFile;
|
|
73
|
+
/**
|
|
74
|
+
* @param {string} title
|
|
75
|
+
* @returns {string}
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
private removeQaseIdsFromTitle;
|
|
73
79
|
private getSteps;
|
|
74
80
|
}
|
|
75
81
|
export {};
|
package/dist/reporter.js
CHANGED
|
@@ -169,7 +169,7 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
|
|
|
169
169
|
thread: null,
|
|
170
170
|
},
|
|
171
171
|
testops_id: ids.length > 0 ? ids : null,
|
|
172
|
-
title: metadata?.title ?? test.title,
|
|
172
|
+
title: metadata?.title ?? this.removeQaseIdsFromTitle(test.title),
|
|
173
173
|
};
|
|
174
174
|
void this.reporter.addTestResult(result);
|
|
175
175
|
manager_1.MetadataManager.clear();
|
|
@@ -209,6 +209,18 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
|
|
|
209
209
|
}
|
|
210
210
|
return undefined;
|
|
211
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* @param {string} title
|
|
214
|
+
* @returns {string}
|
|
215
|
+
* @private
|
|
216
|
+
*/
|
|
217
|
+
removeQaseIdsFromTitle(title) {
|
|
218
|
+
const matches = title.match(/\(Qase ID: ([0-9,]+)\)$/i);
|
|
219
|
+
if (matches) {
|
|
220
|
+
return title.replace(matches[0], '').trimEnd();
|
|
221
|
+
}
|
|
222
|
+
return title;
|
|
223
|
+
}
|
|
212
224
|
getSteps(steps, attachments) {
|
|
213
225
|
const result = [];
|
|
214
226
|
const stepMap = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cypress-qase-reporter",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Qase Cypress Reporter",
|
|
5
5
|
"homepage": "https://github.com/qase-tms/qase-javascript",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"author": "Qase Team <support@qase.io>",
|
|
48
48
|
"license": "Apache-2.0",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"qase-javascript-commons": "~2.2.
|
|
50
|
+
"qase-javascript-commons": "~2.2.3",
|
|
51
51
|
"uuid": "^9.0.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|