@testim/testim-cli 3.263.0 → 3.265.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/commons/featureFlags.js +1 -3
- package/commons/testimDesiredCapabilitiesBuilder.js +24 -67
- package/npm-shrinkwrap.json +818 -1206
- package/package.json +2 -3
- package/player/WebdriverioWebDriverApi.js +15 -26
- package/player/stepActions/baseJsStepAction.js +15 -38
- package/player/stepActions/locateStepAction.js +1 -18
- package/player/stepActions/mouseStepAction.js +9 -20
- package/player/stepActions/pixelValidationStepAction.js +6 -4
- package/player/stepActions/scripts/runCode.js +2 -2
- package/player/stepActions/scripts/wheel.js +8 -23
- package/player/stepActions/textStepAction.js +2 -6
- package/player/stepActions/wheelStepAction.js +2 -6
- package/player/utils/eyeSdkService.js +7 -15
- package/player/webdriver.js +13 -35
- package/runOptions.d.ts +1 -1
- package/runOptions.js +1 -9
- package/runners/runnerUtils.js +1 -1
- package/utils/promiseUtils.js +2 -1
package/commons/featureFlags.js
CHANGED
|
@@ -37,10 +37,8 @@ class FeatureFlagsService {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
this.flags = {
|
|
39
39
|
useNewWSCLI: new Rox.Flag(),
|
|
40
|
-
disableEdgeVisibilityChecks: new Rox.Flag(),
|
|
41
40
|
useSafariWebdriverVisibilityChecks: new Rox.Flag(),
|
|
42
41
|
useClickimVisibilityChecks: new Rox.Flag(),
|
|
43
|
-
useIEWebdriverVisibilityChecks: new Rox.Flag(),
|
|
44
42
|
runGetElementCodeInAut: new Rox.Flag(),
|
|
45
43
|
enableFrameSwitchOptimization: new Rox.Flag(),
|
|
46
44
|
maximumJsResultSize: new Rox.Configuration(2000 * 1024),
|
|
@@ -53,7 +51,7 @@ class FeatureFlagsService {
|
|
|
53
51
|
autoSaveDownloadFileFireFox: new Rox.Flag(true),
|
|
54
52
|
safariSelectOptionDispatchEventOnSelectElement: new Rox.Flag(true),
|
|
55
53
|
experimentalPreCodeCompilation: new Rox.Flag(true),
|
|
56
|
-
/** Enables using top level await inside custom actions
|
|
54
|
+
/** Enables using top level await inside custom actions */
|
|
57
55
|
experimentalAsyncCustomCode: new Rox.Flag(),
|
|
58
56
|
useSameBrowserForMultiTests: new LabFeatureFlag('labs'),
|
|
59
57
|
highSpeedMode: new LabFeatureFlag(),
|
|
@@ -67,15 +67,6 @@ const convertToNewCapabilitiesFormat = (desiredCapabilities) => {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
function buildEdgeOptions(opts) {
|
|
71
|
-
Object.assign(opts.desiredCapabilities, {
|
|
72
|
-
browserName: 'MicrosoftEdge',
|
|
73
|
-
_isOldEdge: true,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return opts;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
70
|
function buildSafariOptions(opts, browserName) {
|
|
80
71
|
const safariOptions = { browserName: 'safari' };
|
|
81
72
|
|
|
@@ -87,48 +78,12 @@ function buildSafariOptions(opts, browserName) {
|
|
|
87
78
|
return opts;
|
|
88
79
|
}
|
|
89
80
|
|
|
90
|
-
function buildIEOptions(opts, browserOptions, gridInfo, lambdatestService) {
|
|
91
|
-
const ieOptions = {
|
|
92
|
-
ignoreProtectedModeSettings: true,
|
|
93
|
-
'ie.ensureCleanSession': true,
|
|
94
|
-
'ie.enableFullPageScreenshot': false,
|
|
95
|
-
'ie.fileUploadDialogTimeout': 3000,
|
|
96
|
-
'ie.acceptSslCerts': true,
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
let version = '11';
|
|
100
|
-
if (isDFGrid(gridInfo)) {
|
|
101
|
-
version = 'latest';
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
Object.assign(opts.desiredCapabilities, {
|
|
105
|
-
browserName: 'internet explorer',
|
|
106
|
-
version,
|
|
107
|
-
pageLoadStrategy: 'none',
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
const isLambdatestRun = lambdatestService && lambdatestService.isLambdatestRun();
|
|
111
|
-
if (isLambdatestRun) {
|
|
112
|
-
opts.desiredCapabilities.ignoreProtectedModeSettings = true; // this might be the correct way to do it for all grids
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (browserOptions.oldCapabilities && !isLambdatestRun) {
|
|
116
|
-
Object.assign(opts.desiredCapabilities, ieOptions);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (browserOptions.w3cCapabilities) {
|
|
120
|
-
opts.desiredCapabilities['se:ieOptions'] = ieOptions;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return opts;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
81
|
function readFileToBase64(fileLocation) {
|
|
127
82
|
return fs.readFileSync(fileLocation, { encoding: 'base64' });
|
|
128
83
|
}
|
|
129
84
|
|
|
130
85
|
function setCustomExtension(customExtensionLocalLocation, extensions, lambdatestService) {
|
|
131
|
-
if (lambdatestService
|
|
86
|
+
if (lambdatestService?.isLambdatestRun() && utils.isURL(customExtensionLocalLocation)) {
|
|
132
87
|
return;
|
|
133
88
|
}
|
|
134
89
|
|
|
@@ -141,7 +96,7 @@ function setCustomExtension(customExtensionLocalLocation, extensions, lambdatest
|
|
|
141
96
|
}
|
|
142
97
|
|
|
143
98
|
function setTestimExtension(browserOptions, extensions, args, predefinedTestimExtension, lambdatestService) {
|
|
144
|
-
if (lambdatestService
|
|
99
|
+
if (lambdatestService?.isLambdatestRun()) {
|
|
145
100
|
return;
|
|
146
101
|
}
|
|
147
102
|
|
|
@@ -219,7 +174,7 @@ function _buildChromiumOptions(opts, browserOptions, testRunConfig, customExtens
|
|
|
219
174
|
args.push(`--user-data-dir=${browserOptions.chromeUserDataDir}`);
|
|
220
175
|
}
|
|
221
176
|
|
|
222
|
-
if (browserOptions.projectData
|
|
177
|
+
if (browserOptions.projectData?.defaults?.disableChromiumGpu) {
|
|
223
178
|
args.push('--disable-gpu');
|
|
224
179
|
}
|
|
225
180
|
|
|
@@ -264,7 +219,7 @@ function _buildChromiumOptions(opts, browserOptions, testRunConfig, customExtens
|
|
|
264
219
|
delete chromiumOptions.w3c;
|
|
265
220
|
}
|
|
266
221
|
|
|
267
|
-
if (browserOptions.oldCapabilities && gridInfo.type !== 'testimEnterprise' && !
|
|
222
|
+
if (browserOptions.oldCapabilities && gridInfo.type !== 'testimEnterprise' && !lambdatestService?.isLambdatestRun()) {
|
|
268
223
|
opts.desiredCapabilities[optionsKey] = chromiumOptions;
|
|
269
224
|
}
|
|
270
225
|
|
|
@@ -353,13 +308,14 @@ function buildFirefoxOptions(opts, browserOptions) {
|
|
|
353
308
|
}
|
|
354
309
|
|
|
355
310
|
function buildSaucelabs(browserOptions, testName, testRunConfig) {
|
|
356
|
-
|
|
311
|
+
const { saucelabs } = browserOptions;
|
|
312
|
+
if (saucelabs?.username && saucelabs.accessKey) {
|
|
357
313
|
if (testRunConfig) {
|
|
358
314
|
testRunConfig.sl.version = testRunConfig.browserValue === 'safari' ? testRunConfig.sl.safari_version : testRunConfig.sl.version;
|
|
359
|
-
testRunConfig.sl.appiumVersion =
|
|
360
|
-
return Object.assign({}, testRunConfig.sl,
|
|
315
|
+
testRunConfig.sl.appiumVersion = saucelabs.appiumVersion || testRunConfig.sl.appiumVersion;
|
|
316
|
+
return Object.assign({}, testRunConfig.sl, saucelabs, { name: testName });
|
|
361
317
|
}
|
|
362
|
-
return Object.assign({},
|
|
318
|
+
return Object.assign({}, saucelabs, { name: testName });
|
|
363
319
|
}
|
|
364
320
|
return {};
|
|
365
321
|
}
|
|
@@ -524,8 +480,7 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
524
480
|
}
|
|
525
481
|
|
|
526
482
|
const browserTimeoutSec = Number(browserOptions.browserTimeout / 1000);
|
|
527
|
-
const browser = browserOptions.browser ||
|
|
528
|
-
|
|
483
|
+
const browser = browserOptions.browser || testRunConfig?.browserValue;
|
|
529
484
|
|
|
530
485
|
_.merge(
|
|
531
486
|
opts.desiredCapabilities,
|
|
@@ -533,11 +488,11 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
533
488
|
buildBrowserstack(browserOptions, testName, testRunConfig),
|
|
534
489
|
buildPerfecto(browserOptions, testName, testRunConfig),
|
|
535
490
|
buildExperitest(browserOptions, browser, browserTimeoutSec),
|
|
536
|
-
lambdatestService
|
|
491
|
+
lambdatestService?.getCapabilities(browserOptions, browser, executionId, testResultId, testName),
|
|
537
492
|
);
|
|
538
493
|
|
|
539
494
|
let predefinedTestimExtension = null;
|
|
540
|
-
if (!browserOptions.ext && !browserOptions.extensionPath &&
|
|
495
|
+
if (!browserOptions.ext && !browserOptions.extensionPath && gridInfo.host?.endsWith('.testim.io') && !browserOptions.canary && browserOptions.mode === CLI_MODE.EXTENSION) {
|
|
541
496
|
if (browser === 'chrome') {
|
|
542
497
|
predefinedTestimExtension = '/opt/testim-headless';
|
|
543
498
|
} else if (browser === 'edge-chromium') {
|
|
@@ -545,7 +500,7 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
545
500
|
}
|
|
546
501
|
}
|
|
547
502
|
|
|
548
|
-
if (
|
|
503
|
+
if (gridInfo.host?.endsWith('.testim.io') && browser === 'edge-chromium') {
|
|
549
504
|
opts.desiredCapabilities.version = '83'; // Need to match GGR filter
|
|
550
505
|
}
|
|
551
506
|
|
|
@@ -557,16 +512,10 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
557
512
|
case 'firefox':
|
|
558
513
|
opts = buildFirefoxOptions(opts, browserOptions);
|
|
559
514
|
break;
|
|
560
|
-
case 'edge':
|
|
561
|
-
opts = buildEdgeOptions(opts);
|
|
562
|
-
break;
|
|
563
515
|
case 'safari':
|
|
564
516
|
case 'safari technology preview':
|
|
565
517
|
opts = buildSafariOptions(opts, browser);
|
|
566
518
|
break;
|
|
567
|
-
case 'ie11':
|
|
568
|
-
opts = buildIEOptions(opts, browserOptions, gridInfo, lambdatestService);
|
|
569
|
-
break;
|
|
570
519
|
default:
|
|
571
520
|
break;
|
|
572
521
|
}
|
|
@@ -582,7 +531,12 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
582
531
|
*/
|
|
583
532
|
const hostToProvider = { 'hub.lambdatest.com': 'lambdatest', 'public-grid.testim.io': 'testim', 'testgrid-devicefarm.us-west-2.amazonaws.com': 'devicefarm' };
|
|
584
533
|
const byGrid = (capabilities) => capabilities[gridInfo.provider] || capabilities[opts.host] || capabilities[hostToProvider[opts.host]];
|
|
585
|
-
const getTargetingGroup =
|
|
534
|
+
const getTargetingGroup = capabilities =>
|
|
535
|
+
byGrid(capabilities) ||
|
|
536
|
+
capabilities[opts.desiredCapabilities?.browserName] ||
|
|
537
|
+
capabilities[opts.desiredCapabilities?.version] ||
|
|
538
|
+
capabilities ||
|
|
539
|
+
{};
|
|
586
540
|
const capabilities = JSON.parse(featureFlags.flags.addCustomCapabilities.getValue() || '{}');
|
|
587
541
|
const customCapabilities = getTargetingGroup(getTargetingGroup(capabilities));
|
|
588
542
|
|
|
@@ -590,8 +544,11 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
|
|
|
590
544
|
logger.info(`Adding custom capabilities: ${JSON.stringify(customCapabilities)}`);
|
|
591
545
|
Object.assign(opts.desiredCapabilities, customCapabilities);
|
|
592
546
|
}
|
|
593
|
-
} catch (
|
|
594
|
-
logger.error(
|
|
547
|
+
} catch (error) {
|
|
548
|
+
logger.error('Failed to load custom capabilities', {
|
|
549
|
+
error,
|
|
550
|
+
customCapabilities: featureFlags.flags.addCustomCapabilities.getValue(),
|
|
551
|
+
});
|
|
595
552
|
}
|
|
596
553
|
|
|
597
554
|
if (isDFGrid(gridInfo) && opts.desiredCapabilities && !opts.capabilities) {
|