@qavajs/format-report-portal 1.0.0 → 1.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/CHANGELOG.MD +43 -21
- package/README.MD +33 -30
- package/index.js +5 -7
- package/package.json +18 -6
package/CHANGELOG.MD
CHANGED
|
@@ -1,65 +1,87 @@
|
|
|
1
|
-
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the "@qavajs/format-report-portal" will be documented in this file.
|
|
4
|
+
|
|
5
|
+
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
|
6
|
+
|
|
7
|
+
:rocket: - new feature
|
|
8
|
+
|
|
9
|
+
:beetle: - bugfix
|
|
10
|
+
|
|
11
|
+
:x: - deprecation/removal
|
|
12
|
+
|
|
13
|
+
:pencil: - chore
|
|
14
|
+
|
|
15
|
+
:microscope: - experimental
|
|
16
|
+
|
|
17
|
+
## [1.2.0]
|
|
18
|
+
- :x: removed `showLaunchURL` flag in favor of built-in report portal client capability
|
|
19
|
+
|
|
20
|
+
## [1.1.0]
|
|
21
|
+
- :rocket: updated report portal client
|
|
22
|
+
|
|
23
|
+
## [1.0.0]
|
|
2
24
|
- added `legacyTimeFormat` flag to support old versions of report portal
|
|
3
25
|
|
|
4
|
-
## 0.15.0
|
|
26
|
+
## [0.15.0]
|
|
5
27
|
- added request/response renderer of internal mime type _text/x.response.json_
|
|
6
28
|
|
|
7
|
-
## 0.14.3
|
|
29
|
+
## [0.14.3]
|
|
8
30
|
- bump dependencies to get rid of vulnerabilities
|
|
9
31
|
|
|
10
|
-
## 0.14.2
|
|
32
|
+
## [0.14.2]
|
|
11
33
|
- fixed issue with undefined/null tags that prevents starting launch
|
|
12
34
|
|
|
13
|
-
## 0.14.1
|
|
35
|
+
## [0.14.1]
|
|
14
36
|
- updated rp-client package
|
|
15
37
|
|
|
16
|
-
## 0.14.0
|
|
38
|
+
## [0.14.0]
|
|
17
39
|
- added config parameter for placing tags to attributes or description (default)
|
|
18
40
|
- pull request template added to reduce human factor
|
|
19
41
|
|
|
20
|
-
## 0.13.1
|
|
42
|
+
## [0.13.1]
|
|
21
43
|
- fixed a missed bracket
|
|
22
44
|
|
|
23
|
-
## 0.13.0
|
|
45
|
+
## [0.13.0]
|
|
24
46
|
- changed an approach to distribute tags as attributes for suite and test entities
|
|
25
47
|
|
|
26
|
-
## 0.12.0
|
|
48
|
+
## [0.12.0]
|
|
27
49
|
- added support of named attachments
|
|
28
50
|
|
|
29
|
-
## 0.11.0
|
|
51
|
+
## [0.11.0]
|
|
30
52
|
- added flag to print launch url
|
|
31
53
|
|
|
32
|
-
## 0.10.0
|
|
54
|
+
## [0.10.0]
|
|
33
55
|
- added support of named hooks
|
|
34
56
|
- added retries
|
|
35
57
|
|
|
36
|
-
## 0.9.4
|
|
58
|
+
## [0.9.4]
|
|
37
59
|
- fixed bug with finishing launch before all data sent
|
|
38
60
|
|
|
39
|
-
## 0.9.3
|
|
61
|
+
## [0.9.3]
|
|
40
62
|
- updated rp client version
|
|
41
63
|
|
|
42
|
-
## 0.9.2
|
|
64
|
+
## [0.9.2]
|
|
43
65
|
- :beetle: added capability to ignore errors
|
|
44
66
|
|
|
45
|
-
## 0.9.1
|
|
67
|
+
## [0.9.1]
|
|
46
68
|
- :beetle: added request retry in case of error
|
|
47
69
|
|
|
48
|
-
## 0.9.0
|
|
70
|
+
## [0.9.0]
|
|
49
71
|
- :rocket: implemented capability to add attributes to test
|
|
50
72
|
|
|
51
|
-
## 0.0.8
|
|
73
|
+
## [0.0.8]
|
|
52
74
|
- :beetle: fixed sending duration
|
|
53
75
|
|
|
54
|
-
## 0.0.7
|
|
76
|
+
## [0.0.7]
|
|
55
77
|
- :beetle: implemented sending real step duration
|
|
56
78
|
|
|
57
|
-
## 0.0.6
|
|
79
|
+
## [0.0.6]
|
|
58
80
|
- :rocket: enable support of cucumber logs
|
|
59
81
|
|
|
60
|
-
## 0.0.5
|
|
82
|
+
## [0.0.5]
|
|
61
83
|
- :rocket: updated step logging as nested steps instead plain logs
|
|
62
84
|
- :beetle: added capability to attach multiple attachment to step
|
|
63
85
|
|
|
64
|
-
## 0.0.4
|
|
86
|
+
## [0.0.4]
|
|
65
87
|
- :beetle: fixed issue with sending text plain
|
package/README.MD
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
## @qavajs/format-report-portal
|
|
2
|
-
|
|
2
|
+
qavajs and cucumberjs formatter for EPAM [Report Portal](https://reportportal.io/)
|
|
3
3
|
|
|
4
4
|
### Install
|
|
5
|
-
|
|
5
|
+
```
|
|
6
|
+
npm install @qavajs/format-report-portal
|
|
7
|
+
```
|
|
6
8
|
|
|
7
9
|
### Configuration
|
|
8
10
|
|
|
9
11
|
add formatter to config.js
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
format
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
legacyTimeFormat: true // (default: false - use legacy milliseconds precision instead of microseconds)
|
|
32
|
-
},
|
|
33
|
-
}
|
|
12
|
+
```typescript
|
|
13
|
+
export default {
|
|
14
|
+
format: [
|
|
15
|
+
['@qavajs/format-report-portal', 'report/rp.out']
|
|
16
|
+
],
|
|
17
|
+
formatOptions: {
|
|
18
|
+
rpConfig: {
|
|
19
|
+
enable: true,
|
|
20
|
+
debug: false,
|
|
21
|
+
apiKey: 'your token',
|
|
22
|
+
endpoint: 'https://your-rp-instance/api/v1',
|
|
23
|
+
description: 'Description',
|
|
24
|
+
tags: ['Tag'],
|
|
25
|
+
project: 'your project',
|
|
26
|
+
launch: 'your launch name',
|
|
27
|
+
mode: 'DEFAULT',
|
|
28
|
+
retry: 1, // number of retries to send result to report portal (default - 1)
|
|
29
|
+
ignoreErrors: false, // ignore RP errors (default: false)
|
|
30
|
+
tagsAsAttributes: true, // (default: false - tags go to description)
|
|
31
|
+
legacyTimeFormat: true // (default: false - use legacy milliseconds precision instead of microseconds)
|
|
32
|
+
},
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
```
|
|
@@ -38,8 +37,8 @@ Option `enable` is set to `true` even if it is not defined explicitly in rpConfi
|
|
|
38
37
|
|
|
39
38
|
### Test Level Attributes
|
|
40
39
|
Test level attributes can be added via cucumber logs e.g. in Before hook
|
|
41
|
-
```
|
|
42
|
-
|
|
40
|
+
```typescript
|
|
41
|
+
import { Before } from '@cucumber/cucumber';
|
|
43
42
|
|
|
44
43
|
Before(function () {
|
|
45
44
|
this.log('log from before'); //just log
|
|
@@ -50,9 +49,13 @@ Before(function () {
|
|
|
50
49
|
### Run Unit Tests
|
|
51
50
|
add token.json file with rp token and other config
|
|
52
51
|
run
|
|
53
|
-
|
|
52
|
+
```
|
|
53
|
+
npm run test
|
|
54
|
+
```
|
|
54
55
|
|
|
55
56
|
### Run E2E Tests
|
|
56
57
|
add token.json file with rp token and other config
|
|
57
58
|
run
|
|
58
|
-
|
|
59
|
+
```
|
|
60
|
+
npm run test-e2e
|
|
61
|
+
```
|
package/index.js
CHANGED
|
@@ -30,15 +30,15 @@ class RPFormatter extends Formatter {
|
|
|
30
30
|
if (envelope.testRunStarted) {
|
|
31
31
|
const startLaunch = this.startLaunch();
|
|
32
32
|
this.promiseQ.push(startLaunch);
|
|
33
|
-
await startLaunch;
|
|
33
|
+
return await startLaunch;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
if (envelope.testCaseFinished) {
|
|
36
36
|
const finishTest = this.finishTest(envelope)
|
|
37
37
|
this.promiseQ.push(finishTest);
|
|
38
|
-
await finishTest;
|
|
38
|
+
return await finishTest;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
await this.finishLaunch();
|
|
40
|
+
if (envelope.testRunFinished) {
|
|
41
|
+
return await this.finishLaunch();
|
|
42
42
|
}
|
|
43
43
|
} catch (err) {
|
|
44
44
|
if (this.rpConfig.ignoreErrors) {
|
|
@@ -77,8 +77,6 @@ class RPFormatter extends Formatter {
|
|
|
77
77
|
const launch = await this.rpClient.finishLaunch(this.launchId, {
|
|
78
78
|
endTime: this.rpClient.helpers.now()
|
|
79
79
|
}).promise;
|
|
80
|
-
|
|
81
|
-
if (this.rpConfig.showLaunchURL) console.log(`RP launch link: ${launch.link}`);
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
async finishTest(envelope) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qavajs/format-report-portal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "cucumber formatter for report portal",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,12 +21,24 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/qavajs/format-report-portal#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@reportportal/client-javascript": "^5.
|
|
24
|
+
"@reportportal/client-javascript": "^5.4.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@cucumber/cucumber": "^
|
|
28
|
-
"@qavajs/
|
|
27
|
+
"@cucumber/cucumber": "^12.2.0",
|
|
28
|
+
"@qavajs/core": "^2.7.0",
|
|
29
29
|
"@qavajs/memory": "^1.10.2",
|
|
30
|
-
"jest": "^
|
|
31
|
-
}
|
|
30
|
+
"jest": "^30.1.3"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"reportportal",
|
|
34
|
+
"rp",
|
|
35
|
+
"cucumber",
|
|
36
|
+
"cucumber-reporter",
|
|
37
|
+
"reporter",
|
|
38
|
+
"cucumber-js",
|
|
39
|
+
"qavajs",
|
|
40
|
+
"test-automation",
|
|
41
|
+
"automation",
|
|
42
|
+
"testing"
|
|
43
|
+
]
|
|
32
44
|
}
|