@testim/testim-cli 3.262.0 → 3.263.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/cli.js +11 -5
- package/commons/featureFlags.js +1 -0
- package/npm-shrinkwrap.json +52 -52
- package/package.json +1 -1
- package/polyfills/Array.prototype.at.js +13 -0
- package/polyfills/index.js +1 -0
- package/runner.js +7 -0
- package/testRunStatus.js +4 -0
- package/utils/index.js +9 -2
- package/player/stepActions/scripts/polyfills.js +0 -393
package/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
+
require('./polyfills');
|
|
6
7
|
require('./bluebirdConfig.js');
|
|
7
8
|
const options = require('./runOptions');
|
|
8
9
|
const EventEmitter = require('events');
|
|
@@ -35,16 +36,21 @@ async function checkNodeVersion() {
|
|
|
35
36
|
throw new ArgError(`Required node version ${version} not satisfied with current version ${process.version}`);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
const
|
|
39
|
+
const currentMinimalNodeVersion = 14;
|
|
40
|
+
const nextMinimalNodeVersion = 16;
|
|
39
41
|
const majorVersion = Number(process.versions.node.split('.')[0]);
|
|
40
42
|
const dateHasPassed = new Date('2023-04-30T00:00:00.000Z') <= new Date();
|
|
41
43
|
|
|
42
|
-
if (majorVersion <
|
|
43
|
-
throw new ArgError(`Testim.io CLI supports Node.js ${
|
|
44
|
+
if (majorVersion < currentMinimalNodeVersion) {
|
|
45
|
+
throw new ArgError(`Testim.io CLI supports Node.js ${currentMinimalNodeVersion} and above, please upgrade to a newer Node.js version`);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
if (majorVersion <
|
|
47
|
-
|
|
48
|
+
if (majorVersion < nextMinimalNodeVersion && dateHasPassed) {
|
|
49
|
+
throw new ArgError(`Testim.io CLI supports Node.js ${nextMinimalNodeVersion} and above, please upgrade to a newer Node.js version`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (majorVersion < nextMinimalNodeVersion) {
|
|
53
|
+
console.log('\x1b[33m%s\x1b[0m', `Testim.io CLI will stop supporting Node.js < ${nextMinimalNodeVersion} on April 30 2023, please upgrade to a newer Node.js version`);
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
|
package/commons/featureFlags.js
CHANGED
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.263.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.263.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.6.23",
|
|
@@ -559,11 +559,11 @@
|
|
|
559
559
|
}
|
|
560
560
|
},
|
|
561
561
|
"node_modules/@babel/runtime": {
|
|
562
|
-
"version": "7.20.
|
|
563
|
-
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.
|
|
564
|
-
"integrity": "sha512-
|
|
562
|
+
"version": "7.20.6",
|
|
563
|
+
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz",
|
|
564
|
+
"integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==",
|
|
565
565
|
"dependencies": {
|
|
566
|
-
"regenerator-runtime": "^0.13.
|
|
566
|
+
"regenerator-runtime": "^0.13.11"
|
|
567
567
|
},
|
|
568
568
|
"engines": {
|
|
569
569
|
"node": ">=6.9.0"
|
|
@@ -1064,9 +1064,9 @@
|
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
"node_modules/@sinonjs/commons": {
|
|
1067
|
-
"version": "1.8.
|
|
1068
|
-
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.
|
|
1069
|
-
"integrity": "sha512-
|
|
1067
|
+
"version": "1.8.6",
|
|
1068
|
+
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
|
1069
|
+
"integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==",
|
|
1070
1070
|
"dev": true,
|
|
1071
1071
|
"dependencies": {
|
|
1072
1072
|
"type-detect": "4.0.8"
|
|
@@ -1511,9 +1511,9 @@
|
|
|
1511
1511
|
}
|
|
1512
1512
|
},
|
|
1513
1513
|
"node_modules/@wdio/config/node_modules/minimatch": {
|
|
1514
|
-
"version": "5.1.
|
|
1515
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
1516
|
-
"integrity": "sha512-
|
|
1514
|
+
"version": "5.1.1",
|
|
1515
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
1516
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
1517
1517
|
"dependencies": {
|
|
1518
1518
|
"brace-expansion": "^2.0.1"
|
|
1519
1519
|
},
|
|
@@ -5567,9 +5567,9 @@
|
|
|
5567
5567
|
}
|
|
5568
5568
|
},
|
|
5569
5569
|
"node_modules/filelist/node_modules/minimatch": {
|
|
5570
|
-
"version": "5.1.
|
|
5571
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
5572
|
-
"integrity": "sha512-
|
|
5570
|
+
"version": "5.1.1",
|
|
5571
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
5572
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
5573
5573
|
"dependencies": {
|
|
5574
5574
|
"brace-expansion": "^2.0.1"
|
|
5575
5575
|
},
|
|
@@ -7797,9 +7797,9 @@
|
|
|
7797
7797
|
}
|
|
7798
7798
|
},
|
|
7799
7799
|
"node_modules/js-beautify/node_modules/minimatch": {
|
|
7800
|
-
"version": "5.1.
|
|
7801
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
7802
|
-
"integrity": "sha512-
|
|
7800
|
+
"version": "5.1.1",
|
|
7801
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
7802
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
7803
7803
|
"dev": true,
|
|
7804
7804
|
"dependencies": {
|
|
7805
7805
|
"brace-expansion": "^2.0.1"
|
|
@@ -12959,9 +12959,9 @@
|
|
|
12959
12959
|
}
|
|
12960
12960
|
},
|
|
12961
12961
|
"node_modules/readdir-glob/node_modules/minimatch": {
|
|
12962
|
-
"version": "5.1.
|
|
12963
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
12964
|
-
"integrity": "sha512-
|
|
12962
|
+
"version": "5.1.1",
|
|
12963
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
12964
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
12965
12965
|
"dependencies": {
|
|
12966
12966
|
"brace-expansion": "^2.0.1"
|
|
12967
12967
|
},
|
|
@@ -15572,9 +15572,9 @@
|
|
|
15572
15572
|
}
|
|
15573
15573
|
},
|
|
15574
15574
|
"node_modules/vm2": {
|
|
15575
|
-
"version": "3.9.
|
|
15576
|
-
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.
|
|
15577
|
-
"integrity": "sha512-
|
|
15575
|
+
"version": "3.9.12",
|
|
15576
|
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.12.tgz",
|
|
15577
|
+
"integrity": "sha512-OMmRsKh1gmdosFzuqmj6O43hqIStqXA24YbwjtUTO0TkOBP8yLNHLplbr4odnAzEcMnm9lt2r3R8kTivn8urMg==",
|
|
15578
15578
|
"dependencies": {
|
|
15579
15579
|
"acorn": "^8.7.0",
|
|
15580
15580
|
"acorn-walk": "^8.2.0"
|
|
@@ -15702,9 +15702,9 @@
|
|
|
15702
15702
|
}
|
|
15703
15703
|
},
|
|
15704
15704
|
"node_modules/webdriverio/node_modules/minimatch": {
|
|
15705
|
-
"version": "5.1.
|
|
15706
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
15707
|
-
"integrity": "sha512-
|
|
15705
|
+
"version": "5.1.1",
|
|
15706
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
15707
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
15708
15708
|
"dependencies": {
|
|
15709
15709
|
"brace-expansion": "^2.0.1"
|
|
15710
15710
|
},
|
|
@@ -16582,11 +16582,11 @@
|
|
|
16582
16582
|
}
|
|
16583
16583
|
},
|
|
16584
16584
|
"@babel/runtime": {
|
|
16585
|
-
"version": "7.20.
|
|
16586
|
-
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.
|
|
16587
|
-
"integrity": "sha512-
|
|
16585
|
+
"version": "7.20.6",
|
|
16586
|
+
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz",
|
|
16587
|
+
"integrity": "sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==",
|
|
16588
16588
|
"requires": {
|
|
16589
|
-
"regenerator-runtime": "^0.13.
|
|
16589
|
+
"regenerator-runtime": "^0.13.11"
|
|
16590
16590
|
}
|
|
16591
16591
|
},
|
|
16592
16592
|
"@colors/colors": {
|
|
@@ -16965,9 +16965,9 @@
|
|
|
16965
16965
|
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
|
|
16966
16966
|
},
|
|
16967
16967
|
"@sinonjs/commons": {
|
|
16968
|
-
"version": "1.8.
|
|
16969
|
-
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.
|
|
16970
|
-
"integrity": "sha512-
|
|
16968
|
+
"version": "1.8.6",
|
|
16969
|
+
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
|
16970
|
+
"integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==",
|
|
16971
16971
|
"dev": true,
|
|
16972
16972
|
"requires": {
|
|
16973
16973
|
"type-detect": "4.0.8"
|
|
@@ -17362,9 +17362,9 @@
|
|
|
17362
17362
|
}
|
|
17363
17363
|
},
|
|
17364
17364
|
"minimatch": {
|
|
17365
|
-
"version": "5.1.
|
|
17366
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
17367
|
-
"integrity": "sha512-
|
|
17365
|
+
"version": "5.1.1",
|
|
17366
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
17367
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
17368
17368
|
"requires": {
|
|
17369
17369
|
"brace-expansion": "^2.0.1"
|
|
17370
17370
|
}
|
|
@@ -20606,9 +20606,9 @@
|
|
|
20606
20606
|
}
|
|
20607
20607
|
},
|
|
20608
20608
|
"minimatch": {
|
|
20609
|
-
"version": "5.1.
|
|
20610
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
20611
|
-
"integrity": "sha512-
|
|
20609
|
+
"version": "5.1.1",
|
|
20610
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
20611
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
20612
20612
|
"requires": {
|
|
20613
20613
|
"brace-expansion": "^2.0.1"
|
|
20614
20614
|
}
|
|
@@ -22334,9 +22334,9 @@
|
|
|
22334
22334
|
}
|
|
22335
22335
|
},
|
|
22336
22336
|
"minimatch": {
|
|
22337
|
-
"version": "5.1.
|
|
22338
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
22339
|
-
"integrity": "sha512-
|
|
22337
|
+
"version": "5.1.1",
|
|
22338
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
22339
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
22340
22340
|
"dev": true,
|
|
22341
22341
|
"requires": {
|
|
22342
22342
|
"brace-expansion": "^2.0.1"
|
|
@@ -26173,9 +26173,9 @@
|
|
|
26173
26173
|
}
|
|
26174
26174
|
},
|
|
26175
26175
|
"minimatch": {
|
|
26176
|
-
"version": "5.1.
|
|
26177
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
26178
|
-
"integrity": "sha512-
|
|
26176
|
+
"version": "5.1.1",
|
|
26177
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
26178
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
26179
26179
|
"requires": {
|
|
26180
26180
|
"brace-expansion": "^2.0.1"
|
|
26181
26181
|
}
|
|
@@ -28316,9 +28316,9 @@
|
|
|
28316
28316
|
}
|
|
28317
28317
|
},
|
|
28318
28318
|
"vm2": {
|
|
28319
|
-
"version": "3.9.
|
|
28320
|
-
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.
|
|
28321
|
-
"integrity": "sha512-
|
|
28319
|
+
"version": "3.9.12",
|
|
28320
|
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.12.tgz",
|
|
28321
|
+
"integrity": "sha512-OMmRsKh1gmdosFzuqmj6O43hqIStqXA24YbwjtUTO0TkOBP8yLNHLplbr4odnAzEcMnm9lt2r3R8kTivn8urMg==",
|
|
28322
28322
|
"requires": {
|
|
28323
28323
|
"acorn": "^8.7.0",
|
|
28324
28324
|
"acorn-walk": "^8.2.0"
|
|
@@ -28431,9 +28431,9 @@
|
|
|
28431
28431
|
}
|
|
28432
28432
|
},
|
|
28433
28433
|
"minimatch": {
|
|
28434
|
-
"version": "5.1.
|
|
28435
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.
|
|
28436
|
-
"integrity": "sha512-
|
|
28434
|
+
"version": "5.1.1",
|
|
28435
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz",
|
|
28436
|
+
"integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==",
|
|
28437
28437
|
"requires": {
|
|
28438
28438
|
"brace-expansion": "^2.0.1"
|
|
28439
28439
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable no-extend-native */
|
|
2
|
+
|
|
3
|
+
Array.prototype.at = Array.prototype.at || function (index) {
|
|
4
|
+
const relativeIndex = Number.isInteger(index) ? index : 0;
|
|
5
|
+
|
|
6
|
+
const indexToRead = relativeIndex >= 0 ? relativeIndex : this.length + relativeIndex;
|
|
7
|
+
|
|
8
|
+
if (indexToRead < 0 || indexToRead >= this.length) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return this[indexToRead];
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./Array.prototype.at');
|
package/runner.js
CHANGED
|
@@ -310,6 +310,13 @@ async function init(options) {
|
|
|
310
310
|
validateOptionsForCompany(options, companyByProjectId);
|
|
311
311
|
await Promise.all([featureFlagsReady, socketConnected]);
|
|
312
312
|
|
|
313
|
+
if (options.browser && featureFlags.flags.dec2022eolBrowsers.isEnabled()) {
|
|
314
|
+
const browser = utils.getBrowserInfo(options.browser);
|
|
315
|
+
if (browser.eol) {
|
|
316
|
+
throw new ArgError(`Unsupported browser: ${browser.browserName}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
313
320
|
perf.log('after featureFlagsReady and socketConnected');
|
|
314
321
|
setSystemInfo(options, editorConfig);
|
|
315
322
|
setCompany(options, companyByProjectId);
|
package/testRunStatus.js
CHANGED
|
@@ -378,6 +378,10 @@ class RunStatus {
|
|
|
378
378
|
|
|
379
379
|
const runConfig = options.browser ? utils.getRunConfigByBrowserName(options.browser, options.saucelabs, options.browserstack) : testInfo.runConfig;
|
|
380
380
|
|
|
381
|
+
if (runConfig && featureFlags.flags.dec2022eolBrowsers.isEnabled() && utils.getBrowserInfo(runConfig.browserValue)?.eol) {
|
|
382
|
+
throw new ArgError(`Unsupported Browser: ${runConfig.browserName}`);
|
|
383
|
+
}
|
|
384
|
+
|
|
381
385
|
resultStatus[testInfo.resultId].config = Object.assign({}, this.execConfig, {
|
|
382
386
|
companyId,
|
|
383
387
|
testData: testInfo.testData?.value ? testInfo.testData.value : null,
|
package/utils/index.js
CHANGED
|
@@ -43,16 +43,22 @@ const BROWSERS = [
|
|
|
43
43
|
{ browserName: 'Chrome', bs: { browser: 'Chrome', browser_version: '94' }, sl: { browserName: 'chrome', version: '94.0' }, browserValue: 'chrome' },
|
|
44
44
|
{ browserName: 'Firefox', bs: { browser: 'Firefox', browser_version: '89' }, sl: { browserName: 'firefox', version: '89.0' }, browserValue: 'firefox' },
|
|
45
45
|
{ browserName: 'Safari', bs: { browser: 'Safari' }, sl: { browserName: 'safari' }, browserValue: 'safari' },
|
|
46
|
-
{ browserName: 'Edge', bs: { browser: 'Edge', browser_version: '18' }, sl: { browserName: 'MicrosoftEdge', version: '18.17763' }, browserValue: 'edge' },
|
|
46
|
+
{ browserName: 'Edge', bs: { browser: 'Edge', browser_version: '18' }, sl: { browserName: 'MicrosoftEdge', version: '18.17763' }, browserValue: 'edge', eol: true },
|
|
47
47
|
// eslint-disable-next-line max-len
|
|
48
48
|
{ browserName: 'Edge Chromium', bs: { browser: 'Edge', browser_version: '94' }, sl: { browserName: 'MicrosoftEdge', version: '94' }, synonyms: ['edge-chromium'], browserValue: 'edge-chromium', seleniumName: 'MicrosoftEdge' },
|
|
49
|
-
|
|
49
|
+
// eslint-disable-next-line max-len
|
|
50
|
+
{ browserName: 'Internet Explorer 11', bs: { browser: 'IE', browser_version: '11' }, sl: { browserName: 'internet explorer', version: '11.0' }, synonyms: ['ie11'], browserValue: 'ie11', eol: true },
|
|
50
51
|
{ browserName: 'Browser', bs: {}, sl: { browserName: 'Browser' }, browserValue: 'browser' },
|
|
51
52
|
{ browserName: 'Android', bs: { browserName: 'android' }, sl: {}, browserValue: 'android' },
|
|
52
53
|
{ browserName: 'iPad', bs: { browserName: 'iPad' }, sl: {}, browserValue: 'ipad' },
|
|
53
54
|
{ browserName: 'iPhone', bs: { browserName: 'iPhone' }, sl: {}, browserValue: 'iphone' },
|
|
54
55
|
];
|
|
55
56
|
|
|
57
|
+
function getBrowserInfo(browserValue) {
|
|
58
|
+
browserValue = browserValue.toLowerCase();
|
|
59
|
+
return BROWSERS.find((b) => b.browserValue === browserValue);
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
function getRunConfigByBrowserName(browser, saucelabs, browserstack) {
|
|
57
63
|
browser = browser.toLowerCase();
|
|
58
64
|
const selectedBrowser = BROWSERS.find(b => b.browserName.toLowerCase() === browser || browser.includes(b.synonyms)) || BROWSERS[0];
|
|
@@ -182,6 +188,7 @@ module.exports = {
|
|
|
182
188
|
groupTestsByRetries,
|
|
183
189
|
getPlanType,
|
|
184
190
|
getCdpAddressForHost,
|
|
191
|
+
getBrowserInfo,
|
|
185
192
|
...fsUtils,
|
|
186
193
|
...argsUtils,
|
|
187
194
|
...timeUtils,
|
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var polyfills = function () {
|
|
4
|
-
if (!Array.from) {
|
|
5
|
-
Array.from = (function () {
|
|
6
|
-
var toStr = Object.prototype.toString;
|
|
7
|
-
var isCallable = function (fn) {
|
|
8
|
-
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
|
|
9
|
-
};
|
|
10
|
-
var toInteger = function (value) {
|
|
11
|
-
var number = Number(value);
|
|
12
|
-
if (isNaN(number)) {
|
|
13
|
-
return 0;
|
|
14
|
-
}
|
|
15
|
-
if (number === 0 || !isFinite(number)) {
|
|
16
|
-
return number;
|
|
17
|
-
}
|
|
18
|
-
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
|
19
|
-
};
|
|
20
|
-
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
21
|
-
var toLength = function (value) {
|
|
22
|
-
var len = toInteger(value);
|
|
23
|
-
return Math.min(Math.max(len, 0), maxSafeInteger);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// The length property of the from method is 1.
|
|
27
|
-
return function from(arrayLike/*, mapFn, thisArg */) {
|
|
28
|
-
// 1. Let C be the this value.
|
|
29
|
-
var C = this;
|
|
30
|
-
|
|
31
|
-
// 2. Let items be ToObject(arrayLike).
|
|
32
|
-
var items = Object(arrayLike);
|
|
33
|
-
|
|
34
|
-
// 3. ReturnIfAbrupt(items).
|
|
35
|
-
if (arrayLike === null) {
|
|
36
|
-
throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 4. If mapfn is undefined, then let mapping be false.
|
|
40
|
-
var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
|
|
41
|
-
var T;
|
|
42
|
-
if (typeof mapFn !== 'undefined') {
|
|
43
|
-
// 5. else
|
|
44
|
-
// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
|
|
45
|
-
if (!isCallable(mapFn)) {
|
|
46
|
-
throw new TypeError('Array.from: when provided, the second argument must be a function');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
|
50
|
-
if (arguments.length > 2) {
|
|
51
|
-
T = arguments[2];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 10. Let lenValue be Get(items, "length").
|
|
56
|
-
// 11. Let len be ToLength(lenValue).
|
|
57
|
-
var len = toLength(items.length);
|
|
58
|
-
|
|
59
|
-
// 13. If IsConstructor(C) is true, then
|
|
60
|
-
// 13. a. Let A be the result of calling the [[Construct]] internal method
|
|
61
|
-
// of C with an argument list containing the single item len.
|
|
62
|
-
// 14. a. Else, Let A be ArrayCreate(len).
|
|
63
|
-
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
|
64
|
-
|
|
65
|
-
// 16. Let k be 0.
|
|
66
|
-
var k = 0;
|
|
67
|
-
// 17. Repeat, while k < len… (also steps a - h)
|
|
68
|
-
var kValue;
|
|
69
|
-
while (k < len) {
|
|
70
|
-
kValue = items[k];
|
|
71
|
-
if (mapFn) {
|
|
72
|
-
A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
|
|
73
|
-
} else {
|
|
74
|
-
A[k] = kValue;
|
|
75
|
-
}
|
|
76
|
-
k += 1;
|
|
77
|
-
}
|
|
78
|
-
// 18. Let putStatus be Put(A, "length", len, true).
|
|
79
|
-
A.length = len;
|
|
80
|
-
// 20. Return A.
|
|
81
|
-
return A;
|
|
82
|
-
};
|
|
83
|
-
}());
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (!window.JSON) {
|
|
87
|
-
window.JSON = {
|
|
88
|
-
parse: function(sJSON) { return eval('(' + sJSON + ')'); },
|
|
89
|
-
stringify: (function () {
|
|
90
|
-
var toString = Object.prototype.toString;
|
|
91
|
-
var isArray = Array.isArray || function (a) { return toString.call(a) === '[object Array]'; };
|
|
92
|
-
var escMap = {'"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t'};
|
|
93
|
-
var escFunc = function (m) { return escMap[m] || '\\u' + (m.charCodeAt(0) + 0x10000).toString(16).substr(1); };
|
|
94
|
-
var escRE = /[\\"\u0000-\u001F\u2028\u2029]/g;
|
|
95
|
-
return function stringify(value) {
|
|
96
|
-
if (value == null) {
|
|
97
|
-
return 'null';
|
|
98
|
-
} else if (typeof value === 'number') {
|
|
99
|
-
return isFinite(value) ? value.toString() : 'null';
|
|
100
|
-
} else if (typeof value === 'boolean') {
|
|
101
|
-
return value.toString();
|
|
102
|
-
} else if (typeof value === 'object') {
|
|
103
|
-
if (typeof value.toJSON === 'function') {
|
|
104
|
-
return stringify(value.toJSON());
|
|
105
|
-
} else if (isArray(value)) {
|
|
106
|
-
var res = '[';
|
|
107
|
-
for (var i = 0; i < value.length; i++)
|
|
108
|
-
res += (i ? ', ' : '') + stringify(value[i]);
|
|
109
|
-
return res + ']';
|
|
110
|
-
} else if (toString.call(value) === '[object Object]') {
|
|
111
|
-
var tmp = [];
|
|
112
|
-
for (var k in value) {
|
|
113
|
-
if (value.hasOwnProperty(k))
|
|
114
|
-
tmp.push(stringify(k) + ': ' + stringify(value[k]));
|
|
115
|
-
}
|
|
116
|
-
return '{' + tmp.join(', ') + '}';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return '"' + value.toString().replace(escRE, escFunc) + '"';
|
|
120
|
-
};
|
|
121
|
-
})()
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (typeof Object.assign != 'function') {
|
|
126
|
-
Object.assign = function (target, varArgs) { // .length of function is 2
|
|
127
|
-
'use strict';
|
|
128
|
-
if (target == null) { // TypeError if undefined or null
|
|
129
|
-
throw new TypeError('Cannot convert undefined or null to object');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var to = Object(target);
|
|
133
|
-
|
|
134
|
-
for (var index = 1; index < arguments.length; index++) {
|
|
135
|
-
var nextSource = arguments[index];
|
|
136
|
-
|
|
137
|
-
if (nextSource != null) { // Skip over if undefined or null
|
|
138
|
-
for (var nextKey in nextSource) {
|
|
139
|
-
// Avoid bugs when hasOwnProperty is shadowed
|
|
140
|
-
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
141
|
-
to[nextKey] = nextSource[nextKey];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return to;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if(!window.Promise) {
|
|
151
|
-
(function () {
|
|
152
|
-
|
|
153
|
-
// Store setTimeout reference so promise-polyfill will be unaffected by
|
|
154
|
-
// other code modifying setTimeout (like sinon.useFakeTimers())
|
|
155
|
-
var setTimeoutFunc = setTimeout;
|
|
156
|
-
|
|
157
|
-
function noop() {}
|
|
158
|
-
|
|
159
|
-
// Polyfill for Function.prototype.bind
|
|
160
|
-
function bind(fn, thisArg) {
|
|
161
|
-
return function () {
|
|
162
|
-
fn.apply(thisArg, arguments);
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function Promise(fn) {
|
|
167
|
-
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
|
|
168
|
-
if (typeof fn !== 'function') throw new TypeError('not a function');
|
|
169
|
-
this._state = 0;
|
|
170
|
-
this._handled = false;
|
|
171
|
-
this._value = undefined;
|
|
172
|
-
this._deferreds = [];
|
|
173
|
-
|
|
174
|
-
doResolve(fn, this);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function handle(self, deferred) {
|
|
178
|
-
while (self._state === 3) {
|
|
179
|
-
self = self._value;
|
|
180
|
-
}
|
|
181
|
-
if (self._state === 0) {
|
|
182
|
-
self._deferreds.push(deferred);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
self._handled = true;
|
|
186
|
-
Promise._immediateFn(function () {
|
|
187
|
-
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
|
188
|
-
if (cb === null) {
|
|
189
|
-
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
var ret;
|
|
193
|
-
try {
|
|
194
|
-
ret = cb(self._value);
|
|
195
|
-
} catch (e) {
|
|
196
|
-
reject(deferred.promise, e);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
resolve(deferred.promise, ret);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function resolve(self, newValue) {
|
|
204
|
-
try {
|
|
205
|
-
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
|
|
206
|
-
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
|
|
207
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
|
208
|
-
var then = newValue.then;
|
|
209
|
-
if (newValue instanceof Promise) {
|
|
210
|
-
self._state = 3;
|
|
211
|
-
self._value = newValue;
|
|
212
|
-
finale(self);
|
|
213
|
-
return;
|
|
214
|
-
} else if (typeof then === 'function') {
|
|
215
|
-
doResolve(bind(then, newValue), self);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
self._state = 1;
|
|
220
|
-
self._value = newValue;
|
|
221
|
-
finale(self);
|
|
222
|
-
} catch (e) {
|
|
223
|
-
reject(self, e);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function reject(self, newValue) {
|
|
228
|
-
self._state = 2;
|
|
229
|
-
self._value = newValue;
|
|
230
|
-
finale(self);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function finale(self) {
|
|
234
|
-
if (self._state === 2 && self._deferreds.length === 0) {
|
|
235
|
-
Promise._immediateFn(function() {
|
|
236
|
-
if (!self._handled) {
|
|
237
|
-
Promise._unhandledRejectionFn(self._value);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
|
243
|
-
handle(self, self._deferreds[i]);
|
|
244
|
-
}
|
|
245
|
-
self._deferreds = null;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function Handler(onFulfilled, onRejected, promise) {
|
|
249
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
250
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
251
|
-
this.promise = promise;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Take a potentially misbehaving resolver function and make sure
|
|
256
|
-
* onFulfilled and onRejected are only called once.
|
|
257
|
-
*
|
|
258
|
-
* Makes no guarantees about asynchrony.
|
|
259
|
-
*/
|
|
260
|
-
function doResolve(fn, self) {
|
|
261
|
-
var done = false;
|
|
262
|
-
try {
|
|
263
|
-
fn(function (value) {
|
|
264
|
-
if (done) return;
|
|
265
|
-
done = true;
|
|
266
|
-
resolve(self, value);
|
|
267
|
-
}, function (reason) {
|
|
268
|
-
if (done) return;
|
|
269
|
-
done = true;
|
|
270
|
-
reject(self, reason);
|
|
271
|
-
});
|
|
272
|
-
} catch (ex) {
|
|
273
|
-
if (done) return;
|
|
274
|
-
done = true;
|
|
275
|
-
reject(self, ex);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
Promise.prototype['catch'] = function (onRejected) {
|
|
280
|
-
return this.then(null, onRejected);
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
|
284
|
-
var prom = new (this.constructor)(noop);
|
|
285
|
-
|
|
286
|
-
handle(this, new Handler(onFulfilled, onRejected, prom));
|
|
287
|
-
return prom;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
Promise.all = function (arr) {
|
|
291
|
-
var args = Array.prototype.slice.call(arr);
|
|
292
|
-
|
|
293
|
-
return new Promise(function (resolve, reject) {
|
|
294
|
-
if (args.length === 0) return resolve([]);
|
|
295
|
-
var remaining = args.length;
|
|
296
|
-
|
|
297
|
-
function res(i, val) {
|
|
298
|
-
try {
|
|
299
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
|
300
|
-
var then = val.then;
|
|
301
|
-
if (typeof then === 'function') {
|
|
302
|
-
then.call(val, function (val) {
|
|
303
|
-
res(i, val);
|
|
304
|
-
}, reject);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
args[i] = val;
|
|
309
|
-
if (--remaining === 0) {
|
|
310
|
-
resolve(args);
|
|
311
|
-
}
|
|
312
|
-
} catch (ex) {
|
|
313
|
-
reject(ex);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
for (var i = 0; i < args.length; i++) {
|
|
318
|
-
res(i, args[i]);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
Promise.resolve = function (value) {
|
|
324
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
|
325
|
-
return value;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return new Promise(function (resolve) {
|
|
329
|
-
resolve(value);
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
Promise.reject = function (value) {
|
|
334
|
-
return new Promise(function (resolve, reject) {
|
|
335
|
-
reject(value);
|
|
336
|
-
});
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
Promise.race = function (values) {
|
|
340
|
-
return new Promise(function (resolve, reject) {
|
|
341
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
|
342
|
-
values[i].then(resolve, reject);
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
// Use polyfill for setImmediate for performance gains
|
|
348
|
-
Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
|
|
349
|
-
function (fn) {
|
|
350
|
-
setTimeoutFunc(fn, 0);
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
|
354
|
-
if (typeof console !== 'undefined' && console) {
|
|
355
|
-
console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Set the immediate function to execute callbacks
|
|
361
|
-
* @param fn {function} Function to execute
|
|
362
|
-
* @deprecated
|
|
363
|
-
*/
|
|
364
|
-
Promise._setImmediateFn = function _setImmediateFn(fn) {
|
|
365
|
-
Promise._immediateFn = fn;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Change the function to execute on unhandled rejection
|
|
370
|
-
* @param {function} fn Function to execute on unhandled rejection
|
|
371
|
-
* @deprecated
|
|
372
|
-
*/
|
|
373
|
-
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
|
374
|
-
Promise._unhandledRejectionFn = fn;
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
window.Promise = Promise;
|
|
378
|
-
|
|
379
|
-
})(this);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
if(!Element.prototype.remove) {
|
|
383
|
-
(function (arr) {
|
|
384
|
-
arr.forEach(function (item) {
|
|
385
|
-
item.remove = item.remove || function () {
|
|
386
|
-
this.parentNode.removeChild(this);
|
|
387
|
-
};
|
|
388
|
-
});
|
|
389
|
-
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
module.exports = polyfills;
|