@reportportal/client-javascript 5.3.1 → 5.4.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.
- package/README.md +18 -29
- package/VERSION +1 -1
- package/lib/helpers.js +1 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -128,13 +128,13 @@ console.log(launchObj.tempId);
|
|
|
128
128
|
The method takes one argument:
|
|
129
129
|
* launch data object:
|
|
130
130
|
|
|
131
|
-
| Option | Necessity | Default | Description
|
|
132
|
-
|
|
133
|
-
| startTime | Optional | rpClient.helpers.now() | Start time of the launch (
|
|
134
|
-
| name | Optional | parameter 'launch' specified when creating the client instance | Name of the launch.
|
|
135
|
-
| mode | Optional | 'DEFAULT' | 'DEFAULT' - results will be submitted to Launches page, 'DEBUG' - results will be submitted to Debug page.
|
|
136
|
-
| description | Optional | '' | Description of the launch (supports markdown syntax).
|
|
137
|
-
| attributes | Optional | [] | Array of launch attributes (tags).
|
|
131
|
+
| Option | Necessity | Default | Description |
|
|
132
|
+
|-------------|-----------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
|
|
133
|
+
| startTime | Optional | rpClient.helpers.now() | Start time of the launch (unix time). |
|
|
134
|
+
| name | Optional | parameter 'launch' specified when creating the client instance | Name of the launch. |
|
|
135
|
+
| mode | Optional | 'DEFAULT' | 'DEFAULT' - results will be submitted to Launches page, 'DEBUG' - results will be submitted to Debug page. |
|
|
136
|
+
| description | Optional | '' | Description of the launch (supports markdown syntax). |
|
|
137
|
+
| attributes | Optional | [] | Array of launch attributes (tags). |
|
|
138
138
|
| id | Optional | Not set | `ID` of the existing launch in which tests data would be sent, without this param new launch instance will be created. |
|
|
139
139
|
|
|
140
140
|
To get the real launch `ID` (also known as launch `UUID` from database) wait for the returned promise to finish.
|
|
@@ -179,9 +179,9 @@ The method takes two arguments:
|
|
|
179
179
|
* launch `tempId` (returned by the method `startLaunch`)
|
|
180
180
|
* data object:
|
|
181
181
|
|
|
182
|
-
|Option | Necessity | Default | Description
|
|
183
|
-
|---------
|
|
184
|
-
|endTime | Optional | rpClient.helpers.now() | End time of the launch
|
|
182
|
+
|Option | Necessity | Default | Description |
|
|
183
|
+
|--------- |-----------|---------|---------------------------------------------------------------------------------------------------|
|
|
184
|
+
|endTime | Optional | rpClient.helpers.now() | End time of the launch. |
|
|
185
185
|
|status | Optional | '' | Status of launch, one of '', 'PASSED', 'FAILED', 'STOPPED', 'SKIPPED', 'INTERRUPTED', 'CANCELLED'. |
|
|
186
186
|
|
|
187
187
|
### getPromiseFinishAllItems
|
|
@@ -264,7 +264,7 @@ The method takes three arguments:
|
|
|
264
264
|
|type | Required | | Test item type, one of 'SUITE', 'STORY', 'TEST', 'SCENARIO', 'STEP', 'BEFORE_CLASS', 'BEFORE_GROUPS','BEFORE_METHOD', 'BEFORE_SUITE', 'BEFORE_TEST', 'AFTER_CLASS', 'AFTER_GROUPS', 'AFTER_METHOD', 'AFTER_SUITE', 'AFTER_TEST' |
|
|
265
265
|
|hasStats | Optional | true | Changes behavior for test item of type 'STEP'. When set to `true`, step is treaten as a test case (entity containig statistics). When false, step becomes a nested step. |
|
|
266
266
|
|description | Optional | '' | Description of the test item (supports markdown syntax). |
|
|
267
|
-
|startTime | Optional | rpClient.helpers.now() | Start time of the test item (
|
|
267
|
+
|startTime | Optional | rpClient.helpers.now() | Start time of the test item (unix time). |
|
|
268
268
|
|attributes | Optional | [] | Array of the test item attributes. |
|
|
269
269
|
|
|
270
270
|
* launch `tempId` (returned by the method `startLaunch`)
|
|
@@ -288,8 +288,8 @@ The method takes two arguments:
|
|
|
288
288
|
| Option | Necessity | Default | Description |
|
|
289
289
|
|---------|-----------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
|
290
290
|
| issue | Optional | true | Test item issue object. `issueType` is required, allowable values: 'pb***', 'ab***', 'si***', 'ti***', 'nd001'. Where `***` is locator id |
|
|
291
|
-
| status | Optional | 'PASSED' | Test item status, one of '', 'PASSED', 'FAILED', 'STOPPED', 'SKIPPED', 'INTERRUPTED', 'CANCELLED'.
|
|
292
|
-
| endTime | Optional | rpClient.helpers.now() | End time of the launch (
|
|
291
|
+
| status | Optional | 'PASSED' | Test item status, one of '', 'PASSED', 'FAILED', 'STOPPED', 'SKIPPED', 'INTERRUPTED', 'CANCELLED'. |
|
|
292
|
+
| endTime | Optional | rpClient.helpers.now() | End time of the launch (unix time). |
|
|
293
293
|
|
|
294
294
|
Example issue object:
|
|
295
295
|
```
|
|
@@ -324,11 +324,11 @@ The method takes three arguments:
|
|
|
324
324
|
* test item `tempId` (returned by method `startTestItem`)
|
|
325
325
|
* data object:
|
|
326
326
|
|
|
327
|
-
| Option | Necessity | Default | Description
|
|
328
|
-
|
|
329
|
-
| message | Optional | '' | The log message.
|
|
327
|
+
| Option | Necessity | Default | Description |
|
|
328
|
+
|---------|-----------|------------------------|----------------------------------------------------------------------|
|
|
329
|
+
| message | Optional | '' | The log message. |
|
|
330
330
|
| level | Optional | '' | The log level, one of 'trace', 'debug', 'info', 'warn', 'error', ''. |
|
|
331
|
-
| time | Optional | rpClient.helpers.now() | The time of the log
|
|
331
|
+
| time | Optional | rpClient.helpers.now() | The time of the log. |
|
|
332
332
|
|
|
333
333
|
* file object (optional):
|
|
334
334
|
|
|
@@ -369,24 +369,13 @@ The method takes one argument:
|
|
|
369
369
|
|-------------------------|-----------|-----------------------------------------|------------------------------------------------------------------------------------------------------------|
|
|
370
370
|
| description | Optional | config.description or 'Merged launch' | Description of the launch (supports markdown syntax). |
|
|
371
371
|
| attributes | Optional | config.attributes or [] | Array of launch attributes (tags). |
|
|
372
|
-
| endTime | Optional | rpClient.helpers.now() | End time of the launch (
|
|
372
|
+
| endTime | Optional | rpClient.helpers.now() | End time of the launch (unix time) |
|
|
373
373
|
| extendSuitesDescription | Optional | true | Whether to extend suites description or not. |
|
|
374
374
|
| launches | Optional | ids of the launches saved to filesystem | The array of the real launch ids, not UUIDs |
|
|
375
375
|
| mergeType | Optional | 'BASIC' | The type of the merge operation. Possible values are 'BASIC' or 'DEEP'. |
|
|
376
376
|
| mode | Optional | config.mode or 'DEFAULT' | 'DEFAULT' - results will be submitted to Launches page, 'DEBUG' - results will be submitted to Debug page. |
|
|
377
377
|
| name | Optional | config.launch or 'Test launch name' | Name of the launch after merge. |
|
|
378
378
|
|
|
379
|
-
## Time format
|
|
380
|
-
|
|
381
|
-
The unix Epoch time ISO string.
|
|
382
|
-
|
|
383
|
-
The [ReportPortal since product version 24.2]() (Service API version 5.12.0) supports the time with microsecond precision in the ISO string format (`2024-09-23T11:10:46.793546Z`).
|
|
384
|
-
Thus, it is recommended to report time in this format to have more accurate logs and test items order on the ReportPortal UI.
|
|
385
|
-
|
|
386
|
-
**Note:** Reporting the time in ISO string format with millisecond precision (`2024-09-23T11:10:46.793Z`) or as a number of milliseconds (`1727089846793`) is also acceptable with microseconds automatically added as zeros on ReportPortal's API service for backward compatibility.
|
|
387
|
-
|
|
388
|
-
The client use time with microsecond precision in the ISO string format by default since [version 5.3.0]().
|
|
389
|
-
|
|
390
379
|
# Copyright Notice
|
|
391
380
|
|
|
392
381
|
Licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.
|
|
1
|
+
5.4.2-SNAPSHOT
|
package/lib/helpers.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const glob = require('glob');
|
|
3
3
|
const os = require('os');
|
|
4
|
-
const microtime = require('microtime');
|
|
5
4
|
const RestClient = require('./rest');
|
|
6
5
|
const pjson = require('../package.json');
|
|
7
6
|
|
|
@@ -18,16 +17,8 @@ const formatName = (name) => {
|
|
|
18
17
|
return (len < MIN ? name + new Array(MIN - len + 1).join('.') : name).slice(-MAX);
|
|
19
18
|
};
|
|
20
19
|
|
|
21
|
-
const formatMicrosecondsToISOString = (timestampInMicroseconds) => {
|
|
22
|
-
const milliseconds = Math.floor(timestampInMicroseconds / 1000);
|
|
23
|
-
const microseconds = String(timestampInMicroseconds).slice(-3);
|
|
24
|
-
const isoDate = new Date(milliseconds).toISOString();
|
|
25
|
-
|
|
26
|
-
return isoDate.replace('Z', `${microseconds}Z`);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
20
|
const now = () => {
|
|
30
|
-
return
|
|
21
|
+
return new Date().valueOf();
|
|
31
22
|
};
|
|
32
23
|
|
|
33
24
|
// TODO: deprecate and remove
|
|
@@ -110,7 +101,6 @@ const saveLaunchUuidToFile = (launchUuid) => {
|
|
|
110
101
|
|
|
111
102
|
module.exports = {
|
|
112
103
|
formatName,
|
|
113
|
-
formatMicrosecondsToISOString,
|
|
114
104
|
now,
|
|
115
105
|
getServerResult,
|
|
116
106
|
readLaunchesFromFile,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reportportal/client-javascript",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"description": "ReportPortal client for Node.js",
|
|
5
5
|
"author": "ReportPortal.io",
|
|
6
6
|
"scripts": {
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"/VERSION"
|
|
21
21
|
],
|
|
22
22
|
"main": "./lib/report-portal-client",
|
|
23
|
+
"types": "./index.d.ts",
|
|
23
24
|
"engines": {
|
|
24
25
|
"node": ">=14.x"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"axios": "^1.
|
|
28
|
+
"axios": "^1.8.4",
|
|
28
29
|
"axios-retry": "^4.1.0",
|
|
29
30
|
"glob": "^8.1.0",
|
|
30
31
|
"ini": "^2.0.0",
|
|
31
32
|
"uniqid": "^5.4.0",
|
|
32
|
-
"uuid": "^9.0.1"
|
|
33
|
-
"microtime": "^3.1.1"
|
|
33
|
+
"uuid": "^9.0.1"
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
36
|
"devDependencies": {
|