@testim/testim-cli 3.255.0 → 3.257.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 +11 -8
- package/cli.js +2 -2
- package/cliAgentMode.js +7 -7
- package/codim/codim-cli.js +4 -1
- package/commons/featureFlags.js +21 -7
- package/commons/httpRequest.js +1 -1
- package/commons/initializeUserWithAuth.js +7 -4
- package/commons/preloadTests.js +5 -2
- package/commons/prepareRunner.js +5 -5
- package/commons/prepareRunnerAndTestimStartUtils.js +11 -4
- package/commons/runnerFileCache.js +9 -1
- package/commons/testimServicesApi.js +36 -5
- package/npm-shrinkwrap.json +59 -60
- package/package.json +1 -1
- package/player/stepActions/apiStepAction.js +49 -43
- package/player/stepActions/baseCliJsStepAction.js +19 -14
- package/player/stepActions/baseJsStepAction.js +9 -8
- package/player/stepActions/dropFileStepAction.js +1 -3
- package/player/stepActions/inputFileStepAction.js +10 -8
- package/player/stepActions/mouseStepAction.js +21 -22
- package/player/stepActions/nodePackageStepAction.js +34 -35
- package/player/stepActions/stepAction.js +1 -0
- package/player/utils/imageCaptureUtils.js +63 -63
- package/player/utils/screenshotUtils.js +16 -13
- package/player/utils/windowUtils.js +20 -8
- package/processHandler.js +4 -0
- package/runOptions.d.ts +27 -1
- package/runOptions.js +7 -7
- package/runner.js +62 -23
- package/runners/ParallelWorkerManager.js +3 -2
- package/runners/TestPlanRunner.js +9 -6
- package/runners/buildCodeTests.js +1 -0
- package/runners/runnerUtils.js +11 -2
- package/services/branchService.js +11 -5
- package/services/localRCASaver.js +4 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.257.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.257.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.6.23",
|
|
@@ -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.5",
|
|
1068
|
+
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.5.tgz",
|
|
1069
|
+
"integrity": "sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==",
|
|
1070
1070
|
"dev": true,
|
|
1071
1071
|
"dependencies": {
|
|
1072
1072
|
"type-detect": "4.0.8"
|
|
@@ -1377,14 +1377,14 @@
|
|
|
1377
1377
|
"dev": true
|
|
1378
1378
|
},
|
|
1379
1379
|
"node_modules/@types/cacheable-request": {
|
|
1380
|
-
"version": "6.0.
|
|
1381
|
-
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.
|
|
1382
|
-
"integrity": "sha512-
|
|
1380
|
+
"version": "6.0.3",
|
|
1381
|
+
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz",
|
|
1382
|
+
"integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==",
|
|
1383
1383
|
"dependencies": {
|
|
1384
1384
|
"@types/http-cache-semantics": "*",
|
|
1385
|
-
"@types/keyv": "
|
|
1385
|
+
"@types/keyv": "^3.1.4",
|
|
1386
1386
|
"@types/node": "*",
|
|
1387
|
-
"@types/responselike": "
|
|
1387
|
+
"@types/responselike": "^1.0.0"
|
|
1388
1388
|
}
|
|
1389
1389
|
},
|
|
1390
1390
|
"node_modules/@types/fs-extra": {
|
|
@@ -1408,12 +1408,11 @@
|
|
|
1408
1408
|
"dev": true
|
|
1409
1409
|
},
|
|
1410
1410
|
"node_modules/@types/keyv": {
|
|
1411
|
-
"version": "
|
|
1412
|
-
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-
|
|
1413
|
-
"integrity": "sha512-
|
|
1414
|
-
"deprecated": "This is a stub types definition. keyv provides its own type definitions, so you do not need this installed.",
|
|
1411
|
+
"version": "3.1.4",
|
|
1412
|
+
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
|
|
1413
|
+
"integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==",
|
|
1415
1414
|
"dependencies": {
|
|
1416
|
-
"
|
|
1415
|
+
"@types/node": "*"
|
|
1417
1416
|
}
|
|
1418
1417
|
},
|
|
1419
1418
|
"node_modules/@types/ms": {
|
|
@@ -2929,15 +2928,15 @@
|
|
|
2929
2928
|
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw=="
|
|
2930
2929
|
},
|
|
2931
2930
|
"node_modules/chai": {
|
|
2932
|
-
"version": "4.3.
|
|
2933
|
-
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.
|
|
2934
|
-
"integrity": "sha512-
|
|
2931
|
+
"version": "4.3.7",
|
|
2932
|
+
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz",
|
|
2933
|
+
"integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==",
|
|
2935
2934
|
"dev": true,
|
|
2936
2935
|
"peer": true,
|
|
2937
2936
|
"dependencies": {
|
|
2938
2937
|
"assertion-error": "^1.1.0",
|
|
2939
2938
|
"check-error": "^1.0.2",
|
|
2940
|
-
"deep-eql": "^
|
|
2939
|
+
"deep-eql": "^4.1.2",
|
|
2941
2940
|
"get-func-name": "^2.0.0",
|
|
2942
2941
|
"loupe": "^2.3.1",
|
|
2943
2942
|
"pathval": "^1.1.1",
|
|
@@ -4365,16 +4364,16 @@
|
|
|
4365
4364
|
}
|
|
4366
4365
|
},
|
|
4367
4366
|
"node_modules/deep-eql": {
|
|
4368
|
-
"version": "
|
|
4369
|
-
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-
|
|
4370
|
-
"integrity": "sha512
|
|
4367
|
+
"version": "4.1.2",
|
|
4368
|
+
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz",
|
|
4369
|
+
"integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==",
|
|
4371
4370
|
"dev": true,
|
|
4372
4371
|
"peer": true,
|
|
4373
4372
|
"dependencies": {
|
|
4374
4373
|
"type-detect": "^4.0.0"
|
|
4375
4374
|
},
|
|
4376
4375
|
"engines": {
|
|
4377
|
-
"node": ">=
|
|
4376
|
+
"node": ">=6"
|
|
4378
4377
|
}
|
|
4379
4378
|
},
|
|
4380
4379
|
"node_modules/deep-equal": {
|
|
@@ -8015,9 +8014,9 @@
|
|
|
8015
8014
|
}
|
|
8016
8015
|
},
|
|
8017
8016
|
"node_modules/keyv": {
|
|
8018
|
-
"version": "4.5.
|
|
8019
|
-
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.
|
|
8020
|
-
"integrity": "sha512-
|
|
8017
|
+
"version": "4.5.2",
|
|
8018
|
+
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz",
|
|
8019
|
+
"integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==",
|
|
8021
8020
|
"dependencies": {
|
|
8022
8021
|
"json-buffer": "3.0.1"
|
|
8023
8022
|
}
|
|
@@ -8390,9 +8389,9 @@
|
|
|
8390
8389
|
}
|
|
8391
8390
|
},
|
|
8392
8391
|
"node_modules/loglevel": {
|
|
8393
|
-
"version": "1.8.
|
|
8394
|
-
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.
|
|
8395
|
-
"integrity": "sha512-
|
|
8392
|
+
"version": "1.8.1",
|
|
8393
|
+
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz",
|
|
8394
|
+
"integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==",
|
|
8396
8395
|
"engines": {
|
|
8397
8396
|
"node": ">= 0.6.0"
|
|
8398
8397
|
},
|
|
@@ -8407,9 +8406,9 @@
|
|
|
8407
8406
|
"integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g=="
|
|
8408
8407
|
},
|
|
8409
8408
|
"node_modules/loupe": {
|
|
8410
|
-
"version": "2.3.
|
|
8411
|
-
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.
|
|
8412
|
-
"integrity": "sha512-
|
|
8409
|
+
"version": "2.3.6",
|
|
8410
|
+
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz",
|
|
8411
|
+
"integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==",
|
|
8413
8412
|
"dev": true,
|
|
8414
8413
|
"peer": true,
|
|
8415
8414
|
"dependencies": {
|
|
@@ -16966,9 +16965,9 @@
|
|
|
16966
16965
|
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
|
|
16967
16966
|
},
|
|
16968
16967
|
"@sinonjs/commons": {
|
|
16969
|
-
"version": "1.8.
|
|
16970
|
-
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.
|
|
16971
|
-
"integrity": "sha512-
|
|
16968
|
+
"version": "1.8.5",
|
|
16969
|
+
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.5.tgz",
|
|
16970
|
+
"integrity": "sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==",
|
|
16972
16971
|
"dev": true,
|
|
16973
16972
|
"requires": {
|
|
16974
16973
|
"type-detect": "4.0.8"
|
|
@@ -17238,14 +17237,14 @@
|
|
|
17238
17237
|
"dev": true
|
|
17239
17238
|
},
|
|
17240
17239
|
"@types/cacheable-request": {
|
|
17241
|
-
"version": "6.0.
|
|
17242
|
-
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.
|
|
17243
|
-
"integrity": "sha512-
|
|
17240
|
+
"version": "6.0.3",
|
|
17241
|
+
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz",
|
|
17242
|
+
"integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==",
|
|
17244
17243
|
"requires": {
|
|
17245
17244
|
"@types/http-cache-semantics": "*",
|
|
17246
|
-
"@types/keyv": "
|
|
17245
|
+
"@types/keyv": "^3.1.4",
|
|
17247
17246
|
"@types/node": "*",
|
|
17248
|
-
"@types/responselike": "
|
|
17247
|
+
"@types/responselike": "^1.0.0"
|
|
17249
17248
|
}
|
|
17250
17249
|
},
|
|
17251
17250
|
"@types/fs-extra": {
|
|
@@ -17269,11 +17268,11 @@
|
|
|
17269
17268
|
"dev": true
|
|
17270
17269
|
},
|
|
17271
17270
|
"@types/keyv": {
|
|
17272
|
-
"version": "
|
|
17273
|
-
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-
|
|
17274
|
-
"integrity": "sha512-
|
|
17271
|
+
"version": "3.1.4",
|
|
17272
|
+
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
|
|
17273
|
+
"integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==",
|
|
17275
17274
|
"requires": {
|
|
17276
|
-
"
|
|
17275
|
+
"@types/node": "*"
|
|
17277
17276
|
}
|
|
17278
17277
|
},
|
|
17279
17278
|
"@types/ms": {
|
|
@@ -18483,15 +18482,15 @@
|
|
|
18483
18482
|
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw=="
|
|
18484
18483
|
},
|
|
18485
18484
|
"chai": {
|
|
18486
|
-
"version": "4.3.
|
|
18487
|
-
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.
|
|
18488
|
-
"integrity": "sha512-
|
|
18485
|
+
"version": "4.3.7",
|
|
18486
|
+
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz",
|
|
18487
|
+
"integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==",
|
|
18489
18488
|
"dev": true,
|
|
18490
18489
|
"peer": true,
|
|
18491
18490
|
"requires": {
|
|
18492
18491
|
"assertion-error": "^1.1.0",
|
|
18493
18492
|
"check-error": "^1.0.2",
|
|
18494
|
-
"deep-eql": "^
|
|
18493
|
+
"deep-eql": "^4.1.2",
|
|
18495
18494
|
"get-func-name": "^2.0.0",
|
|
18496
18495
|
"loupe": "^2.3.1",
|
|
18497
18496
|
"pathval": "^1.1.1",
|
|
@@ -19655,9 +19654,9 @@
|
|
|
19655
19654
|
}
|
|
19656
19655
|
},
|
|
19657
19656
|
"deep-eql": {
|
|
19658
|
-
"version": "
|
|
19659
|
-
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-
|
|
19660
|
-
"integrity": "sha512
|
|
19657
|
+
"version": "4.1.2",
|
|
19658
|
+
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz",
|
|
19659
|
+
"integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==",
|
|
19661
19660
|
"dev": true,
|
|
19662
19661
|
"peer": true,
|
|
19663
19662
|
"requires": {
|
|
@@ -22525,9 +22524,9 @@
|
|
|
22525
22524
|
}
|
|
22526
22525
|
},
|
|
22527
22526
|
"keyv": {
|
|
22528
|
-
"version": "4.5.
|
|
22529
|
-
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.
|
|
22530
|
-
"integrity": "sha512-
|
|
22527
|
+
"version": "4.5.2",
|
|
22528
|
+
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz",
|
|
22529
|
+
"integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==",
|
|
22531
22530
|
"requires": {
|
|
22532
22531
|
"json-buffer": "3.0.1"
|
|
22533
22532
|
}
|
|
@@ -22857,9 +22856,9 @@
|
|
|
22857
22856
|
}
|
|
22858
22857
|
},
|
|
22859
22858
|
"loglevel": {
|
|
22860
|
-
"version": "1.8.
|
|
22861
|
-
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.
|
|
22862
|
-
"integrity": "sha512-
|
|
22859
|
+
"version": "1.8.1",
|
|
22860
|
+
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz",
|
|
22861
|
+
"integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg=="
|
|
22863
22862
|
},
|
|
22864
22863
|
"loglevel-plugin-prefix": {
|
|
22865
22864
|
"version": "0.8.4",
|
|
@@ -22867,9 +22866,9 @@
|
|
|
22867
22866
|
"integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g=="
|
|
22868
22867
|
},
|
|
22869
22868
|
"loupe": {
|
|
22870
|
-
"version": "2.3.
|
|
22871
|
-
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.
|
|
22872
|
-
"integrity": "sha512-
|
|
22869
|
+
"version": "2.3.6",
|
|
22870
|
+
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz",
|
|
22871
|
+
"integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==",
|
|
22873
22872
|
"dev": true,
|
|
22874
22873
|
"peer": true,
|
|
22875
22874
|
"requires": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
'use strict';
|
|
2
4
|
|
|
3
|
-
const Promise = require('bluebird');
|
|
4
5
|
const StepAction = require('./stepAction');
|
|
5
6
|
|
|
6
7
|
const sessionPlayer = require('../../commons/getSessionPlayerRequire');
|
|
@@ -9,23 +10,28 @@ const constants = sessionPlayer.commonConstants.stepResult;
|
|
|
9
10
|
const apiCall = sessionPlayer.apiCall;
|
|
10
11
|
|
|
11
12
|
class ApiStepAction extends StepAction {
|
|
12
|
-
runApiInAut(eventData) {
|
|
13
|
+
async runApiInAut(eventData) {
|
|
13
14
|
eventData.withCredentials = true;
|
|
14
15
|
const timeout = this.context.data.timeToPlayStep + 3000;
|
|
15
|
-
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
try {
|
|
17
|
+
const autRes = await this.driver.executeCodeAsync(apiCall, timeout, eventData);
|
|
18
|
+
const resp = autRes?.value;
|
|
19
|
+
return resp || {};
|
|
20
|
+
} catch (err) {
|
|
21
|
+
if (err?.message?.includes('Javascript execution context no longer exists')) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
'The page refreshed or changed while executing this step. Please consider unchecking "Send via web page" if this is expected.');
|
|
24
|
+
}
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
runApiInBg(eventData) {
|
|
25
|
-
return new Promise(resolve => apiCall(eventData, resolve));
|
|
30
|
+
return new Promise(resolve => { apiCall(eventData, resolve); });
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
performAction() {
|
|
33
|
+
async performAction() {
|
|
34
|
+
/** @type {import('clickim/src/common/models/apiStep').ApiStep} */
|
|
29
35
|
const step = this.step;
|
|
30
36
|
const context = this.context;
|
|
31
37
|
|
|
@@ -41,44 +47,44 @@ class ApiStepAction extends StepAction {
|
|
|
41
47
|
fileUrls: context.fileUrls,
|
|
42
48
|
};
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
resultInfo,
|
|
59
|
-
shouldRetry: false,
|
|
60
|
-
success: false,
|
|
61
|
-
reason: 'Connection problem',
|
|
62
|
-
errorType: constants.API_REQUEST_NETWORK_ERROR,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
result,
|
|
67
|
-
resultInfo,
|
|
68
|
-
shouldRetry: false,
|
|
69
|
-
success: true,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
50
|
+
let resp;
|
|
51
|
+
if (step.sendViaWebApp) {
|
|
52
|
+
resp = await this.runApiInAut(eventData);
|
|
53
|
+
} else {
|
|
54
|
+
resp = await this.runApiInBg(eventData);
|
|
55
|
+
}
|
|
56
|
+
const result = resp.result || {};
|
|
57
|
+
const resultInfo = {
|
|
58
|
+
method: step.method,
|
|
59
|
+
status: result.status,
|
|
60
|
+
url: step.url,
|
|
61
|
+
};
|
|
62
|
+
if (resp.success) {
|
|
63
|
+
if (result.status === 0) {
|
|
73
64
|
return {
|
|
74
65
|
result,
|
|
75
66
|
resultInfo,
|
|
76
67
|
shouldRetry: false,
|
|
77
68
|
success: false,
|
|
78
|
-
reason:
|
|
79
|
-
errorType:
|
|
69
|
+
reason: 'Connection problem',
|
|
70
|
+
errorType: constants.API_REQUEST_NETWORK_ERROR,
|
|
80
71
|
};
|
|
81
|
-
}
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
result,
|
|
75
|
+
resultInfo,
|
|
76
|
+
shouldRetry: false,
|
|
77
|
+
success: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
result,
|
|
82
|
+
resultInfo,
|
|
83
|
+
shouldRetry: false,
|
|
84
|
+
success: false,
|
|
85
|
+
reason: result.error || sessionPlayer.commonConstants.error.REQUEST_TIMED_OUT,
|
|
86
|
+
errorType: result.error ? constants.API_FAILURE : constants.API_REQUEST_NETWORK_ERROR,
|
|
87
|
+
};
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const BaseJsStepAction = require('./baseJsStepAction');
|
|
4
|
-
const
|
|
4
|
+
const Bluebird = require('bluebird');
|
|
5
5
|
const service = require('../../agent/routers/cliJsCode/service');
|
|
6
6
|
const sessionPlayer = require('../../commons/getSessionPlayerRequire');
|
|
7
7
|
const _ = require('lodash');
|
|
@@ -9,16 +9,16 @@ const _ = require('lodash');
|
|
|
9
9
|
const constants = sessionPlayer.commonConstants.stepResult;
|
|
10
10
|
|
|
11
11
|
class BaseCliJsStepAction extends BaseJsStepAction {
|
|
12
|
-
executeCliCode() {
|
|
12
|
+
async executeCliCode() {
|
|
13
13
|
const { step, context } = this;
|
|
14
14
|
const isMobile = this.stepActionUtils.driver.isMobile;
|
|
15
15
|
const hasCliAction = _(context).get('company.activePlan.premiumFeatures.cliAction');
|
|
16
16
|
|
|
17
17
|
if (!hasCliAction && !isMobile) {
|
|
18
|
-
return
|
|
18
|
+
return {
|
|
19
19
|
success: 'skipped',
|
|
20
20
|
reason: 'CLI action is not enabled in your current plan',
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const { code, id } = step;
|
|
@@ -28,21 +28,26 @@ class BaseCliJsStepAction extends BaseJsStepAction {
|
|
|
28
28
|
data: context.data,
|
|
29
29
|
};
|
|
30
30
|
const runTimeout = context.data.timeToPlayStep;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const data = await service.runCodeWithPackages(code, id, incomingParams, contextData, testResultId, retryIndex, stepResultId, runTimeout);
|
|
32
|
+
return await this.checkCodeResponse(data);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
performAction() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
async performAction() {
|
|
36
|
+
try {
|
|
37
|
+
return await this.executeCliCode();
|
|
38
|
+
} catch (err) {
|
|
39
|
+
if (err instanceof Bluebird.TimeoutError) {
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
errorType: constants.ACTION_TIMEOUT,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
42
46
|
success: false,
|
|
43
47
|
reason: err.message,
|
|
44
48
|
exception: err,
|
|
45
|
-
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -44,7 +44,8 @@ class BaseJsStepAction extends StepAction {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
executeGetStatus(transactionId) {
|
|
47
|
-
//
|
|
47
|
+
// TODO: Cleanup after dropping IE11/Edge support
|
|
48
|
+
/* eslint-disable prefer-arrow-callback, no-undef, unicorn/prefer-includes */
|
|
48
49
|
return this.driver.executeJS(function (transactionId) {
|
|
49
50
|
const sessionItem = 'data-testim-' + transactionId;
|
|
50
51
|
try {
|
|
@@ -62,14 +63,15 @@ class BaseJsStepAction extends StepAction {
|
|
|
62
63
|
throw err;
|
|
63
64
|
}
|
|
64
65
|
}, transactionId);
|
|
66
|
+
/* eslint-enable prefer-arrow-callback, no-undef, unicorn/prefer-includes */
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
constructJSFunParams(eventData) {
|
|
68
70
|
const incomingParams = eventData.incomingParams;
|
|
69
71
|
|
|
70
72
|
const params = [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
'context', ...incomingParams.as.functionParameters,
|
|
74
|
+
'exports', 'exportsTest', 'exportsGlobal',
|
|
73
75
|
];
|
|
74
76
|
|
|
75
77
|
const args = [eventData.context, ...incomingParams.as.functionArguments];
|
|
@@ -142,7 +144,7 @@ class BaseJsStepAction extends StepAction {
|
|
|
142
144
|
const useExperimentalPreCompilation = featureFlags.flags.experimentalPreCodeCompilation.isEnabled();
|
|
143
145
|
const experimentalAsyncCustomCode = featureFlags.flags.experimentalAsyncCustomCode.isEnabled();
|
|
144
146
|
const rawParams = this.constructJSFunParams(eventMessage);
|
|
145
|
-
const hasLocateParams = rawParams.function.args.some(x => Boolean(x
|
|
147
|
+
const hasLocateParams = rawParams.function.args.some(x => Boolean(x?.locatedElement));
|
|
146
148
|
let funcToRunString = 'undefined';
|
|
147
149
|
if (useExperimentalPreCompilation) {
|
|
148
150
|
const paramNames = rawParams.function.params.slice(0, -1);
|
|
@@ -236,7 +238,7 @@ class BaseJsStepAction extends StepAction {
|
|
|
236
238
|
}
|
|
237
239
|
|
|
238
240
|
checkCodeResponse(resp) {
|
|
239
|
-
return resp
|
|
241
|
+
return resp?.success ? this.codeExecDone(resp) : this.codeExecFailed(resp);
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
performAction() {
|
|
@@ -264,15 +266,14 @@ class BaseJsStepAction extends StepAction {
|
|
|
264
266
|
return this.driver.getBrowserAndOS()
|
|
265
267
|
.then(browserAndOS => {
|
|
266
268
|
Object.assign(eventMessage, { browser: browserAndOS.browser, browserMajor: browserAndOS.browserMajor });
|
|
267
|
-
return
|
|
269
|
+
return this.context.isPendingPromise ? undefined : this.executeInAut(eventMessage);
|
|
268
270
|
})
|
|
269
|
-
.then(() => (this.context.isPendingPromise ? Promise.resolve() : this.executeInAut(eventMessage)))
|
|
270
271
|
.then(() => this.checkStatus(eventMessage.transactionId))
|
|
271
272
|
.then(resp => this.checkCodeResponse(resp));
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
handleExecutionError(err) {
|
|
275
|
-
const canExtractError = err
|
|
276
|
+
const canExtractError = err?.seleniumStack && err.seleniumStack.type === 'JavaScriptError' &&
|
|
276
277
|
err.seleniumStack.orgStatusMessage;
|
|
277
278
|
|
|
278
279
|
if (canExtractError) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const Promise = require('bluebird');
|
|
4
3
|
const StepAction = require('./stepAction');
|
|
5
4
|
const logger = require('../../commons/logger').getLogger('drop-file-step-action');
|
|
6
5
|
const downloadFileAndFireDropEvent = require('./scripts/dropEvent');
|
|
@@ -27,8 +26,7 @@ class DropFileStepAction extends StepAction {
|
|
|
27
26
|
return downloadFileAndFireDropEvent.apply(null, arguments)
|
|
28
27
|
`;
|
|
29
28
|
|
|
30
|
-
return this.driver.executeJSWithArray(dropFileCode, [target.locatedElement, fileUrls])
|
|
31
|
-
.then(() => Promise.resolve());
|
|
29
|
+
return this.driver.executeJSWithArray(dropFileCode, [target.locatedElement, fileUrls]).then(() => {});
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
32
|
}
|
|
@@ -55,16 +55,18 @@ class InputFileStepAction extends StepAction {
|
|
|
55
55
|
const invalidStateMsg = 'invalid element state: Element is not currently interactable and may not be manipulated';
|
|
56
56
|
const mustBeVisibleMsg = 'Element must not be hidden, disabled or read-only';
|
|
57
57
|
const notReachableByKeyboard = 'is not reachable by keyboard';
|
|
58
|
+
/** @type {string} */
|
|
58
59
|
const errorMsg = err ? err.message : '';
|
|
59
60
|
// Workaround move element if element is not visible or disabled
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
if (
|
|
62
|
+
errorMsg === invalidStateMsg ||
|
|
63
|
+
errorMsg.startsWith(mustBeVisibleMsg) ||
|
|
64
|
+
errorMsg.startsWith(edgeErrorEditableMessage) ||
|
|
65
|
+
errorMsg.startsWith(edgeErrorFocusableMessage) ||
|
|
66
|
+
errorMsg.startsWith(safariErrorVisibleMessage) ||
|
|
67
|
+
errorMsg.includes(notReachableByKeyboard) ||
|
|
68
|
+
errorMsg.includes(elementNotInteractable) ||
|
|
69
|
+
errorMsg.includes(elementNotPointerOrKeyboardInteractable)
|
|
68
70
|
) {
|
|
69
71
|
await this.forceInputToBeVisible(target);
|
|
70
72
|
await this.uploadFiles(gridLocalFiles, target);
|