@testim/testim-cli 3.254.0 → 3.255.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/agent/routers/codim/router.test.js +9 -12
- package/agent/routers/codim/service.js +16 -16
- package/agent/routers/playground/service.js +5 -7
- package/cli.js +4 -4
- package/cliAgentMode.js +4 -3
- package/codim/codim-cli.js +10 -8
- package/commons/featureFlags.js +8 -0
- package/commons/httpRequest.js +5 -1
- package/commons/httpRequestCounters.js +21 -10
- package/commons/lazyRequire.js +4 -3
- package/commons/preloadTests.js +2 -2
- package/commons/prepareRunner.js +4 -2
- package/commons/prepareRunnerAndTestimStartUtils.js +40 -41
- package/commons/runnerFileCache.js +1 -1
- package/commons/testimTunnel.test.js +2 -1
- package/coverage/SummaryToObjectReport.js +0 -1
- package/coverage/jsCoverage.js +12 -10
- package/inputFileUtils.js +11 -9
- package/npm-shrinkwrap.json +187 -444
- package/package.json +4 -3
- package/player/services/tabService.js +15 -1
- package/player/stepActions/locateStepAction.js +2 -0
- package/player/utils/imageCaptureUtils.js +81 -120
- package/player/webdriver.js +25 -22
- package/reports/junitReporter.js +6 -7
- package/reports/reporter.js +34 -39
- package/runOptions.d.ts +260 -0
- package/runOptions.js +53 -38
- package/runner.js +2 -1
- package/runners/ParallelWorkerManager.js +9 -10
- package/runners/TestPlanRunner.js +5 -9
- package/services/gridService.js +36 -40
- package/testRunStatus.js +8 -5
- package/utils/argsUtils.js +86 -0
- package/utils/argsUtils.test.js +32 -0
- package/utils/fsUtils.js +154 -0
- package/utils/index.js +10 -161
- package/utils/promiseUtils.js +13 -2
- package/utils/stringUtils.js +4 -2
- package/utils/stringUtils.test.js +22 -0
- package/utils/timeUtils.js +25 -0
- package/utils/utils.test.js +0 -41
- package/workers/WorkerExtension.js +6 -7
package/coverage/jsCoverage.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
3
|
+
const servicesApi = require('../commons/testimServicesApi');
|
|
4
|
+
const Promise = require('bluebird');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const fsPromises = require('fs/promises');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const mkdirp = require('mkdirp');
|
|
9
9
|
const lazyRequire = require('../commons/lazyRequire');
|
|
10
10
|
const libReport = require('istanbul-lib-report');
|
|
11
11
|
const reports = require('istanbul-reports');
|
|
12
12
|
const SummaryToObjectReport = require('./SummaryToObjectReport');
|
|
13
|
-
const { ArgError } = require('../errors');
|
|
14
13
|
const ora = require('ora');
|
|
15
14
|
const moment = require('moment');
|
|
16
15
|
const TestExclude = require('test-exclude');
|
|
16
|
+
const { ArgError } = require('../errors');
|
|
17
|
+
const { promiseMap } = require('../utils');
|
|
17
18
|
|
|
18
19
|
const logger = require('../commons/logger').getLogger('test-run-status');
|
|
19
20
|
|
|
@@ -77,7 +78,7 @@ module.exports.remapCoverage = async (options, storagePath, sourceMaps) => {
|
|
|
77
78
|
}
|
|
78
79
|
const parsedPath = rewritePath(storagePath, sourcePath);
|
|
79
80
|
await mkdirp(path.parse(parsedPath).dir);
|
|
80
|
-
await
|
|
81
|
+
await fsPromises.writeFile(parsedPath, sourceMapObject.sourcesContent[index]);
|
|
81
82
|
}));
|
|
82
83
|
}));
|
|
83
84
|
};
|
|
@@ -173,11 +174,11 @@ const collectAndMergeJsCoverageData = async (projectId, branch, runId) => {
|
|
|
173
174
|
const realDataRes = await servicesApi.getRealData(projectId, 'testResult', `runId=${runId}`);
|
|
174
175
|
const testResults = realDataRes.data.docs;
|
|
175
176
|
|
|
176
|
-
await
|
|
177
|
-
|
|
177
|
+
await promiseMap(
|
|
178
|
+
testResults.flatMap((testResult) => testResult.JSCoverageURLS || []),
|
|
178
179
|
async (coverageURL) => {
|
|
179
180
|
const data = await servicesApi.getS3Artifact(coverageURL, 90000);
|
|
180
|
-
await
|
|
181
|
+
await promiseMap(data, async (cov) => {
|
|
181
182
|
if (!covUrlMap.has(cov.url)) {
|
|
182
183
|
let text = cov.text;
|
|
183
184
|
if (cov.sourceUrl) {
|
|
@@ -195,7 +196,8 @@ const collectAndMergeJsCoverageData = async (projectId, branch, runId) => {
|
|
|
195
196
|
delete cov.text;
|
|
196
197
|
mergedCoverages = mergeProcessCovs([mergedCoverages, { result: [cov] }]);
|
|
197
198
|
});
|
|
198
|
-
},
|
|
199
|
+
},
|
|
200
|
+
{ concurrency: DOWNLOAD_COVERAGE_DATA_CONCURRENCY }
|
|
199
201
|
);
|
|
200
202
|
|
|
201
203
|
return { covUrlMap, mergedCoverages };
|
package/inputFileUtils.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const httpRequest = require('./commons/httpRequest');
|
|
4
|
-
const
|
|
5
|
-
const fs = Promise.promisifyAll(require('fs'));
|
|
4
|
+
const fsPromises = require('fs/promises');
|
|
6
5
|
const os = require('os');
|
|
7
|
-
const
|
|
6
|
+
const { promiseMap } = require('./utils');
|
|
7
|
+
const { getLogger } = require('./commons/logger');
|
|
8
|
+
|
|
9
|
+
const logger = getLogger('input-file-utils');
|
|
8
10
|
|
|
9
11
|
function getVisibleElementScript(positionAndSize = {
|
|
10
12
|
width: '2px', height: '2px', left: '0px', top: '400px',
|
|
@@ -77,22 +79,22 @@ async function downloadFile(fileUrl, fileName) {
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
const localFileLocation = `${os.tmpdir()}/${fileName}`;
|
|
80
|
-
await
|
|
82
|
+
await fsPromises.writeFile(localFileLocation, body);
|
|
81
83
|
return localFileLocation;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
function downloadFiles(fileUrls) {
|
|
85
|
-
return
|
|
87
|
+
return promiseMap(fileUrls, file => downloadFile(file.url, file.name));
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
function uploadFileToGrid(localFileLocation, uploadFileFn) {
|
|
89
91
|
return uploadFileFn(localFileLocation);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
function downloadFilesAndUploadToGrid(fileUrls, uploadFileFn) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
async function downloadFilesAndUploadToGrid(fileUrls, uploadFileFn) {
|
|
95
|
+
const filesOnDisk = await downloadFiles(fileUrls);
|
|
96
|
+
const gridLocalFiles = await promiseMap(filesOnDisk, localFileLocation => uploadFileToGrid(localFileLocation, uploadFileFn));
|
|
97
|
+
return Array.isArray(gridLocalFiles) && gridLocalFiles.map(gridLocalFile => gridLocalFile?.value);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
module.exports = {
|