@reportportal/client-javascript 5.0.8 → 5.0.10
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 +14 -11
- package/VERSION +1 -1
- package/lib/report-portal-client.js +9 -16
- package/package.json +45 -44
- package/statistics/client-id.js +46 -0
- package/statistics/constants.js +48 -0
- package/statistics/statistics.js +52 -0
- package/CHANGELOG.md +0 -56
- package/analytics/analytics.js +0 -15
- package/analytics/constants.js +0 -7
- package/analytics/events.js +0 -17
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# ReportPortal js client
|
|
2
|
-
This Client is to communicate with the Report Portal on
|
|
2
|
+
This Client is to communicate with the Report Portal on Node.js.
|
|
3
3
|
|
|
4
4
|
Library is used only for implementors of custom listeners for ReportPortal.
|
|
5
5
|
|
|
@@ -27,9 +27,9 @@ npm install @reportportal/client-javascript
|
|
|
27
27
|
## Example
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
|
-
|
|
30
|
+
const RPClient = require('@reportportal/client-javascript');
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
const rpClient = new RPClient({
|
|
33
33
|
token: "00000000-0000-0000-0000-000000000000",
|
|
34
34
|
endpoint: "http://your-instance.com:8080/api/v1",
|
|
35
35
|
launch: "LAUNCH_NAME",
|
|
@@ -93,7 +93,7 @@ rpClient.checkConnect().then((response) => {
|
|
|
93
93
|
### startLaunch
|
|
94
94
|
startLaunch - starts a new launch, return temp id that you want to use for all of the items within this launch.
|
|
95
95
|
```javascript
|
|
96
|
-
|
|
96
|
+
const launchObj = rpClient.startLaunch({
|
|
97
97
|
name: "Client test",
|
|
98
98
|
startTime: rpClient.helpers.now(),
|
|
99
99
|
description: "description of the launch",
|
|
@@ -125,7 +125,7 @@ id | id of the existing launch in which tests data would be sent, without
|
|
|
125
125
|
|
|
126
126
|
To know the real launch id wait for the method to finish. The real id is used by the client in asynchronous reporting.
|
|
127
127
|
```javascript
|
|
128
|
-
|
|
128
|
+
const launchObj = rpClient.startLaunch();
|
|
129
129
|
launchObj.promise.then((response) => {
|
|
130
130
|
console.log(`Launch real id: ${response.id}`);
|
|
131
131
|
}, (error) => {
|
|
@@ -140,10 +140,12 @@ As system attributes, this method sends the following data (these data are not f
|
|
|
140
140
|
* RAMSize;
|
|
141
141
|
* nodeJS version;
|
|
142
142
|
|
|
143
|
-
ReportPortal is supporting now integrations with more than 15 test frameworks simultaneously.
|
|
143
|
+
ReportPortal is supporting now integrations with more than 15 test frameworks simultaneously.
|
|
144
|
+
In order to define the most popular agents and plan the team workload accordingly, we are using Google Analytics.
|
|
144
145
|
|
|
145
|
-
ReportPortal collects only information about agent name and version. This information is sent to Google
|
|
146
|
-
|
|
146
|
+
ReportPortal collects only information about agent name, version and version of Node.js. This information is sent to Google Analytics on the launch start.
|
|
147
|
+
Please help us to make our work effective.
|
|
148
|
+
If you still want to switch Off Google Analytics, please change env variable.
|
|
147
149
|
'REPORTPORTAL_CLIENT_JS_NO_ANALYTICS=true'
|
|
148
150
|
|
|
149
151
|
### finishLaunch
|
|
@@ -151,7 +153,7 @@ finishLaunch - finish of the launch. After calling this method, you can not add
|
|
|
151
153
|
The request to finish the launch will be sent only after all items within it have finished.
|
|
152
154
|
```javascript
|
|
153
155
|
// launchObj - object returned by method 'startLaunch'
|
|
154
|
-
|
|
156
|
+
const launchFinishObj = rpClient.finishLaunch(launchObj.tempId, {
|
|
155
157
|
endTime: rpClient.helpers.now()
|
|
156
158
|
});
|
|
157
159
|
```
|
|
@@ -204,13 +206,13 @@ The method takes two arguments:
|
|
|
204
206
|
startTestItem - starts a new test item.
|
|
205
207
|
```javascript
|
|
206
208
|
// launchObj - object returned by method 'startLaunch'
|
|
207
|
-
|
|
209
|
+
const suiteObj = rpClient.startTestItem({
|
|
208
210
|
description: makeid(),
|
|
209
211
|
name: makeid(),
|
|
210
212
|
startTime: rpClient.helpers.now(),
|
|
211
213
|
type: "SUITE"
|
|
212
214
|
}, launchObj.tempId);
|
|
213
|
-
|
|
215
|
+
const stepObj = rpClient.startTestItem({
|
|
214
216
|
description: makeid(),
|
|
215
217
|
name: makeid(),
|
|
216
218
|
startTime: rpClient.helpers.now(),
|
|
@@ -235,6 +237,7 @@ Parameter | Description
|
|
|
235
237
|
--------- | -----------
|
|
236
238
|
name | item name
|
|
237
239
|
type | 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'
|
|
240
|
+
hasStats | (optional) Changes behavior for 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. Default: true
|
|
238
241
|
description | (optional) description of the launch (supports markdown syntax)
|
|
239
242
|
startTime | (optional) start time item(unix time). Default: rpClient.helpers.now()
|
|
240
243
|
attributes | (optional) array of item attributes
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.0.
|
|
1
|
+
5.0.11-SNAPSHOT
|
|
@@ -3,9 +3,9 @@ const UniqId = require('uniqid');
|
|
|
3
3
|
const { URLSearchParams } = require('url');
|
|
4
4
|
const helpers = require('./helpers');
|
|
5
5
|
const RestClient = require('./rest');
|
|
6
|
-
const
|
|
6
|
+
const Statistics = require('../statistics/statistics');
|
|
7
|
+
const { EVENT_NAME } = require('../statistics/constants');
|
|
7
8
|
const { RP_STATUSES } = require('./constants/statuses');
|
|
8
|
-
const { CLIENT_JAVASCRIPT_EVENTS, getAgentEventLabel } = require('../analytics/events');
|
|
9
9
|
|
|
10
10
|
const MULTIPART_BOUNDARY = Math.floor(Math.random() * 10000000000).toString();
|
|
11
11
|
|
|
@@ -34,12 +34,11 @@ class RPClient {
|
|
|
34
34
|
params.isLaunchMergeRequired === undefined ? false : params.isLaunchMergeRequired;
|
|
35
35
|
this.map = {};
|
|
36
36
|
this.baseURL = [params.endpoint, params.project].join('/');
|
|
37
|
-
|
|
37
|
+
this.headers = {
|
|
38
38
|
'User-Agent': 'NodeJS',
|
|
39
39
|
Authorization: `bearer ${params.token}`,
|
|
40
40
|
...(params.headers || {}),
|
|
41
41
|
};
|
|
42
|
-
this.headers = headers;
|
|
43
42
|
this.token = params.token;
|
|
44
43
|
this.config = params;
|
|
45
44
|
this.helpers = helpers;
|
|
@@ -48,7 +47,7 @@ class RPClient {
|
|
|
48
47
|
headers: this.headers,
|
|
49
48
|
restClientConfig: params.restClientConfig,
|
|
50
49
|
});
|
|
51
|
-
this.
|
|
50
|
+
this.statistics = new Statistics(EVENT_NAME, agentParams);
|
|
52
51
|
this.launchUuid = '';
|
|
53
52
|
this.nonRetriedItemMap = new Map();
|
|
54
53
|
}
|
|
@@ -113,17 +112,11 @@ class RPClient {
|
|
|
113
112
|
return RestClient.request('GET', url, {}, { headers: this.headers });
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
triggerStatisticsEvent() {
|
|
117
116
|
if (process.env.REPORTPORTAL_CLIENT_JS_NO_ANALYTICS) {
|
|
118
117
|
return;
|
|
119
118
|
}
|
|
120
|
-
|
|
121
|
-
if (this.analytics.agentParams) {
|
|
122
|
-
const label = getAgentEventLabel(this.analytics.agentParams);
|
|
123
|
-
this.analytics.trackEvent(Object.assign(CLIENT_JAVASCRIPT_EVENTS.START_LAUNCH, { label }));
|
|
124
|
-
} else {
|
|
125
|
-
this.analytics.trackEvent(CLIENT_JAVASCRIPT_EVENTS.START_LAUNCH);
|
|
126
|
-
}
|
|
119
|
+
this.statistics.trackEvent();
|
|
127
120
|
}
|
|
128
121
|
|
|
129
122
|
/**
|
|
@@ -207,7 +200,7 @@ class RPClient {
|
|
|
207
200
|
);
|
|
208
201
|
});
|
|
209
202
|
}
|
|
210
|
-
this.
|
|
203
|
+
this.triggerStatisticsEvent();
|
|
211
204
|
return {
|
|
212
205
|
tempId,
|
|
213
206
|
promise: this.map[tempId].promiseStart,
|
|
@@ -305,9 +298,9 @@ class RPClient {
|
|
|
305
298
|
* Please, keep in mind that this method is work only in case
|
|
306
299
|
* the option isLaunchMergeRequired is true.
|
|
307
300
|
*
|
|
308
|
-
* @
|
|
301
|
+
* @returns {Promise} - action promise
|
|
309
302
|
*/
|
|
310
|
-
mergeLaunches(mergeOptions= {}) {
|
|
303
|
+
mergeLaunches(mergeOptions = {}) {
|
|
311
304
|
if (this.isLaunchMergeRequired) {
|
|
312
305
|
const launchUUIds = helpers.readLaunchesFromFile();
|
|
313
306
|
const params = new URLSearchParams({
|
package/package.json
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reportportal/client-javascript",
|
|
3
|
-
"version": "5.0.
|
|
4
|
-
"description": "ReportPortal client for
|
|
3
|
+
"version": "5.0.10",
|
|
4
|
+
"description": "ReportPortal client for Node.js",
|
|
5
5
|
"author": "ReportPortal.io",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"email": "lexecon117@gmail.com"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"homepage": "https://github.com/reportportal/client-javascript",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/reportportal/client-javascript.git"
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "npm run clean && tsc",
|
|
8
|
+
"clean": "rimraf ./build",
|
|
9
|
+
"lint": "eslint ./statistics/**/* ./lib/**/* ./spec/**/*",
|
|
10
|
+
"format": "npm run lint -- --fix",
|
|
11
|
+
"test": "nyc ./node_modules/jasmine/bin/jasmine.js",
|
|
12
|
+
"test:coverage": "nyc report --reporter=lcov --reporter=text-summary"
|
|
20
13
|
},
|
|
21
14
|
"directories": {
|
|
22
15
|
"lib": "./lib"
|
|
23
16
|
},
|
|
24
17
|
"files": [
|
|
25
18
|
"/lib",
|
|
26
|
-
"/
|
|
19
|
+
"/statistics",
|
|
27
20
|
"/VERSION"
|
|
28
21
|
],
|
|
29
22
|
"main": "./lib/report-portal-client",
|
|
30
23
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
24
|
+
"node": ">=10.x"
|
|
32
25
|
},
|
|
33
26
|
"dependencies": {
|
|
34
27
|
"axios": "^0.27.2",
|
|
35
|
-
"axios-retry": "^3.
|
|
36
|
-
"glob": "^7.2.
|
|
28
|
+
"axios-retry": "^3.4.0",
|
|
29
|
+
"glob": "^7.2.3",
|
|
30
|
+
"ini": "^2.0.0",
|
|
37
31
|
"uniqid": "^5.4.0",
|
|
38
|
-
"
|
|
32
|
+
"uuid": "^9.0.0"
|
|
39
33
|
},
|
|
40
34
|
"license": "Apache-2.0",
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "npm run clean && tsc",
|
|
43
|
-
"clean": "rimraf ./build",
|
|
44
|
-
"lint": "eslint ./analytics/**/* ./lib/**/* ./spec/**/*",
|
|
45
|
-
"format": "npm run lint -- --fix",
|
|
46
|
-
"test": "nyc ./node_modules/jasmine/bin/jasmine.js",
|
|
47
|
-
"test:coverage": "nyc report --reporter=lcov --reporter=text-summary"
|
|
48
|
-
},
|
|
49
35
|
"devDependencies": {
|
|
36
|
+
"@types/jasmine": "^4.3.1",
|
|
37
|
+
"@types/node": "^18.14.2",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
50
40
|
"eslint": "^7.32.0",
|
|
51
41
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
52
|
-
"eslint-plugin-import": "^2.26.0",
|
|
53
|
-
"eslint-plugin-node": "^11.1.0",
|
|
54
|
-
"typescript": "^4.7.4",
|
|
55
|
-
"jasmine": "^3.5.0",
|
|
56
|
-
"lodash": "^4.17.11",
|
|
57
|
-
"nock": "^13.2.9",
|
|
58
|
-
"nyc": "^15.1.0",
|
|
59
|
-
"prettier": "^2.7.1",
|
|
60
|
-
"rimraf": "^3.0.2",
|
|
61
|
-
"@types/jasmine": "^4.0.3",
|
|
62
|
-
"@types/node": "^18.7.6",
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
|
64
|
-
"@typescript-eslint/parser": "^5.33.1",
|
|
65
42
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
66
|
-
"eslint-config-prettier": "^8.
|
|
43
|
+
"eslint-config-prettier": "^8.6.0",
|
|
44
|
+
"eslint-plugin-import": "^2.27.5",
|
|
45
|
+
"eslint-plugin-node": "^11.1.0",
|
|
67
46
|
"eslint-plugin-prettier": "^4.2.1",
|
|
47
|
+
"jasmine": "^3.10.0",
|
|
68
48
|
"jasmine-ts": "^0.4.0",
|
|
69
|
-
"
|
|
49
|
+
"lodash": "^4.17.21",
|
|
50
|
+
"nock": "^13.3.0",
|
|
51
|
+
"nyc": "^15.1.0",
|
|
52
|
+
"prettier": "^2.8.4",
|
|
53
|
+
"rimraf": "^3.0.2",
|
|
54
|
+
"ts-node": "^10.9.1",
|
|
55
|
+
"typescript": "^4.9.5"
|
|
56
|
+
},
|
|
57
|
+
"contributors": [
|
|
58
|
+
{
|
|
59
|
+
"name": "Artsiom Tkachou",
|
|
60
|
+
"email": "artsiom_tkachou@epam.com"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Alexey Krylov",
|
|
64
|
+
"email": "lexecon117@gmail.com"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"homepage": "https://github.com/reportportal/client-javascript",
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "https://github.com/reportportal/client-javascript.git"
|
|
70
71
|
},
|
|
71
72
|
"bugs": {
|
|
72
73
|
"url": "https://github.com/reportportal/client-javascript/issues"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const util = require('util');
|
|
3
|
+
const ini = require('ini');
|
|
4
|
+
const { v4: uuidv4 } = require('uuid');
|
|
5
|
+
const { ENCODING, CLIENT_ID_KEY, RP_FOLDER_PATH, RP_PROPERTIES_FILE_PATH } = require('./constants');
|
|
6
|
+
|
|
7
|
+
const exists = util.promisify(fs.exists);
|
|
8
|
+
const readFile = util.promisify(fs.readFile);
|
|
9
|
+
const mkdir = util.promisify(fs.mkdir);
|
|
10
|
+
const writeFile = util.promisify(fs.writeFile);
|
|
11
|
+
|
|
12
|
+
async function readClientId() {
|
|
13
|
+
if (await exists(RP_PROPERTIES_FILE_PATH)) {
|
|
14
|
+
const propertiesContent = await readFile(RP_PROPERTIES_FILE_PATH, ENCODING);
|
|
15
|
+
const properties = ini.parse(propertiesContent);
|
|
16
|
+
return properties[CLIENT_ID_KEY];
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function storeClientId(clientId) {
|
|
22
|
+
const properties = {};
|
|
23
|
+
if (await exists(RP_PROPERTIES_FILE_PATH)) {
|
|
24
|
+
const propertiesContent = await readFile(RP_PROPERTIES_FILE_PATH, ENCODING);
|
|
25
|
+
Object.assign(properties, ini.parse(propertiesContent));
|
|
26
|
+
}
|
|
27
|
+
properties[CLIENT_ID_KEY] = clientId;
|
|
28
|
+
const propertiesContent = ini.stringify(properties);
|
|
29
|
+
await mkdir(RP_FOLDER_PATH, { recursive: true });
|
|
30
|
+
await writeFile(RP_PROPERTIES_FILE_PATH, propertiesContent, ENCODING);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function getClientId() {
|
|
34
|
+
let clientId = await readClientId();
|
|
35
|
+
if (!clientId) {
|
|
36
|
+
clientId = uuidv4(undefined, undefined, 0);
|
|
37
|
+
try {
|
|
38
|
+
await storeClientId(clientId);
|
|
39
|
+
} catch (ignore) {
|
|
40
|
+
// do nothing on saving error, client ID will be always new
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return clientId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = { getClientId };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const pjson = require('../package.json');
|
|
4
|
+
|
|
5
|
+
const ENCODING = 'utf-8';
|
|
6
|
+
const PJSON_VERSION = pjson.version;
|
|
7
|
+
const PJSON_NAME = pjson.name;
|
|
8
|
+
const CLIENT_ID_KEY = 'client.id';
|
|
9
|
+
const RP_FOLDER = '.rp';
|
|
10
|
+
const RP_PROPERTIES_FILE = 'rp.properties';
|
|
11
|
+
const RP_FOLDER_PATH = path.join(os.homedir(), RP_FOLDER);
|
|
12
|
+
const RP_PROPERTIES_FILE_PATH = path.join(RP_FOLDER_PATH, RP_PROPERTIES_FILE);
|
|
13
|
+
const CLIENT_INFO = Buffer.from(
|
|
14
|
+
'Ry1XUDU3UlNHOFhMOmVFazhPMGJ0UXZ5MmI2VXVRT19TOFE=',
|
|
15
|
+
'base64',
|
|
16
|
+
).toString('binary');
|
|
17
|
+
const [MEASUREMENT_ID, API_KEY] = CLIENT_INFO.split(':');
|
|
18
|
+
const EVENT_NAME = 'start_launch';
|
|
19
|
+
|
|
20
|
+
function getNodeVersion() {
|
|
21
|
+
// A workaround to avoid reference error in case this is not a Node.js application
|
|
22
|
+
if (typeof process !== 'undefined') {
|
|
23
|
+
if (process.versions) {
|
|
24
|
+
const version = process.versions.node;
|
|
25
|
+
if (version) {
|
|
26
|
+
return `Node.js ${version}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const INTERPRETER = getNodeVersion();
|
|
34
|
+
|
|
35
|
+
module.exports = {
|
|
36
|
+
ENCODING,
|
|
37
|
+
EVENT_NAME,
|
|
38
|
+
PJSON_VERSION,
|
|
39
|
+
PJSON_NAME,
|
|
40
|
+
CLIENT_ID_KEY,
|
|
41
|
+
RP_FOLDER,
|
|
42
|
+
RP_FOLDER_PATH,
|
|
43
|
+
RP_PROPERTIES_FILE,
|
|
44
|
+
RP_PROPERTIES_FILE_PATH,
|
|
45
|
+
MEASUREMENT_ID,
|
|
46
|
+
API_KEY,
|
|
47
|
+
INTERPRETER,
|
|
48
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const { MEASUREMENT_ID, API_KEY, PJSON_NAME, PJSON_VERSION, INTERPRETER } = require('./constants');
|
|
3
|
+
const { getClientId } = require('./client-id');
|
|
4
|
+
|
|
5
|
+
class Statistics {
|
|
6
|
+
constructor(eventName, agentParams) {
|
|
7
|
+
this.eventName = eventName;
|
|
8
|
+
this.eventParams = this.getEventParams(agentParams);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getEventParams(agentParams) {
|
|
12
|
+
const params = {
|
|
13
|
+
interpreter: INTERPRETER,
|
|
14
|
+
client_name: PJSON_NAME,
|
|
15
|
+
client_version: PJSON_VERSION,
|
|
16
|
+
};
|
|
17
|
+
if (
|
|
18
|
+
agentParams &&
|
|
19
|
+
Object.prototype.hasOwnProperty.call(agentParams, 'name') &&
|
|
20
|
+
agentParams.name
|
|
21
|
+
) {
|
|
22
|
+
params.agent_name = agentParams.name;
|
|
23
|
+
}
|
|
24
|
+
if (
|
|
25
|
+
agentParams &&
|
|
26
|
+
Object.prototype.hasOwnProperty.call(agentParams, 'version') &&
|
|
27
|
+
agentParams.version
|
|
28
|
+
) {
|
|
29
|
+
params.agent_version = agentParams.version;
|
|
30
|
+
}
|
|
31
|
+
return params;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async trackEvent() {
|
|
35
|
+
const requestBody = {
|
|
36
|
+
client_id: await getClientId(),
|
|
37
|
+
events: [
|
|
38
|
+
{
|
|
39
|
+
name: this.eventName,
|
|
40
|
+
params: this.eventParams,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
await axios.post(
|
|
46
|
+
`https://www.google-analytics.com/mp/collect?measurement_id=${MEASUREMENT_ID}&api_secret=${API_KEY}`,
|
|
47
|
+
requestBody,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = Statistics;
|
package/CHANGELOG.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
## [5.0.8] - 2023-01-24
|
|
3
|
-
### Added
|
|
4
|
-
- `mergeOptions` parameter to `mergeLaunches` method.
|
|
5
|
-
- Dynamic page size for launch merge based on launches count, resolves [#86](https://github.com/reportportal/client-javascript/issues/86).
|
|
6
|
-
### Security
|
|
7
|
-
- Updated versions of vulnerable packages (json5, minimist).
|
|
8
|
-
|
|
9
|
-
## [5.0.7] - 2022-12-26
|
|
10
|
-
### Added
|
|
11
|
-
- The ability to see verbose logs in debug mode. To enable the debug mode, the `debug: true` flag should be specified in `params`.
|
|
12
|
-
### Security
|
|
13
|
-
- Updated versions of vulnerable packages (ajv, qs, follow-redirects, minimatch).
|
|
14
|
-
|
|
15
|
-
## [5.0.6] - 2022-01-13
|
|
16
|
-
### Fixed
|
|
17
|
-
- Security vulnerabilities (axios, path-parse, minimist)
|
|
18
|
-
### Changed
|
|
19
|
-
- Package size reduced
|
|
20
|
-
|
|
21
|
-
## [5.0.5] - 2021-05-25
|
|
22
|
-
### Added
|
|
23
|
-
- Possibility to change Axios Requests timeout (closes [#115](https://github.com/reportportal/client-javascript/issues/115))
|
|
24
|
-
### Changed
|
|
25
|
-
- Default timeout on Axios Requests increased to 30000ms
|
|
26
|
-
### Fixed
|
|
27
|
-
- [Issue](https://github.com/reportportal/client-javascript/issues/102) with self-signed certificate
|
|
28
|
-
- Security vulnerabilities (lodash, handlebars, hosted-git-info)
|
|
29
|
-
|
|
30
|
-
## [5.0.4] - 2021-04-29
|
|
31
|
-
### Added
|
|
32
|
-
- Timeout (default is 5000ms) on Axios Requests
|
|
33
|
-
### Fixed
|
|
34
|
-
- Security vulnerabilities ([axios](https://github.com/reportportal/client-javascript/issues/109))
|
|
35
|
-
- [Issue](https://github.com/reportportal/client-javascript/issues/94) with the finish of a non-existent test item
|
|
36
|
-
|
|
37
|
-
## [5.0.3] - 2020-11-09
|
|
38
|
-
### Added
|
|
39
|
-
- Environment variable
|
|
40
|
-
|
|
41
|
-
## [5.0.2] - 2020-08-27
|
|
42
|
-
### Fixed
|
|
43
|
-
- [Issue](https://github.com/reportportal/client-javascript/pull/91) with request headers
|
|
44
|
-
- Default status for suite/test items without children
|
|
45
|
-
|
|
46
|
-
## [5.0.1] - 2020-08-14
|
|
47
|
-
### Changed
|
|
48
|
-
- Packages publishing workflow improved
|
|
49
|
-
### Added
|
|
50
|
-
- The ability to disable google analytics
|
|
51
|
-
|
|
52
|
-
## [5.0.0] - 2020-06-09
|
|
53
|
-
### Added
|
|
54
|
-
- Full compatibility with ReportPortal version 5.* (see [reportportal releases](https://github.com/reportportal/reportportal/releases))
|
|
55
|
-
### Deprecated
|
|
56
|
-
- Previous package version (`reportportal-client`) will no longer supported by reportportal.io
|
package/analytics/analytics.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const ua = require('universal-analytics');
|
|
2
|
-
const { GOOGLE_ANALYTICS_INSTANCE } = require('./constants');
|
|
3
|
-
|
|
4
|
-
class Analytics {
|
|
5
|
-
constructor(agentParams) {
|
|
6
|
-
this.agentParams = agentParams;
|
|
7
|
-
this.visitorInstance = ua(GOOGLE_ANALYTICS_INSTANCE);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
trackEvent(event) {
|
|
11
|
-
this.visitorInstance.event(event.category, event.action, event.label).send();
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = Analytics;
|
package/analytics/constants.js
DELETED
package/analytics/events.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const { PJSON_VERSION, PJSON_NAME } = require('./constants');
|
|
2
|
-
|
|
3
|
-
const CLIENT_JAVASCRIPT = `Client name "${PJSON_NAME}", version "${PJSON_VERSION}"`;
|
|
4
|
-
const CLIENT_JAVASCRIPT_EVENTS = {
|
|
5
|
-
START_LAUNCH: {
|
|
6
|
-
category: CLIENT_JAVASCRIPT,
|
|
7
|
-
action: 'Start launch',
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const getAgentEventLabel = (agentParams) =>
|
|
12
|
-
`Agent name "${agentParams.name}", version "${agentParams.version}"`;
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
CLIENT_JAVASCRIPT_EVENTS,
|
|
16
|
-
getAgentEventLabel,
|
|
17
|
-
};
|