cucumberjs-qase-reporter 0.2.9 → 2.0.0-beta.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.
@@ -1,17 +0,0 @@
1
- {
2
- "name": "cucumber-js-test",
3
- "version": "0.0.0",
4
- "description": "> Some tests of using cucumber JS with zombie and selenium",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "cucumber-js -f cucumberjs-qase-reporter --format-options='{\"qaseConfig\": \"./.qaserc\"}' features -r examples/zombie/support -r examples/zombie/steps --publish-quiet",
8
- "test:l": "cucumber-js features -r examples/zombie/support -r examples/zombie/steps"
9
- },
10
- "devDependencies": {
11
- "@cucumber/cucumber": "^7.0.0",
12
- "@cucumber/pretty-formatter": "^1.0.0-alpha.0",
13
- "cucumberjs-qase-reporter": "../",
14
- "phantom": "^2.0.4",
15
- "zombie": "^6.1.4"
16
- }
17
- }
@@ -1,193 +0,0 @@
1
- import { describe, expect, it } from '@jest/globals';
2
- import { IFormatterOptions } from "@cucumber/cucumber/lib/formatter";
3
- import Index from '../src';
4
-
5
- describe('Tests', () => {
6
- it('Init main class', () => {
7
- new Index({ parsedArgvOptions: {} } as unknown as IFormatterOptions);
8
- });
9
-
10
- describe('runComplete option', () => {
11
- it('should have runComplete option false by default', () => {
12
- const qReporter = new Index({ parsedArgvOptions: {} } as unknown as IFormatterOptions);
13
- expect(qReporter['config'].runComplete).toBe(false);
14
- });
15
-
16
- it('should set runComplete from reporter options', () => {
17
- const qReporter = new Index({ parsedArgvOptions: { runComplete: true } } as unknown as IFormatterOptions);
18
- expect(qReporter['config'].runComplete).toBe(true);
19
- });
20
-
21
- it('should set runComplete from environmental variable [QASE_RUN_COMPLETE=true]', () => {
22
- process.env.QASE_RUN_COMPLETE = 'true';
23
- const qReporter = new Index({ parsedArgvOptions: {} } as unknown as IFormatterOptions);
24
- expect(qReporter['config'].runComplete).toBe(true);
25
- });
26
- });
27
-
28
- describe('Auto Create Defect', () => {
29
- const qReporter = new Index({ parsedArgvOptions: {} } as unknown as IFormatterOptions);
30
-
31
- describe('known test cases', () => {
32
- const testData = [
33
- {
34
- test: {
35
- name: 'Test 1',
36
- caseIds: [1],
37
- status: 'failed',
38
- duration: 1,
39
- finished: {
40
- testCaseStartedId: 'c6e6a2f8-245b12-k1'
41
- },
42
- },
43
- defect: true,
44
- },
45
- {
46
- test: {
47
- name: 'Test 2',
48
- caseIds: [2],
49
- status: 'passed',
50
- duration: 1,
51
- finished: {
52
- testCaseStartedId: 'c6e6a2f8-245b12-k2'
53
- },
54
- },
55
- defect: false,
56
- },
57
- {
58
- test: {
59
- name: 'Test 3',
60
- caseIds: [3],
61
- status: 'pending',
62
- duration: 1,
63
- finished: {
64
- testCaseStartedId: 'c6e6a2f8-245b12-k3'
65
- },
66
- },
67
- defect: false,
68
- },
69
- {
70
- test: {
71
- name: 'Test 4',
72
- caseIds: [4],
73
- status: null,
74
- duration: 1,
75
- finished: {
76
- testCaseStartedId: 'c6e6a2f8-245b12-k4'
77
- },
78
- },
79
- defect: false,
80
- },
81
- {
82
- test: {
83
- name: 'Test 5',
84
- caseIds: [5],
85
- status: 'skipped',
86
- duration: 1,
87
- finished: {
88
- testCaseStartedId: 'c6e6a2f8-245b12-k5'
89
- },
90
- },
91
- defect: false,
92
- },
93
- ]
94
-
95
- testData.forEach(tD => {
96
- qReporter['addForSending'](tD.test as any, tD.test.status as any);
97
- })
98
-
99
- testData.map(tD => {
100
- return {
101
- caseId: tD.test.finished.testCaseStartedId,
102
- defectValue: tD.defect,
103
- status: tD.test.status,
104
- }
105
- }).forEach(eTestData => {
106
- it(`should set defect=${eTestData.defectValue} when status=${eTestData.status}`, () => {
107
- expect(qReporter['results'][eTestData.caseId].defect).toBe(eTestData.defectValue);
108
- });
109
- });
110
- });
111
-
112
- describe('unknown test cases', () => {
113
- const testData = [
114
- {
115
- test: {
116
- name: 'Test 1',
117
- caseIds: [],
118
- status: 'failed',
119
- duration: 1,
120
- finished: {
121
- testCaseStartedId: 'c6e6a2f8-245b12-u1'
122
- },
123
- },
124
- defect: true,
125
- },
126
- {
127
- test: {
128
- name: 'Test 2',
129
- caseIds: [],
130
- status: 'passed',
131
- duration: 1,
132
- finished: {
133
- testCaseStartedId: 'c6e6a2f8-245b12-u2'
134
- },
135
- },
136
- defect: false,
137
- },
138
- {
139
- test: {
140
- name: 'Test 3',
141
- caseIds: [],
142
- status: 'pending',
143
- duration: 1,
144
- finished: {
145
- testCaseStartedId: 'c6e6a2f8-245b12-u3'
146
- },
147
- },
148
- defect: false,
149
- },
150
- {
151
- test: {
152
- name: 'Test 4',
153
- caseIds: [],
154
- status: null,
155
- duration: 1,
156
- finished: {
157
- testCaseStartedId: 'c6e6a2f8-245b12-u4'
158
- },
159
- },
160
- defect: false,
161
- },
162
- {
163
- test: {
164
- name: 'Test 5',
165
- caseIds: [],
166
- status: 'skipped',
167
- duration: 1,
168
- finished: {
169
- testCaseStartedId: 'c6e6a2f8-245b12-u5'
170
- },
171
- },
172
- defect: false,
173
- }
174
- ]
175
-
176
- testData.forEach(tD => {
177
- qReporter['addForSending'](tD.test as any, tD.test.status as any);
178
- })
179
-
180
- testData.map(tD => {
181
- return {
182
- caseId: tD.test.finished.testCaseStartedId,
183
- defectValue: tD.defect,
184
- status: tD.test.status,
185
- }
186
- }).forEach(eTestData => {
187
- it(`should set defect=${eTestData.defectValue} when status=${eTestData.status}`, () => {
188
- expect(qReporter['results'][eTestData.caseId].defect).toBe(eTestData.defectValue);
189
- });
190
- });
191
- });
192
- });
193
- });
File without changes