cypress-qase-reporter 2.2.0-beta.3 → 2.2.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 +1 -10
- package/changelog.md +6 -0
- package/docs/usage.md +196 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,21 +4,12 @@ Publish results simple and easy.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
To install the latest release version (2.
|
|
7
|
+
To install the latest release version (2.2.x), run:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npm install -D cypress-qase-reporter
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
<!-- if there's no current beta, comment the next block
|
|
14
|
-
-->
|
|
15
|
-
|
|
16
|
-
To install the latest beta version (2.2.x), run:
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
npm install -D cypress-qase-reporter@beta
|
|
20
|
-
```
|
|
21
|
-
|
|
22
13
|
## Updating from v1 to v2.1
|
|
23
14
|
|
|
24
15
|
To update an existing test project using Qase reporter from version 1 to version 2.1,
|
package/changelog.md
CHANGED
package/docs/usage.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Qase Integration in Cypress
|
|
2
|
+
|
|
3
|
+
This guide demonstrates how to integrate Qase with Cypress, providing instructions on how to add Qase IDs, titles,
|
|
4
|
+
fields, suites, comments, and file attachments to your test cases.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Adding QaseID to a Test
|
|
9
|
+
|
|
10
|
+
To associate a QaseID with a test in Cypress, use the `qase` function. This function accepts a single integer
|
|
11
|
+
representing the test's ID in Qase.
|
|
12
|
+
|
|
13
|
+
### Example:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
17
|
+
|
|
18
|
+
qase(1, it('simple test', () => {
|
|
19
|
+
cy.visit('https://example.com');
|
|
20
|
+
}));
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Adding a Title to a Test
|
|
26
|
+
|
|
27
|
+
You can provide a title for your test using the `qase.title` function. The function accepts a string, which will be
|
|
28
|
+
used as the test's title in Qase. If no title is provided, the test method name will be used by default.
|
|
29
|
+
|
|
30
|
+
### Example:
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
34
|
+
|
|
35
|
+
it('test', () => {
|
|
36
|
+
qase.title('Title');
|
|
37
|
+
cy.visit('https://example.com');
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Adding Fields to a Test
|
|
44
|
+
|
|
45
|
+
The `qase.fields` function allows you to add additional metadata to a test case. You can specify multiple fields to
|
|
46
|
+
enhance test case information in Qase.
|
|
47
|
+
|
|
48
|
+
### System Fields:
|
|
49
|
+
|
|
50
|
+
- `description` — Description of the test case.
|
|
51
|
+
- `preconditions` — Preconditions for the test case.
|
|
52
|
+
- `postconditions` — Postconditions for the test case.
|
|
53
|
+
- `severity` — Severity of the test case (e.g., `critical`, `major`).
|
|
54
|
+
- `priority` — Priority of the test case (e.g., `high`, `low`).
|
|
55
|
+
- `layer` — Test layer (e.g., `UI`, `API`).
|
|
56
|
+
|
|
57
|
+
### Example:
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
61
|
+
|
|
62
|
+
it('test', () => {
|
|
63
|
+
qase.fields({ description: "Description", preconditions: "Preconditions" });
|
|
64
|
+
cy.visit('https://example.com');
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Adding a Suite to a Test
|
|
71
|
+
|
|
72
|
+
To assign a suite or sub-suite to a test, use the `qase.suite` function. It can receive a suite name, and optionally a
|
|
73
|
+
sub-suite, both as strings.
|
|
74
|
+
|
|
75
|
+
### Example:
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
79
|
+
|
|
80
|
+
it('test', () => {
|
|
81
|
+
qase.suite("Suite 01");
|
|
82
|
+
cy.visit('https://example.com');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('test', () => {
|
|
86
|
+
qase.suite("Suite 01\tSuite 02");
|
|
87
|
+
cy.visit('https://example.com');
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Ignoring a Test in Qase
|
|
94
|
+
|
|
95
|
+
To exclude a test from being reported to Qase (while still executing the test in Cypress), use the `qase.ignore`
|
|
96
|
+
function. The test will run, but its result will not be sent to Qase.
|
|
97
|
+
|
|
98
|
+
### Example:
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
102
|
+
|
|
103
|
+
it('test', () => {
|
|
104
|
+
qase.ignore();
|
|
105
|
+
cy.visit('https://example.com');
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Adding a Comment to a Test
|
|
112
|
+
|
|
113
|
+
You can attach comments to the test results in Qase using the `qase.comment` function. The comment will be displayed
|
|
114
|
+
alongside the test execution details in Qase.
|
|
115
|
+
|
|
116
|
+
### Example:
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
120
|
+
|
|
121
|
+
it('test', () => {
|
|
122
|
+
qase.comment("Some comment");
|
|
123
|
+
cy.visit('https://example.com');
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Attaching Files to a Test
|
|
130
|
+
|
|
131
|
+
To attach files to a test result, use the `qase.attach` function. This method supports attaching one or multiple files,
|
|
132
|
+
along with optional file names, comments, and file types.
|
|
133
|
+
|
|
134
|
+
### Example:
|
|
135
|
+
|
|
136
|
+
```javascript
|
|
137
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
138
|
+
|
|
139
|
+
it('test', () => {
|
|
140
|
+
qase.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' });
|
|
141
|
+
qase.attach({ paths: '/path/to/file' });
|
|
142
|
+
qase.attach({ paths: ['/path/to/file', '/path/to/another/file'] });
|
|
143
|
+
cy.visit('https://example.com');
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Adding Parameters to a Test
|
|
148
|
+
|
|
149
|
+
You can add parameters to a test case using the `qase.parameters` function. This function accepts an object with
|
|
150
|
+
parameter names and values.
|
|
151
|
+
|
|
152
|
+
### Example:
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
156
|
+
|
|
157
|
+
it('test', () => {
|
|
158
|
+
qase.parameters({ param1: 'value1', param2: 'value2' });
|
|
159
|
+
cy.visit('https://example.com');
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Adding Group Parameters to a Test
|
|
164
|
+
|
|
165
|
+
To add group parameters to a test case, use the `qase.groupParameters` function. This function accepts an list with
|
|
166
|
+
group parameter names.
|
|
167
|
+
|
|
168
|
+
### Example:
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
172
|
+
|
|
173
|
+
it('test', () => {
|
|
174
|
+
qase.parameters({ param1: 'value1', param2: 'value2' });
|
|
175
|
+
qase.groupParameters(['param1']);
|
|
176
|
+
cy.visit('https://example.com');
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Adding Steps to a Test
|
|
181
|
+
|
|
182
|
+
You can add steps to a test case using the `qase.step` function. This function accepts a string, which will be used as
|
|
183
|
+
the step description in Qase.
|
|
184
|
+
|
|
185
|
+
### Example:
|
|
186
|
+
|
|
187
|
+
```javascript
|
|
188
|
+
import { qase } from 'cypress-qase-reporter/mocha';
|
|
189
|
+
|
|
190
|
+
it('test', () => {
|
|
191
|
+
qase.step('Some step', () => {
|
|
192
|
+
// some actions
|
|
193
|
+
});
|
|
194
|
+
cy.visit('https://example.com');
|
|
195
|
+
});
|
|
196
|
+
```
|