testcafe-reporter-qase 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/changelog.md +19 -1
- package/dist/qase.d.ts +14 -2
- package/dist/qase.js +18 -2
- package/dist/reporter.js +12 -1
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# qase-testcafe@2.0.3
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Support `ignore` metadata for test cases. If the test case has the `ignore` tag, the reporter will not send the result to the Qase
|
|
6
|
+
TMS.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
const q = qase.ignore().create();
|
|
10
|
+
test.meta({ ...q })(
|
|
11
|
+
'test',
|
|
12
|
+
async (t) => {
|
|
13
|
+
await t;
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
```
|
|
17
|
+
|
|
1
18
|
# qase-testcafe@2.0.2
|
|
2
19
|
|
|
3
20
|
## What's new
|
|
@@ -8,7 +25,8 @@ Improved error collection. The error stack trace contains more useful debugging
|
|
|
8
25
|
|
|
9
26
|
## What's new
|
|
10
27
|
|
|
11
|
-
Support group parameters for test cases. You can specify the group parameters in the test case using the following
|
|
28
|
+
Support group parameters for test cases. You can specify the group parameters in the test case using the following
|
|
29
|
+
format:
|
|
12
30
|
|
|
13
31
|
```ts
|
|
14
32
|
const q = qase.groupParameters({ 'param01': 'value01', 'param02': 'value02' }).create();
|
package/dist/qase.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class qase {
|
|
|
4
4
|
private static _qaseFields;
|
|
5
5
|
private static _qaseParameters;
|
|
6
6
|
private static _qaseGroupParameters;
|
|
7
|
+
private static _qaseIgnore;
|
|
7
8
|
/**
|
|
8
9
|
* Set a Qase ID for the test case
|
|
9
10
|
* Don't forget to call `create` method after setting all the necessary parameters
|
|
@@ -53,12 +54,22 @@ export declare class qase {
|
|
|
53
54
|
* Don't forget to call `create` method after setting all the necessary parameters
|
|
54
55
|
* @param {Record<string, string>} values
|
|
55
56
|
* @example
|
|
56
|
-
* const q = qase.
|
|
57
|
+
* const q = qase.groupParameters({ 'severity': 'high', 'priority': 'medium' }).create();
|
|
57
58
|
* test.meta(q)('Test case title', async t => { ... });
|
|
58
59
|
* or
|
|
59
60
|
* test.meta({userField: 123, ...q})('Test case title', async t => { ... });
|
|
60
61
|
*/
|
|
61
|
-
static
|
|
62
|
+
static groupParameters: (values: Record<string, string>) => typeof qase;
|
|
63
|
+
/**
|
|
64
|
+
* Set a ignore flag for the test case
|
|
65
|
+
* Don't forget to call `create` method after setting all the necessary parameters
|
|
66
|
+
* @example
|
|
67
|
+
* const q = qase.ignore().create();
|
|
68
|
+
* test.meta(q)('Test case title', async t => { ... });
|
|
69
|
+
* or
|
|
70
|
+
* test.meta({userField: 123, ...q})('Test case title', async t => { ... });
|
|
71
|
+
*/
|
|
72
|
+
static ignore: () => typeof qase;
|
|
62
73
|
/**
|
|
63
74
|
* Create a Qase metadata
|
|
64
75
|
* Call this method after setting all the necessary parameters
|
|
@@ -74,6 +85,7 @@ export declare class qase {
|
|
|
74
85
|
QaseFields: string;
|
|
75
86
|
QaseParameters: string;
|
|
76
87
|
QaseGroupParameters: string;
|
|
88
|
+
QaseIgnore: string;
|
|
77
89
|
};
|
|
78
90
|
private static toNormalizeRecord;
|
|
79
91
|
}
|
package/dist/qase.js
CHANGED
|
@@ -12,6 +12,7 @@ qase._qaseTitle = '';
|
|
|
12
12
|
qase._qaseFields = '';
|
|
13
13
|
qase._qaseParameters = '';
|
|
14
14
|
qase._qaseGroupParameters = '';
|
|
15
|
+
qase._qaseIgnore = '';
|
|
15
16
|
/**
|
|
16
17
|
* Set a Qase ID for the test case
|
|
17
18
|
* Don't forget to call `create` method after setting all the necessary parameters
|
|
@@ -73,15 +74,28 @@ qase.parameters = (values) => {
|
|
|
73
74
|
* Don't forget to call `create` method after setting all the necessary parameters
|
|
74
75
|
* @param {Record<string, string>} values
|
|
75
76
|
* @example
|
|
76
|
-
* const q = qase.
|
|
77
|
+
* const q = qase.groupParameters({ 'severity': 'high', 'priority': 'medium' }).create();
|
|
77
78
|
* test.meta(q)('Test case title', async t => { ... });
|
|
78
79
|
* or
|
|
79
80
|
* test.meta({userField: 123, ...q})('Test case title', async t => { ... });
|
|
80
81
|
*/
|
|
81
|
-
qase.
|
|
82
|
+
qase.groupParameters = (values) => {
|
|
82
83
|
_a._qaseGroupParameters = _a.toNormalizeRecord(values);
|
|
83
84
|
return _a;
|
|
84
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Set a ignore flag for the test case
|
|
88
|
+
* Don't forget to call `create` method after setting all the necessary parameters
|
|
89
|
+
* @example
|
|
90
|
+
* const q = qase.ignore().create();
|
|
91
|
+
* test.meta(q)('Test case title', async t => { ... });
|
|
92
|
+
* or
|
|
93
|
+
* test.meta({userField: 123, ...q})('Test case title', async t => { ... });
|
|
94
|
+
*/
|
|
95
|
+
qase.ignore = () => {
|
|
96
|
+
_a._qaseIgnore = 'true';
|
|
97
|
+
return _a;
|
|
98
|
+
};
|
|
85
99
|
/**
|
|
86
100
|
* Create a Qase metadata
|
|
87
101
|
* Call this method after setting all the necessary parameters
|
|
@@ -98,12 +112,14 @@ qase.create = () => {
|
|
|
98
112
|
QaseFields: _a._qaseFields,
|
|
99
113
|
QaseParameters: _a._qaseParameters,
|
|
100
114
|
QaseGroupParameters: _a._qaseGroupParameters,
|
|
115
|
+
QaseIgnore: _a._qaseIgnore,
|
|
101
116
|
};
|
|
102
117
|
_a._qaseID = '';
|
|
103
118
|
_a._qaseTitle = '';
|
|
104
119
|
_a._qaseFields = '';
|
|
105
120
|
_a._qaseParameters = '';
|
|
106
121
|
_a._qaseGroupParameters = '';
|
|
122
|
+
_a._qaseIgnore = '';
|
|
107
123
|
return meta;
|
|
108
124
|
};
|
|
109
125
|
qase.toNormalizeRecord = (record) => {
|
package/dist/reporter.js
CHANGED
|
@@ -11,6 +11,7 @@ var metadataEnum;
|
|
|
11
11
|
metadataEnum["parameters"] = "QaseParameters";
|
|
12
12
|
metadataEnum["groupParameters"] = "QaseGroupParameters";
|
|
13
13
|
metadataEnum["oldID"] = "CID";
|
|
14
|
+
metadataEnum["ignore"] = "QaseIgnore";
|
|
14
15
|
})(metadataEnum || (metadataEnum = {}));
|
|
15
16
|
/**
|
|
16
17
|
* @class TestcafeQaseReporter
|
|
@@ -67,12 +68,15 @@ class TestcafeQaseReporter {
|
|
|
67
68
|
* @param formatError
|
|
68
69
|
*/
|
|
69
70
|
this.reportTestDone = async (title, testRunInfo, meta, formatError) => {
|
|
71
|
+
const metadata = this.getMeta(meta);
|
|
72
|
+
if (metadata[metadataEnum.ignore]) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
70
75
|
const errorLog = testRunInfo.errs
|
|
71
76
|
.map((error, index) => formatError(error, `${index + 1} `).replace(
|
|
72
77
|
// eslint-disable-next-line no-control-regex
|
|
73
78
|
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, ''))
|
|
74
79
|
.join('\n');
|
|
75
|
-
const metadata = this.getMeta(meta);
|
|
76
80
|
await this.reporter.addTestResult({
|
|
77
81
|
author: null,
|
|
78
82
|
execution: {
|
|
@@ -128,6 +132,7 @@ class TestcafeQaseReporter {
|
|
|
128
132
|
QaseFields: {},
|
|
129
133
|
QaseParameters: {},
|
|
130
134
|
QaseGroupParameters: {},
|
|
135
|
+
QaseIgnore: false,
|
|
131
136
|
};
|
|
132
137
|
if (meta[metadataEnum.oldID] !== undefined && meta[metadataEnum.oldID] !== '') {
|
|
133
138
|
const v = meta[metadataEnum.oldID].split(',');
|
|
@@ -146,6 +151,12 @@ class TestcafeQaseReporter {
|
|
|
146
151
|
if (meta[metadataEnum.parameters] !== undefined && meta[metadataEnum.parameters] !== '') {
|
|
147
152
|
metadata.QaseParameters = JSON.parse(meta[metadataEnum.parameters]);
|
|
148
153
|
}
|
|
154
|
+
if (meta[metadataEnum.groupParameters] !== undefined && meta[metadataEnum.groupParameters] !== '') {
|
|
155
|
+
metadata.QaseGroupParameters = JSON.parse(meta[metadataEnum.groupParameters]);
|
|
156
|
+
}
|
|
157
|
+
if (meta[metadataEnum.ignore] !== undefined && meta[metadataEnum.ignore] !== '') {
|
|
158
|
+
metadata.QaseIgnore = meta[metadataEnum.ignore] === 'true';
|
|
159
|
+
}
|
|
149
160
|
return metadata;
|
|
150
161
|
}
|
|
151
162
|
/**
|