cypress-qase-reporter 1.4.2-alpha.3 → 2.0.0-beta.0
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 +32 -28
- package/package.json +44 -41
- package/tsconfig.build.json +9 -0
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -423
- package/dist/index.js.map +0 -1
- package/dist/mocha.d.ts +0 -4
- package/dist/mocha.js +0 -20
- package/dist/mocha.js.map +0 -1
- package/dist/reportBulk.js +0 -174
- package/examples_cypress_v10/cypress/e2e/second.cy.js +0 -59
- package/examples_cypress_v10/cypress/fixtures/example.json +0 -5
- package/examples_cypress_v10/cypress/plugins/index.js +0 -21
- package/examples_cypress_v10/cypress/support/commands.js +0 -25
- package/examples_cypress_v10/cypress/support/e2e.js +0 -20
- package/examples_cypress_v10/cypress.config.js +0 -30
- package/examples_cypress_v10/package-lock.json +0 -5198
- package/examples_cypress_v10/package.json +0 -17
- package/examples_cypress_v6/cypress/fixtures/example.json +0 -5
- package/examples_cypress_v6/cypress/integration/sample_spec.js +0 -39
- package/examples_cypress_v6/cypress/plugins/index.js +0 -21
- package/examples_cypress_v6/cypress/support/commands.js +0 -25
- package/examples_cypress_v6/cypress/support/index.js +0 -20
- package/examples_cypress_v6/cypress.json +0 -20
- package/examples_cypress_v6/package-lock.json +0 -6283
- package/examples_cypress_v6/package.json +0 -17
- package/test/plugin.test.ts +0 -179
- /package/{examples_cypress_v10/screenshots → screenshots}/screenshot.png +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "examples",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"cypress": "cypress open",
|
|
7
|
-
"test": "QASE_REPORT=1 npx cypress run"
|
|
8
|
-
},
|
|
9
|
-
"author": "",
|
|
10
|
-
"license": "Apache-2.0",
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"cypress": "^6.4.0",
|
|
13
|
-
"cypress-mochawesome-reporter": "^3.0.1",
|
|
14
|
-
"cypress-multi-reporters": "^1.4.0",
|
|
15
|
-
"cypress-qase-reporter": "../"
|
|
16
|
-
}
|
|
17
|
-
}
|
package/test/plugin.test.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
|
2
|
-
import mocha from 'mocha';
|
|
3
|
-
import QaseCypressReporter from '../src';
|
|
4
|
-
|
|
5
|
-
describe('Client', () => {
|
|
6
|
-
it('Init client', () => {
|
|
7
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
8
|
-
const options = { reporterOptions: { apiToken: "" } };
|
|
9
|
-
new QaseCypressReporter(runner, options);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
describe('Auto add defect', () => {
|
|
13
|
-
let qReporter;
|
|
14
|
-
const testData = [{
|
|
15
|
-
test: {
|
|
16
|
-
title: 'Test (Qase ID: 1)',
|
|
17
|
-
duration: 1,
|
|
18
|
-
err: {
|
|
19
|
-
message: 'Error message',
|
|
20
|
-
stack: 'Error stack',
|
|
21
|
-
name: 'Error name'
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
status: 'failed',
|
|
25
|
-
defect: true
|
|
26
|
-
}, {
|
|
27
|
-
test: {
|
|
28
|
-
title: 'Test (Qase ID: 2)',
|
|
29
|
-
duration: 1,
|
|
30
|
-
err: null,
|
|
31
|
-
},
|
|
32
|
-
status: 'passed',
|
|
33
|
-
defect: false
|
|
34
|
-
}, {
|
|
35
|
-
test: {
|
|
36
|
-
title: 'Test (Qase ID: 3)',
|
|
37
|
-
duration: 0,
|
|
38
|
-
err: null,
|
|
39
|
-
},
|
|
40
|
-
status: 'skipped',
|
|
41
|
-
defect: false
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
test: {
|
|
45
|
-
title: 'Test (Qase ID: 4)',
|
|
46
|
-
duration: 1,
|
|
47
|
-
err: null,
|
|
48
|
-
},
|
|
49
|
-
status: 'in_progress',
|
|
50
|
-
defect: false
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
test: {
|
|
54
|
-
title: 'Test (Qase ID: 5)',
|
|
55
|
-
duration: 1,
|
|
56
|
-
err: null,
|
|
57
|
-
},
|
|
58
|
-
status: 'invalid',
|
|
59
|
-
defect: false
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
test: {
|
|
63
|
-
title: 'Test (Qase ID: 6)',
|
|
64
|
-
duration: 1,
|
|
65
|
-
err: null,
|
|
66
|
-
},
|
|
67
|
-
status: 'blocked',
|
|
68
|
-
defect: false
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
73
|
-
const options = { reporterOptions: { apiToken: "" } };
|
|
74
|
-
qReporter = new QaseCypressReporter(runner, options);
|
|
75
|
-
|
|
76
|
-
testData.forEach(test => {
|
|
77
|
-
// add test data
|
|
78
|
-
qReporter['transformCaseResultToBulkObject'](test.test, test.status);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
for (const index in testData) {
|
|
82
|
-
// check test data in bulk object
|
|
83
|
-
it(`should set defect=${testData[index].defect} when status=${testData[index].status}`, () => {
|
|
84
|
-
expect(qReporter['resultsForPublishing'][index].defect).toBe(testData[index].defect);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
describe('Auto create test case', () => {
|
|
90
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
91
|
-
let qReporter = new QaseCypressReporter(runner, { reporterOptions: { apiToken: "" } });
|
|
92
|
-
it('should use parent as root suite title', () => {
|
|
93
|
-
const test = {
|
|
94
|
-
parent: {
|
|
95
|
-
title: 'Test Suite'
|
|
96
|
-
},
|
|
97
|
-
title: 'test 1',
|
|
98
|
-
status: 'passed',
|
|
99
|
-
duration: 1,
|
|
100
|
-
err: null,
|
|
101
|
-
};
|
|
102
|
-
qReporter['transformCaseResultToBulkObject'](test as any, test.status as any);
|
|
103
|
-
expect(qReporter['resultsForPublishing'][0]).toMatchObject({
|
|
104
|
-
case: {
|
|
105
|
-
title: test.title,
|
|
106
|
-
suite_title: 'Test Suite'
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('should account for nested test', () => {
|
|
112
|
-
const test = {
|
|
113
|
-
parent: {
|
|
114
|
-
title: 'Level 1',
|
|
115
|
-
parent: {
|
|
116
|
-
title: 'Main Suite'
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
title: 'test 1',
|
|
120
|
-
status: 'passed',
|
|
121
|
-
duration: 1,
|
|
122
|
-
err: null,
|
|
123
|
-
};
|
|
124
|
-
qReporter['transformCaseResultToBulkObject'](test as any, test.status as any);
|
|
125
|
-
expect(qReporter['resultsForPublishing'][1]).toMatchObject({
|
|
126
|
-
case: {
|
|
127
|
-
title: test.title,
|
|
128
|
-
suite_title: 'Main Suite\tLevel 1'
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('should use reporter rootSuiteTitle as top parent', () => {
|
|
134
|
-
qReporter = new QaseCypressReporter(runner, { reporterOptions: { apiToken: "", rootSuiteTitle: 'Top Parent' } });
|
|
135
|
-
const test = {
|
|
136
|
-
parent: {
|
|
137
|
-
title: 'Level 1',
|
|
138
|
-
parent: {
|
|
139
|
-
title: 'Main Suite'
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
title: 'test 1',
|
|
143
|
-
status: 'passed',
|
|
144
|
-
duration: 1,
|
|
145
|
-
err: null,
|
|
146
|
-
};
|
|
147
|
-
qReporter['transformCaseResultToBulkObject'](test as any, test.status as any);
|
|
148
|
-
expect(qReporter['resultsForPublishing'][0]).toMatchObject({
|
|
149
|
-
case: {
|
|
150
|
-
title: test.title,
|
|
151
|
-
suite_title: 'Top Parent\tMain Suite\tLevel 1'
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
describe('Options', () => {
|
|
158
|
-
describe('support for rootSuiteTitle', () => {
|
|
159
|
-
it('should set Root Suite Title to "" by default', () => {
|
|
160
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
161
|
-
const qReporter = new QaseCypressReporter(runner, { reporterOptions: { apiToken: "" } });
|
|
162
|
-
expect(qReporter['options'].rootSuiteTitle).toBe('');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should set Root Suite Title by reporter option - rootSuiteTitle', () => {
|
|
166
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
167
|
-
const qReporter = new QaseCypressReporter(runner, { reporterOptions: { apiToken: "", rootSuiteTitle: 'CY Test' } });
|
|
168
|
-
expect(qReporter['options'].rootSuiteTitle).toBe('CY Test');
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should set Root Suite Title by environmental variable - QASE_ROOT_SUITE_TITLE', () => {
|
|
172
|
-
process.env.QASE_ROOT_SUITE_TITLE = 'CY Test ENV';
|
|
173
|
-
const runner = new mocha.Runner(new mocha.Suite('new'), false)
|
|
174
|
-
const qReporter = new QaseCypressReporter(runner, { reporterOptions: { apiToken: "" } });
|
|
175
|
-
expect(qReporter['options'].rootSuiteTitle).toBe('CY Test ENV');
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
});
|
|
File without changes
|