@testim/testim-cli 3.286.0 → 3.288.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/cliJsCode/service.js +32 -9
- package/agent/routers/codim/service.js +10 -7
- package/cli/writeStackTrace.js +14 -13
- package/cli.js +17 -15
- package/commons/getSessionPlayerRequire.js +23 -8
- package/commons/httpRequestCounters.js +2 -2
- package/commons/initializeUserWithAuth.js +1 -1
- package/commons/lazyRequire.js +7 -5
- package/commons/testimDesiredCapabilitiesBuilder.js +1 -0
- package/npm-shrinkwrap.json +50 -38
- package/package.json +1 -1
- package/player/appiumTestPlayer.js +8 -20
- package/player/seleniumTestPlayer.js +10 -21
- package/player/services/frameLocator.js +4 -2
- package/player/services/tabService.js +13 -14
- package/player/stepActions/apiStepAction.js +6 -8
- package/player/stepActions/baseCliJsStepAction.js +3 -6
- package/player/stepActions/baseJsStepAction.js +10 -8
- package/player/stepActions/dropFileStepAction.js +5 -3
- package/player/stepActions/evaluateExpressionStepAction.js +6 -7
- package/player/stepActions/hoverStepAction.js +1 -3
- package/player/stepActions/inputFileStepAction.js +7 -6
- package/player/stepActions/locateStepAction.js +5 -6
- package/player/stepActions/mouseStepAction.js +9 -10
- package/player/stepActions/scrollStepAction.js +5 -7
- package/player/stepActions/selectOptionStepAction.js +3 -4
- package/player/stepActions/sfdcRecordedStepAction.js +1 -1
- package/player/stepActions/sfdcStepAction.js +1 -1
- package/player/stepActions/stepAction.js +7 -2
- package/player/stepActions/textStepAction.js +4 -7
- package/player/stepActions/textValidationStepAction.js +3 -10
- package/player/stepActions/wheelStepAction.js +1 -2
- package/player/utils/eyeSdkService.js +4 -3
- package/player/utils/stepActionUtils.js +9 -4
- package/player/webdriver.js +3 -3
- package/processHandler.js +3 -2
- package/processHandler.test.js +3 -4
- package/reports/debugReporter.js +1 -1
- package/runOptions.d.ts +7 -0
- package/runOptions.js +28 -8
- package/runners/TestPlanRunner.js +1 -1
- package/stepPlayers/hybridStepPlayback.js +23 -21
- package/stepPlayers/remoteStepPlayback.js +8 -6
- package/stepPlayers/tdkHybridStepPlayback.js +20 -17
- package/utils/argsUtils.js +5 -0
- package/workers/BaseWorker.js +7 -6
- package/workers/WorkerAppium.js +8 -6
- package/workers/WorkerSelenium.js +16 -12
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const fs = require('fs');
|
|
6
6
|
const os = require('os');
|
|
7
|
-
const
|
|
8
|
-
const { spawn: threadSpawn, config } = require('threads');
|
|
7
|
+
const path = require('path');
|
|
9
8
|
const fse = require('fs-extra');
|
|
10
|
-
const
|
|
9
|
+
const dataUriToBuffer = require('data-uri-to-buffer');
|
|
11
10
|
const utils = require('../../../utils');
|
|
12
|
-
const logger = require('../../../commons/logger').getLogger('cli-service');
|
|
13
|
-
const { getS3Artifact } = require('../../../commons/testimServicesApi');
|
|
14
11
|
const npmWrapper = require('../../../commons/npmWrapper');
|
|
15
12
|
const featureFlags = require('../../../commons/featureFlags');
|
|
13
|
+
const { spawn: threadSpawn, config } = require('threads');
|
|
16
14
|
const { TimeoutError } = require('../../../errors');
|
|
15
|
+
const { getLogger } = require('../../../commons/logger');
|
|
16
|
+
const { getS3Artifact } = require('../../../commons/testimServicesApi');
|
|
17
|
+
|
|
18
|
+
const logger = getLogger('cli-service');
|
|
17
19
|
|
|
18
20
|
/** @type {import('worker_threads') | false} */
|
|
19
21
|
let workerThreads;
|
|
@@ -270,16 +272,17 @@ function runCode(transactionId, incomingParams, context, code, packageLocalLocat
|
|
|
270
272
|
.finally(() => thread?.kill());
|
|
271
273
|
}
|
|
272
274
|
|
|
273
|
-
|
|
275
|
+
/** @param {string} _path */
|
|
276
|
+
function requireOrImportMethod(_path) {
|
|
274
277
|
try {
|
|
275
|
-
return { sync: true, lib: require(
|
|
278
|
+
return { sync: true, lib: require(_path) };
|
|
276
279
|
} catch (err) {
|
|
277
280
|
if (err.code === 'ERR_REQUIRE_ESM') {
|
|
278
281
|
const pathModule = require('path');
|
|
279
282
|
|
|
280
283
|
const lib = fs.promises.readFile(`${path}${pathModule.sep}package.json`).then(file => {
|
|
281
284
|
const packageJson = JSON.parse(file);
|
|
282
|
-
const fullPath = pathModule.join(
|
|
285
|
+
const fullPath = pathModule.join(_path, packageJson.main || `${pathModule.sep}index.js`);
|
|
283
286
|
return import(fullPath);
|
|
284
287
|
});
|
|
285
288
|
|
|
@@ -563,6 +566,7 @@ function runCodeWithWorkerThread(
|
|
|
563
566
|
.finally(() => thread?.terminate());
|
|
564
567
|
}
|
|
565
568
|
|
|
569
|
+
/** @param {string} installFolder */
|
|
566
570
|
async function removeFolder(installFolder) {
|
|
567
571
|
try {
|
|
568
572
|
await fse.remove(installFolder);
|
|
@@ -571,10 +575,24 @@ async function removeFolder(installFolder) {
|
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
577
|
|
|
578
|
+
/**
|
|
579
|
+
* @param {string} stepResultId
|
|
580
|
+
* @param {string} testResultId
|
|
581
|
+
* @param {string} stepId
|
|
582
|
+
* @param {number} retryIndex
|
|
583
|
+
*/
|
|
574
584
|
function getTransactionId(stepResultId, testResultId, stepId, retryIndex) {
|
|
575
585
|
return `${testResultId}_${stepId}_${stepResultId}_${retryIndex}`;
|
|
576
586
|
}
|
|
577
587
|
|
|
588
|
+
/**
|
|
589
|
+
* @param {string} stepId
|
|
590
|
+
* @param {string} testResultId
|
|
591
|
+
* @param {number} retryIndex
|
|
592
|
+
* @param {{ packageName: string; packageVersion: string }[]} packageData
|
|
593
|
+
* @param {string} stepResultId
|
|
594
|
+
* @param {number} timeout
|
|
595
|
+
*/
|
|
578
596
|
function installPackage(stepId, testResultId, retryIndex, packageData, stepResultId, timeout) {
|
|
579
597
|
const transactionId = getTransactionId(stepResultId, testResultId, stepId, retryIndex);
|
|
580
598
|
return runNpmInstall(transactionId, packageData, timeout).then(({ data }) => data);
|
|
@@ -622,6 +640,11 @@ function runCodeWithPackages(code, stepId, incomingParams, context, testResultId
|
|
|
622
640
|
}).then(res => Object.assign({}, res, { nodeVersion: process.version }));
|
|
623
641
|
}
|
|
624
642
|
|
|
643
|
+
/**
|
|
644
|
+
* @param {string} transactionId
|
|
645
|
+
* @param {{ packageName: string; packageVersion: string }[]} packageData
|
|
646
|
+
* @param {number} timeout
|
|
647
|
+
*/
|
|
625
648
|
async function runNpmInstall(transactionId, packageData, timeout) {
|
|
626
649
|
const packages = packageData.map(data => `${data.packageName}@${data.packageVersion}`);
|
|
627
650
|
const localPackageInstallFolder = getLocalPackageInstallFolder();
|
|
@@ -150,19 +150,22 @@ async function compileFunctionsLibrary({ fileSystem, bypassWebpack } = {}, optio
|
|
|
150
150
|
const Module = require('module');
|
|
151
151
|
// attempt to require without webpack compile - useful for puppeteer/selenium hybrid
|
|
152
152
|
const originalRequire = Module.prototype.require;
|
|
153
|
-
Module.prototype.require = function
|
|
153
|
+
Module.prototype.require = function requireThatOverridesTestimTDK(id) {
|
|
154
154
|
if (id === 'testim') {
|
|
155
155
|
return bypassWebpack.testim;
|
|
156
156
|
}
|
|
157
157
|
// eslint-disable-next-line prefer-rest-params
|
|
158
158
|
return originalRequire.apply(this, arguments);
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
try {
|
|
161
|
+
// delete references to the old __testim from previous invocations
|
|
162
|
+
delete require.cache[require.resolve(functionsFile)];
|
|
163
|
+
const functions = require(functionsFile); // eslint-disable-line import/no-dynamic-require
|
|
164
|
+
// asynchronous require not supported - is this fine?
|
|
165
|
+
return functions;
|
|
166
|
+
} finally {
|
|
167
|
+
Module.prototype.require = originalRequire;
|
|
168
|
+
}
|
|
166
169
|
}
|
|
167
170
|
const functionsAsAWebpackModule = await buildCodeTests([functionsFile], {
|
|
168
171
|
output: {
|
package/cli/writeStackTrace.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
const fse = require('fs-extra');
|
|
2
7
|
|
|
3
8
|
module.exports.writeStackTrace = function writeStackTrace(err) {
|
|
4
|
-
if(err
|
|
9
|
+
if (err?.message?.includes('SIGINT')) {
|
|
5
10
|
return; // no need to generate a log file for a sigint.
|
|
6
11
|
}
|
|
7
12
|
try {
|
|
8
|
-
const homedir =
|
|
9
|
-
const fse = require('fs-extra');
|
|
10
|
-
const path = require('path');
|
|
13
|
+
const homedir = os.homedir();
|
|
11
14
|
|
|
12
15
|
fse.ensureDirSync(path.resolve(homedir, '.testim_logs'));
|
|
13
|
-
const
|
|
16
|
+
const logFileName = path.resolve(homedir, '.testim_logs', `${new Date().toISOString().replace(/:|\./g, '_')}.log`);
|
|
14
17
|
console.log('Oops :( The test runner has encountered an unexpected error. A complete log of this run can be found in:');
|
|
15
|
-
console.log(`\t${
|
|
18
|
+
console.log(`\t${logFileName}`);
|
|
16
19
|
|
|
17
|
-
if (err
|
|
18
|
-
&& process.argv.some(x => x.includes('player-require-path'))) {
|
|
19
|
-
const chalk = require('chalk');
|
|
20
|
+
if (err?.message?.includes('Unable to compile TypeScript') && err.stack.includes('runner/src') && process.argv.some(x => x.includes('player-require-path'))) {
|
|
20
21
|
console.log(chalk.red('Looks like you got a TypeScript compile error champ - but it\'s not a very good one because we use TypeScript in transpile-only mode'));
|
|
21
|
-
console.log(chalk.red(
|
|
22
|
+
console.log(chalk.red('change require(\'ts-node/register/transpile-only\'); to require(\'ts-node/register\'); for better errors'));
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
fse.writeFileSync(
|
|
25
|
-
} catch
|
|
26
|
-
}
|
|
25
|
+
fse.writeFileSync(logFileName, `${err}\n${err.stack}\n\n${JSON.stringify(err, Object.getOwnPropertyNames(err), 2)}`);
|
|
26
|
+
} catch { /* noop */ }
|
|
27
|
+
};
|
package/cli.js
CHANGED
|
@@ -4,26 +4,23 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
require('./polyfills');
|
|
7
|
-
const
|
|
7
|
+
const semver = require('semver');
|
|
8
8
|
const EventEmitter = require('events');
|
|
9
|
-
const
|
|
10
|
-
const { onExit, ignoreFailingTestsInExitCode } = require('./cli/onExit');
|
|
9
|
+
const utils = require('./utils');
|
|
11
10
|
const testRunner = require('./runner');
|
|
11
|
+
const options = require('./runOptions');
|
|
12
|
+
const agentMode = require('./cliAgentMode');
|
|
13
|
+
const perf = require('./commons/performance-logger');
|
|
12
14
|
const prepareRunner = require('./commons/prepareRunner');
|
|
15
|
+
const prepareRunnerAndTestimStartUtils = require('./commons/prepareRunnerAndTestimStartUtils');
|
|
16
|
+
const { getLogger } = require('./commons/logger');
|
|
13
17
|
const { CLI_MODE } = require('./commons/constants');
|
|
18
|
+
const { registerProcessForCleanup } = require('./processHandler');
|
|
19
|
+
const { NoArgsError, SeleniumError, ArgError } = require('./errors');
|
|
20
|
+
const { onExit, ignoreFailingTestsInExitCode } = require('./cli/onExit');
|
|
14
21
|
const { updateRemoteRunFailure } = require('./commons/testimServicesApi');
|
|
15
|
-
const prepareRunnerAndTestimStartUtils = require('./commons/prepareRunnerAndTestimStartUtils');
|
|
16
22
|
|
|
17
|
-
const
|
|
18
|
-
NoArgsError,
|
|
19
|
-
SeleniumError,
|
|
20
|
-
ArgError,
|
|
21
|
-
} = require('./errors');
|
|
22
|
-
|
|
23
|
-
const utils = require('./utils');
|
|
24
|
-
const semver = require('semver');
|
|
25
|
-
const perf = require('./commons/performance-logger');
|
|
26
|
-
const agentMode = require('./cliAgentMode');
|
|
23
|
+
const logger = getLogger('cli-entry');
|
|
27
24
|
|
|
28
25
|
try {
|
|
29
26
|
require('./fixLocalBuild');
|
|
@@ -56,7 +53,7 @@ async function checkNodeVersion() {
|
|
|
56
53
|
async function main() {
|
|
57
54
|
console.log('Starting Testim.io CLI');
|
|
58
55
|
perf.log('Starting Testim.io CLI');
|
|
59
|
-
|
|
56
|
+
registerProcessForCleanup(onExit);
|
|
60
57
|
|
|
61
58
|
checkNodeVersion().catch(err => {
|
|
62
59
|
console.log('Argument Error:', err.message);
|
|
@@ -73,6 +70,11 @@ async function main() {
|
|
|
73
70
|
require('./commons/logger').setProjectId(processedOptions.project);
|
|
74
71
|
require('./commons/runnerFileCache').setEncryptKey(typeof processedOptions.token === 'string' ? processedOptions.token : 'anonymous_encrypt_key');
|
|
75
72
|
|
|
73
|
+
if (utils.isInstallLazyDepsMode(processedOptions)) {
|
|
74
|
+
console.log('Lazy dependency installation started');
|
|
75
|
+
const { installAllLazyDependencies } = require('./commons/lazyRequire');
|
|
76
|
+
return await installAllLazyDependencies();
|
|
77
|
+
}
|
|
76
78
|
if (utils.isInitCodimMode(processedOptions)) {
|
|
77
79
|
const codimCli = require('./codim/codim-cli');
|
|
78
80
|
return codimCli.init(processedOptions.initTestProject);
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const { join, resolve } = require('path');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const { getSessionPlayerFolder } = require('./prepareRunnerAndTestimStartUtils');
|
|
5
|
+
/** @type {{ playerPath: string | undefined }} */ module.exports.options = { playerPath: undefined };
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
/** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit} */
|
|
10
|
-
const sessionPlayer = require(require('path').join(testimAppDataFolder, 'sessionPlayer.js')); // eslint-disable-line import/no-dynamic-require
|
|
7
|
+
/** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit | undefined} */ let sessionPlayerInit;
|
|
11
8
|
|
|
12
|
-
module.exports =
|
|
13
|
-
|
|
9
|
+
module.exports.getSessionPlayer = () => {
|
|
10
|
+
if (sessionPlayerInit) {
|
|
11
|
+
return sessionPlayerInit;
|
|
12
|
+
}
|
|
13
|
+
const perf = require('./performance-logger');
|
|
14
|
+
|
|
15
|
+
perf.log('getSessionPlayerRequire start');
|
|
16
|
+
const { getSessionPlayerFolder } = require('./prepareRunnerAndTestimStartUtils');
|
|
17
|
+
|
|
18
|
+
const testimAppDataFolder = getSessionPlayerFolder();
|
|
19
|
+
const { options } = module.exports;
|
|
20
|
+
const path = options.playerPath ? resolve(options.playerPath, 'src/background/sessionPlayerInit.ts') : join(testimAppDataFolder, 'sessionPlayer.js');
|
|
21
|
+
|
|
22
|
+
/** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit} */
|
|
23
|
+
const sessionPlayer = require(path); // eslint-disable-line import/no-dynamic-require
|
|
24
|
+
|
|
25
|
+
perf.log('getSessionPlayerRequire end');
|
|
26
|
+
sessionPlayerInit = sessionPlayer;
|
|
27
|
+
return sessionPlayer;
|
|
28
|
+
};
|
|
@@ -62,13 +62,13 @@ module.exports.makeCounters = () => {
|
|
|
62
62
|
* @template T, TArgs
|
|
63
63
|
* @param {(...args: TArgs[]) => T} fn
|
|
64
64
|
* @param {string=} name
|
|
65
|
-
* @return {(...args: TArgs[]) => Promise<
|
|
65
|
+
* @return {(...args: TArgs[]) => Promise<T>}
|
|
66
66
|
*/
|
|
67
67
|
function wrapWithMonitoring(fn, name = fn.name) {
|
|
68
68
|
return async function (...args) {
|
|
69
69
|
update(counters.call, name);
|
|
70
70
|
try {
|
|
71
|
-
const result = await fn.call(
|
|
71
|
+
const result = await fn.call(null, ...args);
|
|
72
72
|
update(counters.success, name);
|
|
73
73
|
return result;
|
|
74
74
|
} catch (e) {
|
|
@@ -15,7 +15,7 @@ function preloadSlowRequires(mode) {
|
|
|
15
15
|
}
|
|
16
16
|
// heuristic to pay the cost of loading the sessionPlayer here while we are waiting for the backend
|
|
17
17
|
try {
|
|
18
|
-
require('./getSessionPlayerRequire');
|
|
18
|
+
require('./getSessionPlayerRequire').getSessionPlayer();
|
|
19
19
|
// jsdom for the same reason, we don't require workerSelenium here since it actually takes longer to load
|
|
20
20
|
// then it takes for the backend to return 🤯
|
|
21
21
|
require('jsdom');
|
package/commons/lazyRequire.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const npmWrapper = require('./npmWrapper');
|
|
4
3
|
const ora = require('ora');
|
|
5
4
|
const path = require('path');
|
|
6
|
-
const
|
|
5
|
+
const npmWrapper = require('./npmWrapper');
|
|
6
|
+
const { getLogger } = require('./logger');
|
|
7
7
|
const { getCliLocation } = require('../utils');
|
|
8
8
|
const { requireWithFallback } = require('./requireWithFallback');
|
|
9
9
|
|
|
10
|
+
const logger = getLogger('lazy-require');
|
|
10
11
|
// eslint-disable-next-line import/no-dynamic-require
|
|
11
12
|
const packageJson = require(path.resolve(getCliLocation(), 'package.json'));
|
|
12
13
|
const ongoingCalls = new Map();
|
|
@@ -75,16 +76,17 @@ async function lazyRequireImpl(dependency) {
|
|
|
75
76
|
return requireWithFallback(dependency);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
async function installAllLazyDependencies() {
|
|
79
|
+
module.exports.installAllLazyDependencies = async function installAllLazyDependencies() {
|
|
79
80
|
const allLazyDependencies = Object.keys(packageJson.lazyDependencies);
|
|
80
81
|
|
|
81
82
|
for (const dep of allLazyDependencies) {
|
|
82
83
|
await lazyRequireImpl(dep);
|
|
83
84
|
}
|
|
84
|
-
}
|
|
85
|
+
};
|
|
85
86
|
|
|
87
|
+
// TODO: remove this once docker-build-tool is not using it
|
|
86
88
|
if (require.main === module) {
|
|
87
|
-
installAllLazyDependencies();
|
|
89
|
+
module.exports.installAllLazyDependencies();
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/**
|
|
@@ -580,6 +580,7 @@ function buildAppiumOptions({ projectType, gridInfo, testRunConfig, nativeApp, o
|
|
|
580
580
|
hostname: gridInfo.host,
|
|
581
581
|
port: gridInfo.port,
|
|
582
582
|
path: `/v0/${gridInfo.accessToken}/wd/hub`,
|
|
583
|
+
logLevel: options.appiumLogLevel,
|
|
583
584
|
// connectionRetryTimeout: 900000, -- not used for now
|
|
584
585
|
};
|
|
585
586
|
//TODO: check if more caps should be defined as default
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.288.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.288.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.11.29",
|
|
@@ -1275,6 +1275,11 @@
|
|
|
1275
1275
|
"integrity": "sha512-HopIwBE7GUXsscmt/J0DhnFXLSmO04AfxT6b8HAprknwka7pqEWquWDMXxCjd+NUHK9MkCe1SDKKsMiNmCItbQ==",
|
|
1276
1276
|
"dev": true
|
|
1277
1277
|
},
|
|
1278
|
+
"node_modules/@types/triple-beam": {
|
|
1279
|
+
"version": "1.3.2",
|
|
1280
|
+
"resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz",
|
|
1281
|
+
"integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g=="
|
|
1282
|
+
},
|
|
1278
1283
|
"node_modules/@types/ua-parser-js": {
|
|
1279
1284
|
"version": "0.7.36",
|
|
1280
1285
|
"resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.36.tgz",
|
|
@@ -1427,9 +1432,9 @@
|
|
|
1427
1432
|
}
|
|
1428
1433
|
},
|
|
1429
1434
|
"node_modules/@wdio/types/node_modules/@types/node": {
|
|
1430
|
-
"version": "18.
|
|
1431
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
1432
|
-
"integrity": "sha512-
|
|
1435
|
+
"version": "18.13.0",
|
|
1436
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
1437
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
1433
1438
|
},
|
|
1434
1439
|
"node_modules/@wdio/utils": {
|
|
1435
1440
|
"version": "7.24.0",
|
|
@@ -4452,9 +4457,9 @@
|
|
|
4452
4457
|
"integrity": "sha512-+iipnm2hvmlWs4MVNx7HwSTxhDxsXnQyK5F1OalZVXeUhdPgP/23T42NCyg0TK3wL/Yg92SVrSuGKqdg12o54w=="
|
|
4453
4458
|
},
|
|
4454
4459
|
"node_modules/devtools/node_modules/@types/node": {
|
|
4455
|
-
"version": "18.
|
|
4456
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
4457
|
-
"integrity": "sha512-
|
|
4460
|
+
"version": "18.13.0",
|
|
4461
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
4462
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
4458
4463
|
},
|
|
4459
4464
|
"node_modules/devtools/node_modules/ua-parser-js": {
|
|
4460
4465
|
"version": "1.0.33",
|
|
@@ -8439,11 +8444,12 @@
|
|
|
8439
8444
|
}
|
|
8440
8445
|
},
|
|
8441
8446
|
"node_modules/logform": {
|
|
8442
|
-
"version": "2.
|
|
8443
|
-
"resolved": "https://registry.npmjs.org/logform/-/logform-2.
|
|
8444
|
-
"integrity": "sha512-
|
|
8447
|
+
"version": "2.5.1",
|
|
8448
|
+
"resolved": "https://registry.npmjs.org/logform/-/logform-2.5.1.tgz",
|
|
8449
|
+
"integrity": "sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==",
|
|
8445
8450
|
"dependencies": {
|
|
8446
8451
|
"@colors/colors": "1.5.0",
|
|
8452
|
+
"@types/triple-beam": "^1.3.2",
|
|
8447
8453
|
"fecha": "^4.2.0",
|
|
8448
8454
|
"ms": "^2.1.1",
|
|
8449
8455
|
"safe-stable-stringify": "^2.3.1",
|
|
@@ -15817,9 +15823,9 @@
|
|
|
15817
15823
|
}
|
|
15818
15824
|
},
|
|
15819
15825
|
"node_modules/vm2": {
|
|
15820
|
-
"version": "3.9.
|
|
15821
|
-
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.
|
|
15822
|
-
"integrity": "sha512-
|
|
15826
|
+
"version": "3.9.14",
|
|
15827
|
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.14.tgz",
|
|
15828
|
+
"integrity": "sha512-HgvPHYHeQy8+QhzlFryvSteA4uQLBCOub02mgqdR+0bN/akRZ48TGB1v0aCv7ksyc0HXx16AZtMHKS38alc6TA==",
|
|
15823
15829
|
"dependencies": {
|
|
15824
15830
|
"acorn": "^8.7.0",
|
|
15825
15831
|
"acorn-walk": "^8.2.0"
|
|
@@ -15892,9 +15898,9 @@
|
|
|
15892
15898
|
}
|
|
15893
15899
|
},
|
|
15894
15900
|
"node_modules/webdriver/node_modules/@types/node": {
|
|
15895
|
-
"version": "18.
|
|
15896
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
15897
|
-
"integrity": "sha512-
|
|
15901
|
+
"version": "18.13.0",
|
|
15902
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
15903
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
15898
15904
|
},
|
|
15899
15905
|
"node_modules/webdriverio": {
|
|
15900
15906
|
"version": "7.24.0",
|
|
@@ -15934,9 +15940,9 @@
|
|
|
15934
15940
|
}
|
|
15935
15941
|
},
|
|
15936
15942
|
"node_modules/webdriverio/node_modules/@types/node": {
|
|
15937
|
-
"version": "18.
|
|
15938
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
15939
|
-
"integrity": "sha512-
|
|
15943
|
+
"version": "18.13.0",
|
|
15944
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
15945
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
15940
15946
|
},
|
|
15941
15947
|
"node_modules/webdriverio/node_modules/brace-expansion": {
|
|
15942
15948
|
"version": "2.0.1",
|
|
@@ -17403,6 +17409,11 @@
|
|
|
17403
17409
|
"integrity": "sha512-HopIwBE7GUXsscmt/J0DhnFXLSmO04AfxT6b8HAprknwka7pqEWquWDMXxCjd+NUHK9MkCe1SDKKsMiNmCItbQ==",
|
|
17404
17410
|
"dev": true
|
|
17405
17411
|
},
|
|
17412
|
+
"@types/triple-beam": {
|
|
17413
|
+
"version": "1.3.2",
|
|
17414
|
+
"resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz",
|
|
17415
|
+
"integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g=="
|
|
17416
|
+
},
|
|
17406
17417
|
"@types/ua-parser-js": {
|
|
17407
17418
|
"version": "0.7.36",
|
|
17408
17419
|
"resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.36.tgz",
|
|
@@ -17518,9 +17529,9 @@
|
|
|
17518
17529
|
},
|
|
17519
17530
|
"dependencies": {
|
|
17520
17531
|
"@types/node": {
|
|
17521
|
-
"version": "18.
|
|
17522
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
17523
|
-
"integrity": "sha512-
|
|
17532
|
+
"version": "18.13.0",
|
|
17533
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
17534
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
17524
17535
|
}
|
|
17525
17536
|
}
|
|
17526
17537
|
},
|
|
@@ -19930,9 +19941,9 @@
|
|
|
19930
19941
|
},
|
|
19931
19942
|
"dependencies": {
|
|
19932
19943
|
"@types/node": {
|
|
19933
|
-
"version": "18.
|
|
19934
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
19935
|
-
"integrity": "sha512-
|
|
19944
|
+
"version": "18.13.0",
|
|
19945
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
19946
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
19936
19947
|
},
|
|
19937
19948
|
"ua-parser-js": {
|
|
19938
19949
|
"version": "1.0.33",
|
|
@@ -23122,11 +23133,12 @@
|
|
|
23122
23133
|
}
|
|
23123
23134
|
},
|
|
23124
23135
|
"logform": {
|
|
23125
|
-
"version": "2.
|
|
23126
|
-
"resolved": "https://registry.npmjs.org/logform/-/logform-2.
|
|
23127
|
-
"integrity": "sha512-
|
|
23136
|
+
"version": "2.5.1",
|
|
23137
|
+
"resolved": "https://registry.npmjs.org/logform/-/logform-2.5.1.tgz",
|
|
23138
|
+
"integrity": "sha512-9FyqAm9o9NKKfiAKfZoYo9bGXXuwMkxQiQttkT4YjjVtQVIQtK6LmVtlxmCaFswo6N4AfEkHqZTV0taDtPotNg==",
|
|
23128
23139
|
"requires": {
|
|
23129
23140
|
"@colors/colors": "1.5.0",
|
|
23141
|
+
"@types/triple-beam": "^1.3.2",
|
|
23130
23142
|
"fecha": "^4.2.0",
|
|
23131
23143
|
"ms": "^2.1.1",
|
|
23132
23144
|
"safe-stable-stringify": "^2.3.1",
|
|
@@ -28722,9 +28734,9 @@
|
|
|
28722
28734
|
}
|
|
28723
28735
|
},
|
|
28724
28736
|
"vm2": {
|
|
28725
|
-
"version": "3.9.
|
|
28726
|
-
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.
|
|
28727
|
-
"integrity": "sha512-
|
|
28737
|
+
"version": "3.9.14",
|
|
28738
|
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.14.tgz",
|
|
28739
|
+
"integrity": "sha512-HgvPHYHeQy8+QhzlFryvSteA4uQLBCOub02mgqdR+0bN/akRZ48TGB1v0aCv7ksyc0HXx16AZtMHKS38alc6TA==",
|
|
28728
28740
|
"requires": {
|
|
28729
28741
|
"acorn": "^8.7.0",
|
|
28730
28742
|
"acorn-walk": "^8.2.0"
|
|
@@ -28783,9 +28795,9 @@
|
|
|
28783
28795
|
},
|
|
28784
28796
|
"dependencies": {
|
|
28785
28797
|
"@types/node": {
|
|
28786
|
-
"version": "18.
|
|
28787
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
28788
|
-
"integrity": "sha512-
|
|
28798
|
+
"version": "18.13.0",
|
|
28799
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
28800
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
28789
28801
|
}
|
|
28790
28802
|
}
|
|
28791
28803
|
},
|
|
@@ -28824,9 +28836,9 @@
|
|
|
28824
28836
|
},
|
|
28825
28837
|
"dependencies": {
|
|
28826
28838
|
"@types/node": {
|
|
28827
|
-
"version": "18.
|
|
28828
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.
|
|
28829
|
-
"integrity": "sha512-
|
|
28839
|
+
"version": "18.13.0",
|
|
28840
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
|
|
28841
|
+
"integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
|
|
28830
28842
|
},
|
|
28831
28843
|
"brace-expansion": {
|
|
28832
28844
|
"version": "2.0.1",
|
package/package.json
CHANGED
|
@@ -3,29 +3,20 @@
|
|
|
3
3
|
const webdriverio = require('webdriverio');
|
|
4
4
|
const TabService = require('./services/tabServiceMock');
|
|
5
5
|
const PortSelector = require('./services/portSelector');
|
|
6
|
-
const
|
|
6
|
+
const StepActionUtils = require('./utils/stepActionUtils');
|
|
7
7
|
const frameLocatorFactory = require('./services/mobileFrameLocatorMock');
|
|
8
|
+
const testResultService = require('../commons/socket/testResultService');
|
|
9
|
+
const windowCreationListener = require('./services/windowCreationListener');
|
|
10
|
+
const PlaybackTimeoutCalculator = require('./services/playbackTimeoutCalculator');
|
|
8
11
|
const { isDebuggerConnected } = require('../commons/detectDebugger');
|
|
12
|
+
const { getSessionPlayer } = require('../commons/getSessionPlayerRequire');
|
|
9
13
|
const logger = require('../commons/logger').getLogger('appium-test-player');
|
|
10
14
|
|
|
11
|
-
const sessionPlayer = require('../commons/getSessionPlayerRequire');
|
|
12
|
-
|
|
13
|
-
const Player = sessionPlayer.sessionPlayer;
|
|
14
|
-
// delete after https://github.com/testimio/clickim/pull/3430 release to the store
|
|
15
|
-
const assetService = sessionPlayer.assetService;
|
|
16
|
-
const commonConstants = sessionPlayer.commonConstants;
|
|
17
|
-
const StepActionFactory = sessionPlayer.stepActionFactory;
|
|
18
|
-
const mobileLocateElementPlayer = sessionPlayer.MobileLocateElementPlayer;
|
|
19
|
-
const PlaybackTimeoutCalculator = require('./services/playbackTimeoutCalculator');
|
|
20
|
-
const testResultService = require('../commons/socket/testResultService');
|
|
21
|
-
|
|
22
|
-
// delete after https://github.com/testimio/clickim/pull/3430 release to the store
|
|
23
|
-
const CryptoJS = require('crypto-js');
|
|
24
|
-
const StepActionUtils = require('./utils/stepActionUtils');
|
|
25
15
|
|
|
26
16
|
class AppiumTestPlayer {
|
|
27
17
|
//eslint-disable-next-line default-param-last
|
|
28
18
|
constructor(id, userParamsData, shouldMonitorPerformance, automationMode = 'code', driver = webdriverio, testRetryCount, previousTestResultId) {
|
|
19
|
+
const { sessionPlayer: Player, commonConstants, stepActionFactory: StepActionFactory, MobileLocateElementPlayer } = getSessionPlayer();
|
|
29
20
|
this.driver = driver;
|
|
30
21
|
this.id = id;
|
|
31
22
|
|
|
@@ -33,10 +24,6 @@ class AppiumTestPlayer {
|
|
|
33
24
|
this.stepActionFactory = new StepActionFactory(stepActionUtils);
|
|
34
25
|
require('./stepActions/stepActionRegistrar')(this.driver, this.stepActionFactory, 'selenium');
|
|
35
26
|
|
|
36
|
-
if (assetService.setMd5) {
|
|
37
|
-
// delete after https://github.com/testimio/clickim/pull/3430 release to the store
|
|
38
|
-
assetService.setMd5(CryptoJS);
|
|
39
|
-
}
|
|
40
27
|
this.tabService = new TabService(this.driver);
|
|
41
28
|
this.windowCreationListener = windowCreationListener;
|
|
42
29
|
this.playbackTimeoutCalculator = new PlaybackTimeoutCalculator(isDebuggerConnected());
|
|
@@ -52,7 +39,7 @@ class AppiumTestPlayer {
|
|
|
52
39
|
null,
|
|
53
40
|
FrameLocator,
|
|
54
41
|
PortSelector,
|
|
55
|
-
|
|
42
|
+
MobileLocateElementPlayer,
|
|
56
43
|
null /* Not in use, placeholder for the order of arguments */,
|
|
57
44
|
stepActionUtils,
|
|
58
45
|
this.stepActionFactory,
|
|
@@ -86,6 +73,7 @@ class AppiumTestPlayer {
|
|
|
86
73
|
} catch (error) {
|
|
87
74
|
logger.error('error while deleting appium session', { error });
|
|
88
75
|
} finally {
|
|
76
|
+
const { commonConstants } = getSessionPlayer();
|
|
89
77
|
this.sessionPlayer.playbackManager.off(commonConstants.playback.RESULT);
|
|
90
78
|
this.sessionPlayer = null;
|
|
91
79
|
this.tabService = null;
|