@testim/testim-cli 3.282.0 → 3.283.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.
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const _ = require('lodash');
|
|
3
4
|
const pako = require('pako');
|
|
4
5
|
const pRetry = require('p-retry');
|
|
5
|
-
const
|
|
6
|
-
const testimCustomToken = require('./testimCustomToken');
|
|
7
|
-
const constants = require('./constants');
|
|
6
|
+
const hash = require('object-hash');
|
|
8
7
|
const utils = require('../utils');
|
|
9
8
|
const config = require('./config');
|
|
9
|
+
const constants = require('./constants');
|
|
10
10
|
const httpRequest = require('./httpRequest');
|
|
11
|
+
const testimCustomToken = require('./testimCustomToken');
|
|
12
|
+
const { ArgError } = require('../errors');
|
|
13
|
+
const { getLogger } = require('./logger');
|
|
11
14
|
|
|
12
15
|
const runnerVersion = utils.getRunnerVersion();
|
|
13
|
-
const logger =
|
|
14
|
-
const hash = require('object-hash');
|
|
15
|
-
const { ArgError } = require('../errors');
|
|
16
|
+
const logger = getLogger('testim service api');
|
|
16
17
|
|
|
17
18
|
const DEFAULT_REQUEST_RETRY = 3;
|
|
18
19
|
const GRID_PATH = '/grid';
|
|
@@ -515,9 +516,9 @@ function addTestRetry({
|
|
|
515
516
|
* @param {string} projectId
|
|
516
517
|
* @returns {Promise<import('../../../clickim/src/common/api/testimApplitoolsApi').ApplitoolsIntegrationData>}
|
|
517
518
|
*/
|
|
518
|
-
function getApplitoolsIntegrationData(projectId) {
|
|
519
|
+
async function getApplitoolsIntegrationData(projectId) {
|
|
519
520
|
try {
|
|
520
|
-
return getWithAuth(`/integration/applitools/v3/connected?projectId=${projectId}`);
|
|
521
|
+
return await getWithAuth(`/integration/applitools/v3/connected?projectId=${projectId}`);
|
|
521
522
|
} catch (err) {
|
|
522
523
|
logger.warn('could\'nt get applitools integration data.', { err });
|
|
523
524
|
return {};
|
|
@@ -525,25 +526,40 @@ function getApplitoolsIntegrationData(projectId) {
|
|
|
525
526
|
}
|
|
526
527
|
|
|
527
528
|
|
|
528
|
-
|
|
529
|
+
/**
|
|
530
|
+
* @param {string} companyId
|
|
531
|
+
* @param {string[]} routes
|
|
532
|
+
* @returns {Promise<{ _id?: string; token?: string; routesMapping?: { [k: string]: string; } }>}
|
|
533
|
+
*/
|
|
534
|
+
async function getCloudflareTunnel(companyId, routes) {
|
|
529
535
|
try {
|
|
530
|
-
return putAuth('/tunnel', { companyId, routes });
|
|
536
|
+
return await putAuth('/tunnel', { companyId, routes });
|
|
531
537
|
} catch (err) {
|
|
532
538
|
logger.warn('could\'nt get tunnel.', { err });
|
|
533
539
|
return {};
|
|
534
540
|
}
|
|
535
541
|
}
|
|
536
|
-
|
|
542
|
+
/**
|
|
543
|
+
* @param {string} companyId
|
|
544
|
+
* @param {string} tunnelId
|
|
545
|
+
* @returns {Promise<void>}
|
|
546
|
+
*/
|
|
547
|
+
async function forceUpdateCloudflareTunnelRoutes(companyId, tunnelId) {
|
|
537
548
|
try {
|
|
538
|
-
return postAuth({ url: `/tunnel/${tunnelId}`, body: { companyId } });
|
|
549
|
+
return await postAuth({ url: `/tunnel/${tunnelId}`, body: { companyId } });
|
|
539
550
|
} catch (err) {
|
|
540
551
|
logger.warn('could\'nt get tunnel.', { err });
|
|
541
|
-
return
|
|
552
|
+
return undefined;
|
|
542
553
|
}
|
|
543
554
|
}
|
|
544
|
-
|
|
555
|
+
/**
|
|
556
|
+
* @param {string} companyId
|
|
557
|
+
* @param {string} tunnelId
|
|
558
|
+
* @returns {Promise<void>}
|
|
559
|
+
*/
|
|
560
|
+
async function deleteCloudflareTunnel(companyId, tunnelId) {
|
|
545
561
|
try {
|
|
546
|
-
return deleteAuth(`/tunnel/${tunnelId}`, { companyId });
|
|
562
|
+
return await deleteAuth(`/tunnel/${tunnelId}`, { companyId });
|
|
547
563
|
} catch (err) {
|
|
548
564
|
logger.warn('could\'nt get tunnel.', { err });
|
|
549
565
|
return {};
|
|
@@ -566,7 +582,7 @@ async function getMobileDevicesFromGrid({ projectId, projectType, gridId, compan
|
|
|
566
582
|
let url = `${GRID_PATH}/mobileDevices/${gridId}/${companyId}?projectType=${projectType}`;
|
|
567
583
|
url = selectors ? `${url}&selectors=${encodeURIComponent(selectors)}` : url;
|
|
568
584
|
try {
|
|
569
|
-
return pRetry(() => getWithAuth(url, { projectId }), { retries: DEFAULT_REQUEST_RETRY });
|
|
585
|
+
return await pRetry(() => getWithAuth(url, { projectId }), { retries: DEFAULT_REQUEST_RETRY });
|
|
570
586
|
} catch (err) {
|
|
571
587
|
logger.warn('could\'nt get devices from headspin grid.', { err });
|
|
572
588
|
return null;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.283.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@testim/testim-cli",
|
|
9
|
-
"version": "3.
|
|
9
|
+
"version": "3.283.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.11.21",
|
|
@@ -1194,9 +1194,9 @@
|
|
|
1194
1194
|
}
|
|
1195
1195
|
},
|
|
1196
1196
|
"node_modules/@wdio/config/node_modules/minimatch": {
|
|
1197
|
-
"version": "5.1.
|
|
1198
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
1199
|
-
"integrity": "sha512-
|
|
1197
|
+
"version": "5.1.6",
|
|
1198
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
1199
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
1200
1200
|
"dependencies": {
|
|
1201
1201
|
"brace-expansion": "^2.0.1"
|
|
1202
1202
|
},
|
|
@@ -5201,9 +5201,9 @@
|
|
|
5201
5201
|
}
|
|
5202
5202
|
},
|
|
5203
5203
|
"node_modules/filelist/node_modules/minimatch": {
|
|
5204
|
-
"version": "5.1.
|
|
5205
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
5206
|
-
"integrity": "sha512-
|
|
5204
|
+
"version": "5.1.6",
|
|
5205
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
5206
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
5207
5207
|
"dependencies": {
|
|
5208
5208
|
"brace-expansion": "^2.0.1"
|
|
5209
5209
|
},
|
|
@@ -7503,9 +7503,9 @@
|
|
|
7503
7503
|
}
|
|
7504
7504
|
},
|
|
7505
7505
|
"node_modules/js-beautify/node_modules/minimatch": {
|
|
7506
|
-
"version": "5.1.
|
|
7507
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
7508
|
-
"integrity": "sha512-
|
|
7506
|
+
"version": "5.1.6",
|
|
7507
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
7508
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
7509
7509
|
"dev": true,
|
|
7510
7510
|
"dependencies": {
|
|
7511
7511
|
"brace-expansion": "^2.0.1"
|
|
@@ -12555,9 +12555,9 @@
|
|
|
12555
12555
|
}
|
|
12556
12556
|
},
|
|
12557
12557
|
"node_modules/readdir-glob/node_modules/minimatch": {
|
|
12558
|
-
"version": "5.1.
|
|
12559
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
12560
|
-
"integrity": "sha512-
|
|
12558
|
+
"version": "5.1.6",
|
|
12559
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
12560
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
12561
12561
|
"dependencies": {
|
|
12562
12562
|
"brace-expansion": "^2.0.1"
|
|
12563
12563
|
},
|
|
@@ -13627,9 +13627,9 @@
|
|
|
13627
13627
|
}
|
|
13628
13628
|
},
|
|
13629
13629
|
"node_modules/socket.io-parser": {
|
|
13630
|
-
"version": "4.2.
|
|
13631
|
-
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.
|
|
13632
|
-
"integrity": "sha512-
|
|
13630
|
+
"version": "4.2.2",
|
|
13631
|
+
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz",
|
|
13632
|
+
"integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==",
|
|
13633
13633
|
"dependencies": {
|
|
13634
13634
|
"@socket.io/component-emitter": "~3.1.0",
|
|
13635
13635
|
"debug": "~4.3.1"
|
|
@@ -15350,9 +15350,9 @@
|
|
|
15350
15350
|
}
|
|
15351
15351
|
},
|
|
15352
15352
|
"node_modules/webdriverio/node_modules/minimatch": {
|
|
15353
|
-
"version": "5.1.
|
|
15354
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
15355
|
-
"integrity": "sha512-
|
|
15353
|
+
"version": "5.1.6",
|
|
15354
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
15355
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
15356
15356
|
"dependencies": {
|
|
15357
15357
|
"brace-expansion": "^2.0.1"
|
|
15358
15358
|
},
|
|
@@ -16733,9 +16733,9 @@
|
|
|
16733
16733
|
}
|
|
16734
16734
|
},
|
|
16735
16735
|
"minimatch": {
|
|
16736
|
-
"version": "5.1.
|
|
16737
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
16738
|
-
"integrity": "sha512-
|
|
16736
|
+
"version": "5.1.6",
|
|
16737
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
16738
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
16739
16739
|
"requires": {
|
|
16740
16740
|
"brace-expansion": "^2.0.1"
|
|
16741
16741
|
}
|
|
@@ -19918,9 +19918,9 @@
|
|
|
19918
19918
|
}
|
|
19919
19919
|
},
|
|
19920
19920
|
"minimatch": {
|
|
19921
|
-
"version": "5.1.
|
|
19922
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
19923
|
-
"integrity": "sha512-
|
|
19921
|
+
"version": "5.1.6",
|
|
19922
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
19923
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
19924
19924
|
"requires": {
|
|
19925
19925
|
"brace-expansion": "^2.0.1"
|
|
19926
19926
|
}
|
|
@@ -21690,9 +21690,9 @@
|
|
|
21690
21690
|
}
|
|
21691
21691
|
},
|
|
21692
21692
|
"minimatch": {
|
|
21693
|
-
"version": "5.1.
|
|
21694
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
21695
|
-
"integrity": "sha512-
|
|
21693
|
+
"version": "5.1.6",
|
|
21694
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
21695
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
21696
21696
|
"dev": true,
|
|
21697
21697
|
"requires": {
|
|
21698
21698
|
"brace-expansion": "^2.0.1"
|
|
@@ -25416,9 +25416,9 @@
|
|
|
25416
25416
|
}
|
|
25417
25417
|
},
|
|
25418
25418
|
"minimatch": {
|
|
25419
|
-
"version": "5.1.
|
|
25420
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
25421
|
-
"integrity": "sha512-
|
|
25419
|
+
"version": "5.1.6",
|
|
25420
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
25421
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
25422
25422
|
"requires": {
|
|
25423
25423
|
"brace-expansion": "^2.0.1"
|
|
25424
25424
|
}
|
|
@@ -26282,9 +26282,9 @@
|
|
|
26282
26282
|
}
|
|
26283
26283
|
},
|
|
26284
26284
|
"socket.io-parser": {
|
|
26285
|
-
"version": "4.2.
|
|
26286
|
-
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.
|
|
26287
|
-
"integrity": "sha512-
|
|
26285
|
+
"version": "4.2.2",
|
|
26286
|
+
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz",
|
|
26287
|
+
"integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==",
|
|
26288
26288
|
"requires": {
|
|
26289
26289
|
"@socket.io/component-emitter": "~3.1.0",
|
|
26290
26290
|
"debug": "~4.3.1"
|
|
@@ -27696,9 +27696,9 @@
|
|
|
27696
27696
|
}
|
|
27697
27697
|
},
|
|
27698
27698
|
"minimatch": {
|
|
27699
|
-
"version": "5.1.
|
|
27700
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
27701
|
-
"integrity": "sha512-
|
|
27699
|
+
"version": "5.1.6",
|
|
27700
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
27701
|
+
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
27702
27702
|
"requires": {
|
|
27703
27703
|
"brace-expansion": "^2.0.1"
|
|
27704
27704
|
}
|
package/package.json
CHANGED
|
@@ -93,9 +93,11 @@ class ParallelWorkerManager {
|
|
|
93
93
|
const companyPlan = options.company?.planType;
|
|
94
94
|
const isStartUp = options.company?.isStartUp;
|
|
95
95
|
const projectName = options.projectData?.name;
|
|
96
|
+
const projectType = options.projectData?.type;
|
|
96
97
|
const lightweightMode = options.lightweightMode;
|
|
97
98
|
const sessionType = utils.getSessionType(options);
|
|
98
99
|
|
|
100
|
+
|
|
99
101
|
/**
|
|
100
102
|
* @param {number} wid
|
|
101
103
|
* @param {string} testId
|
|
@@ -120,6 +122,7 @@ class ParallelWorkerManager {
|
|
|
120
122
|
user,
|
|
121
123
|
lightweightMode,
|
|
122
124
|
isStartUp,
|
|
125
|
+
projectType,
|
|
123
126
|
});
|
|
124
127
|
return testStatus.testStartAndReport(wid, executionId, resultId, isRerun, testRetryKey);
|
|
125
128
|
};
|
|
@@ -193,6 +196,7 @@ class ParallelWorkerManager {
|
|
|
193
196
|
lightweightMode,
|
|
194
197
|
logger,
|
|
195
198
|
isStartUp,
|
|
199
|
+
projectType,
|
|
196
200
|
});
|
|
197
201
|
if (stopOnError && !testResult.success) {
|
|
198
202
|
executionQueue.stop();
|
|
@@ -31,7 +31,7 @@ function setLightweightAnalytics(properties, lightweightMode) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function analyticsTestStart({
|
|
34
|
-
executionId, projectId, testId, resultId, companyId, companyName, projectName, companyPlan, sessionType, source, user, lightweightMode, isStartUp,
|
|
34
|
+
executionId, projectId, testId, resultId, companyId, companyName, projectName, companyPlan, sessionType, source, user, lightweightMode, isStartUp, projectType,
|
|
35
35
|
}) {
|
|
36
36
|
const properties = setLightweightAnalytics({
|
|
37
37
|
executionId,
|
|
@@ -45,13 +45,14 @@ function analyticsTestStart({
|
|
|
45
45
|
sessionType,
|
|
46
46
|
source: calcSource(source, user),
|
|
47
47
|
isStartUp,
|
|
48
|
+
projectType,
|
|
48
49
|
}, lightweightMode);
|
|
49
50
|
analytics.trackWithCIUser('test-run-ci', properties);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
function analyticsTestEnd({
|
|
53
54
|
executionId, projectId, testId, resultId, result, companyId, companyName, projectName, companyPlan, sessionType, source, user, lightweightMode,
|
|
54
|
-
logger, isStartUp,
|
|
55
|
+
logger, isStartUp, projectType,
|
|
55
56
|
}) {
|
|
56
57
|
try {
|
|
57
58
|
const properties = setLightweightAnalytics({
|
|
@@ -67,6 +68,7 @@ function analyticsTestEnd({
|
|
|
67
68
|
mockNetworkEnabled: result.wasMockNetworkActivated,
|
|
68
69
|
source: calcSource(source, user),
|
|
69
70
|
isStartUp,
|
|
71
|
+
projectType,
|
|
70
72
|
}, lightweightMode);
|
|
71
73
|
|
|
72
74
|
if (result.success) {
|
|
@@ -79,8 +81,6 @@ function analyticsTestEnd({
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
84
|
function analyticsExecsStart({ executionId, projectId, sessionType }) {
|
|
85
85
|
analytics.trackWithCIUser('batch-run-ci', {
|
|
86
86
|
executionId,
|