@testim/testim-cli 3.288.0 → 3.290.0-beta
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 +22390 -122
- package/cli.js.map +1 -0
- package/npm-shrinkwrap.json +8 -29129
- package/package.json +16 -10
- package/OverrideTestDataBuilder.js +0 -117
- package/agent/routers/cliJsCode/index.js +0 -13
- package/agent/routers/cliJsCode/router.js +0 -63
- package/agent/routers/cliJsCode/service.js +0 -705
- package/agent/routers/codim/router.js +0 -69
- package/agent/routers/codim/router.test.js +0 -60
- package/agent/routers/codim/service.js +0 -193
- package/agent/routers/general/index.js +0 -36
- package/agent/routers/hybrid/registerRoutes.js +0 -81
- package/agent/routers/index.js +0 -56
- package/agent/routers/playground/router.js +0 -77
- package/agent/routers/playground/service.js +0 -96
- package/agent/routers/standalone-browser/registerRoutes.js +0 -47
- package/agent/server.js +0 -150
- package/cdpTestRunner.js +0 -86
- package/chromiumInstaller.js +0 -91
- package/cli/isCiRun.js +0 -10
- package/cli/onExit.js +0 -65
- package/cli/writeStackTrace.js +0 -27
- package/cliAgentMode.js +0 -384
- package/codim/codim-cli.js +0 -91
- package/codim/codim-npm-package/index.ts +0 -427
- package/codim/codim-npm-package/package-lock.json +0 -14
- package/codim/codim-npm-package/package.json +0 -14
- package/codim/hybrid-utils.js +0 -28
- package/codim/measure-perf.js +0 -41
- package/codim/template.js/.idea/workspace.xml +0 -57
- package/codim/template.js/.vscode/launch.json +0 -53
- package/codim/template.ts/.idea/workspace.xml +0 -57
- package/codim/template.ts/.vscode/launch.json +0 -55
- package/commons/AbortError.js +0 -12
- package/commons/SeleniumPerfStats.js +0 -58
- package/commons/chrome-launcher.js +0 -15
- package/commons/chromedriverWrapper.js +0 -70
- package/commons/config.js +0 -39
- package/commons/constants.js +0 -67
- package/commons/detectDebugger.js +0 -19
- package/commons/featureAvailabilityService.js +0 -26
- package/commons/featureFlags.js +0 -132
- package/commons/getSessionPlayerRequire.js +0 -28
- package/commons/httpRequest.js +0 -261
- package/commons/httpRequestCounters.js +0 -98
- package/commons/httpRequestCounters.test.js +0 -38
- package/commons/initializeUserWithAuth.js +0 -55
- package/commons/lazyRequire.js +0 -105
- package/commons/logUtils.js +0 -15
- package/commons/logUtils.test.js +0 -21
- package/commons/logger.js +0 -178
- package/commons/mockNetworkRuleFileSchema.json +0 -140
- package/commons/npmWrapper.js +0 -174
- package/commons/npmWrapper.test.js +0 -374
- package/commons/performance-logger.js +0 -71
- package/commons/preloadTests.js +0 -29
- package/commons/prepareRunner.js +0 -85
- package/commons/prepareRunner.test.js +0 -144
- package/commons/prepareRunnerAndTestimStartUtils.js +0 -198
- package/commons/prepareRunnerAndTestimStartUtils.test.js +0 -73
- package/commons/requireWithFallback.js +0 -25
- package/commons/runnerFileCache.js +0 -204
- package/commons/socket/baseSocketServiceSocketIO.js +0 -197
- package/commons/socket/realDataService.js +0 -59
- package/commons/socket/realDataServiceSocketIO.js +0 -33
- package/commons/socket/remoteStepService.js +0 -55
- package/commons/socket/remoteStepServiceSocketIO.js +0 -61
- package/commons/socket/socketService.js +0 -175
- package/commons/socket/testResultService.js +0 -62
- package/commons/socket/testResultServiceSocketIO.js +0 -64
- package/commons/testimAnalytics.js +0 -40
- package/commons/testimCloudflare.js +0 -83
- package/commons/testimCloudflare.test.js +0 -185
- package/commons/testimCustomToken.js +0 -124
- package/commons/testimDesiredCapabilitiesBuilder.js +0 -647
- package/commons/testimNgrok.js +0 -90
- package/commons/testimNgrok.test.js +0 -140
- package/commons/testimServicesApi.js +0 -631
- package/commons/testimTunnel.js +0 -73
- package/commons/testimTunnel.test.js +0 -172
- package/commons/xhr2.js +0 -897
- package/coverage/SummaryToObjectReport.js +0 -19
- package/coverage/jsCoverage.js +0 -252
- package/credentialsManager.js +0 -142
- package/errors.js +0 -161
- package/executionQueue.js +0 -37
- package/fixLocalBuild.js +0 -24
- package/inputFileUtils.js +0 -103
- package/lib/coralogix-winston.transport.js +0 -99
- package/player/SeleniumProtocolError.js +0 -100
- package/player/WebDriverHttpRequest.js +0 -177
- package/player/WebdriverioWebDriverApi.js +0 -671
- package/player/appiumTestPlayer.js +0 -90
- package/player/chromeLauncherTestPlayer.js +0 -67
- package/player/constants.js +0 -332
- package/player/extensionTestPlayer.js +0 -32
- package/player/findElementStrategy.js +0 -154
- package/player/scripts/isElementDisplayed.js +0 -252
- package/player/seleniumTestPlayer.js +0 -140
- package/player/services/frameLocator.js +0 -170
- package/player/services/mobileFrameLocatorMock.js +0 -32
- package/player/services/playbackTimeoutCalculator.js +0 -175
- package/player/services/portSelector.js +0 -19
- package/player/services/tabService.js +0 -551
- package/player/services/tabServiceMock.js +0 -167
- package/player/services/windowCreationListener.js +0 -8
- package/player/stepActions/RefreshStepAction.js +0 -16
- package/player/stepActions/apiStepAction.js +0 -89
- package/player/stepActions/baseCliJsStepAction.js +0 -51
- package/player/stepActions/baseJsStepAction.js +0 -277
- package/player/stepActions/cliConditionStepAction.js +0 -11
- package/player/stepActions/cliJsStepAction.js +0 -11
- package/player/stepActions/dropFileStepAction.js +0 -34
- package/player/stepActions/evaluateExpressionStepAction.js +0 -52
- package/player/stepActions/extensionOnlyStepAction.js +0 -12
- package/player/stepActions/extractTextStepAction.js +0 -19
- package/player/stepActions/hoverStepAction.js +0 -55
- package/player/stepActions/inputFileStepAction.js +0 -199
- package/player/stepActions/jsCodeStepAction.js +0 -11
- package/player/stepActions/jsConditionStepAction.js +0 -11
- package/player/stepActions/locateStepAction.js +0 -159
- package/player/stepActions/mouseStepAction.js +0 -370
- package/player/stepActions/navigationStepAction.js +0 -29
- package/player/stepActions/nodePackageStepAction.js +0 -47
- package/player/stepActions/pixelValidationStepAction.js +0 -39
- package/player/stepActions/scripts/dispatchEvents.js +0 -282
- package/player/stepActions/scripts/doClick.js +0 -221
- package/player/stepActions/scripts/doDragPath.js +0 -225
- package/player/stepActions/scripts/doubleClick.js +0 -119
- package/player/stepActions/scripts/dropEvent.js +0 -63
- package/player/stepActions/scripts/focusElement.js +0 -46
- package/player/stepActions/scripts/html5dragAction.js +0 -56
- package/player/stepActions/scripts/html5dragActionV2.js +0 -312
- package/player/stepActions/scripts/runCode.js +0 -147
- package/player/stepActions/scripts/scroll.js +0 -90
- package/player/stepActions/scripts/selectOption.js +0 -51
- package/player/stepActions/scripts/setText.js +0 -415
- package/player/stepActions/scripts/wheel.js +0 -61
- package/player/stepActions/scrollStepAction.js +0 -96
- package/player/stepActions/selectOptionStepAction.js +0 -49
- package/player/stepActions/sfdcRecordedStepAction.js +0 -24
- package/player/stepActions/sfdcStepAction.js +0 -28
- package/player/stepActions/sleepStepAction.js +0 -12
- package/player/stepActions/specialKeyStepAction.js +0 -52
- package/player/stepActions/stepAction.js +0 -73
- package/player/stepActions/stepActionRegistrar.js +0 -111
- package/player/stepActions/submitStepAction.js +0 -12
- package/player/stepActions/tdkHybridStepAction.js +0 -18
- package/player/stepActions/textStepAction.js +0 -110
- package/player/stepActions/textValidationStepAction.js +0 -64
- package/player/stepActions/wheelStepAction.js +0 -41
- package/player/utils/cookieUtils.js +0 -39
- package/player/utils/eyeSdkService.js +0 -250
- package/player/utils/imageCaptureUtils.js +0 -267
- package/player/utils/screenshotUtils.js +0 -68
- package/player/utils/stepActionUtils.js +0 -90
- package/player/utils/windowUtils.js +0 -195
- package/player/webDriverUtils.js +0 -40
- package/player/webDriverUtils.test.js +0 -116
- package/player/webdriver.js +0 -976
- package/polyfills/Array.prototype.at.js +0 -13
- package/polyfills/index.js +0 -9
- package/processHandler.js +0 -79
- package/processHandler.test.js +0 -55
- package/reports/chromeReporter.js +0 -17
- package/reports/consoleReporter.js +0 -190
- package/reports/debugReporter.js +0 -82
- package/reports/jsonReporter.js +0 -55
- package/reports/junitReporter.js +0 -183
- package/reports/reporter.js +0 -166
- package/reports/reporterUtils.js +0 -54
- package/reports/teamCityReporter.js +0 -73
- package/runOptions.d.ts +0 -305
- package/runOptions.js +0 -1288
- package/runOptionsAgentFlow.js +0 -87
- package/runOptionsUtils.js +0 -60
- package/runner.js +0 -355
- package/runners/ParallelWorkerManager.js +0 -284
- package/runners/TestPlanRunner.js +0 -419
- package/runners/buildCodeTests.js +0 -159
- package/runners/runnerUtils.js +0 -81
- package/services/analyticsService.js +0 -96
- package/services/branchService.js +0 -29
- package/services/gridService.js +0 -357
- package/services/gridService.test.js +0 -357
- package/services/labFeaturesService.js +0 -64
- package/services/lambdatestService.js +0 -227
- package/services/lambdatestService.test.js +0 -353
- package/services/localRCASaver.js +0 -124
- package/stepPlayers/cliJsStepPlayback.js +0 -40
- package/stepPlayers/hybridStepPlayback.js +0 -140
- package/stepPlayers/nodePackageStepPlayback.js +0 -28
- package/stepPlayers/playwrightHybridStepPlayback.js +0 -61
- package/stepPlayers/puppeteerHybridStepPlayback.js +0 -76
- package/stepPlayers/remoteStepPlayback.js +0 -80
- package/stepPlayers/seleniumHybridStepPlayback.js +0 -84
- package/stepPlayers/tdkHybridStepPlayback.js +0 -112
- package/testRunHandler.js +0 -603
- package/testRunStatus.js +0 -567
- package/testimNpmDriver.js +0 -52
- package/utils/argsUtils.js +0 -91
- package/utils/argsUtils.test.js +0 -32
- package/utils/fsUtils.js +0 -174
- package/utils/index.js +0 -197
- package/utils/promiseUtils.js +0 -85
- package/utils/stringUtils.js +0 -98
- package/utils/stringUtils.test.js +0 -22
- package/utils/timeUtils.js +0 -25
- package/utils/utils.test.js +0 -27
- package/workers/BaseWorker.js +0 -498
- package/workers/BaseWorker.test.js +0 -186
- package/workers/WorkerAppium.js +0 -180
- package/workers/WorkerExtension.js +0 -192
- package/workers/WorkerExtensionSingleBrowser.js +0 -77
- package/workers/WorkerSelenium.js +0 -253
- package/workers/workerUtils.js +0 -20
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RunManager">
|
|
4
|
-
<configuration default="true" type="js.build_tools.npm">
|
|
5
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
6
|
-
<command value="run" />
|
|
7
|
-
<scripts>
|
|
8
|
-
<script value="debug-examples" />
|
|
9
|
-
</scripts>
|
|
10
|
-
<node-interpreter value="project" />
|
|
11
|
-
<envs />
|
|
12
|
-
<method v="2" />
|
|
13
|
-
</configuration>
|
|
14
|
-
<configuration name="run examples" type="js.build_tools.npm" nameIsGenerated="true">
|
|
15
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
16
|
-
<command value="run" />
|
|
17
|
-
<scripts>
|
|
18
|
-
<script value="debug-examples" />
|
|
19
|
-
</scripts>
|
|
20
|
-
<node-interpreter value="project" />
|
|
21
|
-
<envs />
|
|
22
|
-
<method v="2" />
|
|
23
|
-
</configuration>
|
|
24
|
-
<configuration name="run tests" type="js.build_tools.npm" nameIsGenerated="true">
|
|
25
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
26
|
-
<command value="run" />
|
|
27
|
-
<scripts>
|
|
28
|
-
<script value="debug" />
|
|
29
|
-
</scripts>
|
|
30
|
-
<node-interpreter value="project" />
|
|
31
|
-
<envs />
|
|
32
|
-
<method v="2" />
|
|
33
|
-
</configuration>
|
|
34
|
-
<configuration name="run open file" type="js.build_tools.npm" nameIsGenerated="true">
|
|
35
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
36
|
-
<command value="run" />
|
|
37
|
-
<scripts>
|
|
38
|
-
<script value="debug-file" />
|
|
39
|
-
</scripts>
|
|
40
|
-
<arguments value="$FilePath$" />
|
|
41
|
-
<node-interpreter value="project" />
|
|
42
|
-
<envs />
|
|
43
|
-
<method v="2" />
|
|
44
|
-
</configuration>
|
|
45
|
-
<configuration name="run headless" type="js.build_tools.npm" nameIsGenerated="true">
|
|
46
|
-
<package-json value="$PROJECT_DIR$/package.json" />
|
|
47
|
-
<command value="run" />
|
|
48
|
-
<scripts>
|
|
49
|
-
<script value="headless" />
|
|
50
|
-
</scripts>
|
|
51
|
-
<node-interpreter value="project" />
|
|
52
|
-
<envs />
|
|
53
|
-
<method v="2" />
|
|
54
|
-
</configuration>
|
|
55
|
-
|
|
56
|
-
</component>
|
|
57
|
-
</project>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "Run Examples",
|
|
11
|
-
"runtimeExecutable": "npm",
|
|
12
|
-
"runtimeArgs": [
|
|
13
|
-
"run-script",
|
|
14
|
-
"debug-examples"
|
|
15
|
-
],
|
|
16
|
-
"port": 9229
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"type": "node",
|
|
20
|
-
"request": "launch",
|
|
21
|
-
"name": "Run Tests",
|
|
22
|
-
"runtimeExecutable": "npm",
|
|
23
|
-
"outputCapture": "std",
|
|
24
|
-
"runtimeArgs": [
|
|
25
|
-
"run-script",
|
|
26
|
-
"debug"
|
|
27
|
-
],
|
|
28
|
-
"port": 9229
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"type": "node",
|
|
32
|
-
"request": "launch",
|
|
33
|
-
"name": "Run Open File",
|
|
34
|
-
"runtimeExecutable": "npm",
|
|
35
|
-
"outputCapture": "std",
|
|
36
|
-
"runtimeArgs": [
|
|
37
|
-
"run-script",
|
|
38
|
-
"debug-file",
|
|
39
|
-
"${file}"
|
|
40
|
-
],
|
|
41
|
-
"port": 9229
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"type": "node",
|
|
45
|
-
"request": "launch",
|
|
46
|
-
"name": "Run Headless",
|
|
47
|
-
"runtimeExecutable": "npm",
|
|
48
|
-
"runtimeArgs": [
|
|
49
|
-
"run-script",
|
|
50
|
-
"headless"
|
|
51
|
-
],
|
|
52
|
-
"port": 9229
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
package/commons/AbortError.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const _ = require('lodash');
|
|
4
|
-
const { guid, calcPercentile } = require('../utils');
|
|
5
|
-
|
|
6
|
-
const SELENIUM_PERF_MARKS = {
|
|
7
|
-
GET_BROWSER: 'GET_BROWSER',
|
|
8
|
-
GET_HTML: 'GET_HTML',
|
|
9
|
-
GET_ELEMENT: 'GET_ELEMENT',
|
|
10
|
-
GET_SCREENSHOT: 'GET_SCREENSHOT',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
class SeleniumPerfStats {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.marks = _.mapValues(SELENIUM_PERF_MARKS, () => []);
|
|
16
|
-
this.marks.ALL = [];
|
|
17
|
-
this.startTimes = {};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
markStart(mark) {
|
|
21
|
-
const id = guid();
|
|
22
|
-
this.startTimes[`${mark}:${id}`] = Date.now();
|
|
23
|
-
return id;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
markEnd(id, mark) {
|
|
27
|
-
const markDuration = Date.now() - this.startTimes[`${mark}:${id}`];
|
|
28
|
-
delete this.startTimes[`${mark}:${id}`];
|
|
29
|
-
|
|
30
|
-
if (!this.marks[mark]) {
|
|
31
|
-
this.marks.ALL.push(markDuration);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.marks[mark].push(markDuration);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
getStats() {
|
|
38
|
-
return {
|
|
39
|
-
seleniumPerfMarks: this.marks,
|
|
40
|
-
seleniumStats: _.chain(this.marks).transform(
|
|
41
|
-
(result, samples, key) => {
|
|
42
|
-
if (_.isEmpty(samples)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
result[`${key}_COUNT`] = samples.length;
|
|
46
|
-
result[`${key}_P50`] = calcPercentile(samples, 50);
|
|
47
|
-
result[`${key}_P95`] = calcPercentile(samples, 95);
|
|
48
|
-
},
|
|
49
|
-
{}
|
|
50
|
-
).value(),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = {
|
|
56
|
-
SELENIUM_PERF_MARKS,
|
|
57
|
-
SeleniumPerfStats,
|
|
58
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { exec } = require('child_process');
|
|
4
|
-
|
|
5
|
-
module.exports.launchChrome = function (url) {
|
|
6
|
-
const { platform } = process;
|
|
7
|
-
|
|
8
|
-
if (platform === 'win32') {
|
|
9
|
-
exec(`start chrome ${url}`);
|
|
10
|
-
} else if (platform === 'darwin') {
|
|
11
|
-
exec(`open -a "Google Chrome" ${url}`);
|
|
12
|
-
} else if (platform === 'linux') {
|
|
13
|
-
exec(`google-chrome ${url}`);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
const fkill = require('fkill');
|
|
4
|
-
const pRetry = require('p-retry');
|
|
5
|
-
|
|
6
|
-
const httpRequest = require('./httpRequest');
|
|
7
|
-
const npmWrapper = require('./npmWrapper');
|
|
8
|
-
const { getCliLocation } = require('../utils');
|
|
9
|
-
const { requireWithFallback } = require('./requireWithFallback');
|
|
10
|
-
|
|
11
|
-
const PACKAGE_NAME = 'chromedriver';
|
|
12
|
-
const DRIVER_PORT = 9515;
|
|
13
|
-
const DRIVER_BASE_URL = `http://localhost:${DRIVER_PORT}/wd/hub`;
|
|
14
|
-
const DEFAULT_DRIVER_ARGS = [
|
|
15
|
-
// webdriverio expects a wd/hub (selenium-server like server endpoint)
|
|
16
|
-
'--url-base=/wd/hub',
|
|
17
|
-
// don't complain about driver version
|
|
18
|
-
'--disable-build-check',
|
|
19
|
-
// allow any ip to connect chrome driver
|
|
20
|
-
'--whitelisted-ips=0.0.0.0',
|
|
21
|
-
'--log-level=OFF', // instead we could try to log it somehow or at least have a flag to enable this
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
// [NOTE] This is a "smart installation":
|
|
25
|
-
// By default chromedriver package, when installed, will search for an existing binary in the configured temp directory.
|
|
26
|
-
// If found, and it is the correct version, it will simply copy it to your node_modules directory, and if not it will download the newer version.
|
|
27
|
-
const install = async () => {
|
|
28
|
-
await npmWrapper.installPackageLocally(getCliLocation(), `${PACKAGE_NAME} --detect_chromedriver_version`);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const start = async () => {
|
|
32
|
-
// remove --inspect before starting chromedriver
|
|
33
|
-
process.env.NODE_OPTIONS = '';
|
|
34
|
-
|
|
35
|
-
// kill any localhost running chromedriver instance
|
|
36
|
-
await fkill(`:${DRIVER_PORT}`, { silent: true });
|
|
37
|
-
|
|
38
|
-
const chromedriver = requireWithFallback(PACKAGE_NAME);
|
|
39
|
-
await chromedriver.start(DEFAULT_DRIVER_ARGS, true);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const isReady = async ({ chromeBinaryLocation }) => {
|
|
43
|
-
// 100 tries, every 30ms
|
|
44
|
-
await pRetry(async () => {
|
|
45
|
-
const statusResponse = await httpRequest.get(`${DRIVER_BASE_URL}/status`);
|
|
46
|
-
if (!statusResponse || !statusResponse.value || !statusResponse.value.ready) {
|
|
47
|
-
throw new Error('status failed');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const chromeOptions = {};
|
|
51
|
-
if (chromeBinaryLocation) {
|
|
52
|
-
chromeOptions.binary = chromeBinaryLocation;
|
|
53
|
-
}
|
|
54
|
-
const sessionResponse = await httpRequest.post({
|
|
55
|
-
url: `${DRIVER_BASE_URL}/session`,
|
|
56
|
-
body: { desiredCapabilities: { browserName: 'chrome', chromeOptions } },
|
|
57
|
-
headers: { 'Content-Type': 'application/json' },
|
|
58
|
-
});
|
|
59
|
-
if (!sessionResponse || sessionResponse.status !== 0 || !sessionResponse.sessionId) {
|
|
60
|
-
throw new Error('create session failed');
|
|
61
|
-
}
|
|
62
|
-
await httpRequest.delete(`${DRIVER_BASE_URL}/session/${sessionResponse.sessionId}`);
|
|
63
|
-
}, { retries: 100, minTimeout: 30 });
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
module.exports = {
|
|
67
|
-
install,
|
|
68
|
-
start,
|
|
69
|
-
isReady,
|
|
70
|
-
};
|
package/commons/config.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
let SERVICES_HOST = process.env.SERVICES_HOST || 'https://services.testim.io';
|
|
4
|
-
const canonicalBlobURL = 'https://testimstatic.blob.core.windows.net';
|
|
5
|
-
const canonicalEdgeUrl = 'https://tstresultfiles.azureedge.net';
|
|
6
|
-
if (process.env.GATEWAY_URL) {
|
|
7
|
-
process.env.CORALOGIX_URL = `${process.env.GATEWAY_URL}/testim/coralogix/api/v1/logs`;
|
|
8
|
-
process.env.SERVICES_HOST = `${process.env.GATEWAY_URL}/testim/services`;
|
|
9
|
-
// set the services for the extension
|
|
10
|
-
process.env.EXTENSION_SERVICES_HOST = process.env.TUNNEL_GATEWAY ? process.env.SERVICES_HOST : SERVICES_HOST;
|
|
11
|
-
SERVICES_HOST = process.env.SERVICES_HOST;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
DISABLE_AGENT_ORIGIN_CHECK: parseInt(process.env.DISABLE_AGENT_ORIGIN_CHECK || '0'),
|
|
16
|
-
DISABLE_DEBUGGER_INFINITE_TIMEOUT: parseInt(process.env.DISABLE_DEBUGGER_INFINITE_TIMEOUT || '0'),
|
|
17
|
-
OVERRIDE_TIMEOUTS: parseInt(process.env.OVERRIDE_TIMEOUTS || '0'),
|
|
18
|
-
EDITOR_URL: process.env.EDITOR_URL,
|
|
19
|
-
WEBSOCKET_HOST: process.env.WEBSOCKET_HOST || `${SERVICES_HOST}/ws`,
|
|
20
|
-
SERVICES_HOST,
|
|
21
|
-
LOGGER_CONSOLE: parseInt(process.env.LOGGER_CONSOLE || '0'),
|
|
22
|
-
LOGGER_DEBUG: parseInt(process.env.LOGGER_DEBUG || '0'),
|
|
23
|
-
WEBDRIVER_DEBUG: parseInt(process.env.WEBDRIVER_DEBUG || '0'),
|
|
24
|
-
IS_ON_PREM: parseInt(process.env.IS_ON_PREM || '0'),
|
|
25
|
-
REQUESTS_QUEUE_SIZE: process.env.REQUESTS_QUEUE_SIZE ? parseInt(process.env.REQUESTS_QUEUE_SIZE) : undefined,
|
|
26
|
-
DEBUG_MODE: parseInt(process.env.DEBUG_MODE || '0'),
|
|
27
|
-
TESTIM_CONCURRENT_WORKER_COUNT: process.env.TESTIM_CONCURRENT_WORKER_COUNT ? parseInt(process.env.TESTIM_CONCURRENT_WORKER_COUNT) : null,
|
|
28
|
-
ROLLOUT_KEY: process.env.ROLLOUT_KEY || '5b5560729601aa6484276518',
|
|
29
|
-
DF_ENABLE_VIDEO: parseInt(process.env.DF_ENABLE_VIDEO || '0'),
|
|
30
|
-
START_WORKER_DELAY_MS: parseInt(process.env.START_WORKER_DELAY_MS || 1500),
|
|
31
|
-
APPIUM_VERSION: process.env.APPIUM_VERSION || '1.10.1',
|
|
32
|
-
|
|
33
|
-
GATEWAY_URL: process.env.GATEWAY_URL,
|
|
34
|
-
EXTENSION_SERVICES_HOST: process.env.EXTENSION_SERVICES_HOST || SERVICES_HOST,
|
|
35
|
-
BLOB_URL: process.env.GATEWAY_URL ? `${process.env.GATEWAY_URL}/testim/blob` : canonicalBlobURL,
|
|
36
|
-
EDGE_URL: process.env.GATEWAY_URL ? `${process.env.GATEWAY_URL}/testim/edge` : canonicalEdgeUrl,
|
|
37
|
-
CANONICAL_BLOB_URL: canonicalBlobURL,
|
|
38
|
-
CANONICAL_EDGE_URL: canonicalEdgeUrl,
|
|
39
|
-
};
|
package/commons/constants.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
timeoutMessages: {
|
|
5
|
-
GET_BROWSER_TIMEOUT_MSG: 'get-browser-timeout',
|
|
6
|
-
TEST_START_TIMEOUT_MSG: 'test-start-timeout',
|
|
7
|
-
TEST_COMPLETE_TIMEOUT_MSG: 'test-complete-timeout',
|
|
8
|
-
},
|
|
9
|
-
testRunStatus: {
|
|
10
|
-
COMPLETED: 'completed',
|
|
11
|
-
RUNNING: 'running',
|
|
12
|
-
},
|
|
13
|
-
runnerTestStatus: {
|
|
14
|
-
PASSED: 'PASSED',
|
|
15
|
-
FAILED: 'FAILED',
|
|
16
|
-
ABORTED: 'ABORTED',
|
|
17
|
-
SKIPPED: 'SKIPPED',
|
|
18
|
-
QUEUED: 'QUEUED',
|
|
19
|
-
},
|
|
20
|
-
testStatus: {
|
|
21
|
-
DRAFT: 'draft',
|
|
22
|
-
EVALUATING: 'evaluating',
|
|
23
|
-
ACTIVE: 'active',
|
|
24
|
-
QUARANTINE: 'quarantine',
|
|
25
|
-
},
|
|
26
|
-
gridMessages: {
|
|
27
|
-
NOT_FOUND: 'The specified grid is not available',
|
|
28
|
-
UNKNOWN: "Test couldn't get browser - unknown error",
|
|
29
|
-
},
|
|
30
|
-
mobileWeb: {
|
|
31
|
-
MOBILE_WEB_REMOTE_RUN_HEADER_SPACING: 50,
|
|
32
|
-
},
|
|
33
|
-
test: {
|
|
34
|
-
HIDDEN_PARAM: 'TST_HIDDEN_PARAM',
|
|
35
|
-
},
|
|
36
|
-
socketEventTypes: {
|
|
37
|
-
TEST_RESULT_CREATED: 'test-result-created',
|
|
38
|
-
TEST_RESULT_UPDATED: 'test-result-updated',
|
|
39
|
-
REMOTE_STEP_SAVED: 'remote-step-saved',
|
|
40
|
-
},
|
|
41
|
-
CLI_MODE: {
|
|
42
|
-
EXTENSION: 'extension',
|
|
43
|
-
SELENIUM: 'selenium',
|
|
44
|
-
APPIUM: 'appium',
|
|
45
|
-
},
|
|
46
|
-
sessionType: {
|
|
47
|
-
CODELESS: 'codeless',
|
|
48
|
-
CODEFUL: 'codeful',
|
|
49
|
-
},
|
|
50
|
-
gridTypes: {
|
|
51
|
-
TESTIM_ENTERPRISE: 'testimEnterprise',
|
|
52
|
-
TESTIM: 'testim',
|
|
53
|
-
LAMBDATEST: 'testimLambdaTest',
|
|
54
|
-
DEVICE_FARM: 'testimDF',
|
|
55
|
-
HYBRID: 'testimHybrid',
|
|
56
|
-
BROWSERSTACK: 'browserstack',
|
|
57
|
-
SAUCELABS: 'saucelabs',
|
|
58
|
-
TESTIM_HEADSPIN: 'testimHeadspin',
|
|
59
|
-
},
|
|
60
|
-
stepResult: {
|
|
61
|
-
SETUP_TIMEOUT: 'setup-timeout',
|
|
62
|
-
NETWORK_ERROR: 'network-error',
|
|
63
|
-
GRID_ERROR: 'grid-error',
|
|
64
|
-
SELENIUM_ERROR: 'selenium-error',
|
|
65
|
-
BROWSER_CLOSED: 'browser-closed',
|
|
66
|
-
},
|
|
67
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { DISABLE_DEBUGGER_INFINITE_TIMEOUT } = require('./config');
|
|
4
|
-
|
|
5
|
-
module.exports.isDebuggerConnected = () => {
|
|
6
|
-
try {
|
|
7
|
-
if (DISABLE_DEBUGGER_INFINITE_TIMEOUT) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const inspector = require('inspector');
|
|
11
|
-
//https://github.com/GoogleChrome/puppeteer/blob/14fb3e38db7c97fc3ea76c65e6f219b0ddb3b54f/utils/testrunner/TestRunner.js#L279
|
|
12
|
-
if (inspector.url()) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
} catch (e) {
|
|
16
|
-
/* empty */
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { gridTypes } = require('./constants');
|
|
4
|
-
|
|
5
|
-
class FeatureAvailabilityService {
|
|
6
|
-
constructor() {
|
|
7
|
-
/**
|
|
8
|
-
* @type {'free'|'trial'|'pro'}
|
|
9
|
-
*/
|
|
10
|
-
this._planType = 'free';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
setPlanType(planType) {
|
|
14
|
-
this._planType = planType;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
get isTestStatusEnabled() {
|
|
18
|
-
return ['pro', 'trial'].includes(this._planType);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
shouldShowFreeGridRunWarning(gridType) {
|
|
22
|
-
return this._planType !== 'pro' && gridType === gridTypes.DEVICE_FARM;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = new FeatureAvailabilityService();
|
package/commons/featureFlags.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Rox = require('rox-node');
|
|
4
|
-
const { getLogger } = require('./logger');
|
|
5
|
-
const { promiseTimeout } = require('../utils');
|
|
6
|
-
const { ROLLOUT_KEY, IS_ON_PREM, GATEWAY_URL } = require('./config');
|
|
7
|
-
|
|
8
|
-
const logger = getLogger('FeatureFlagsService');
|
|
9
|
-
|
|
10
|
-
// IS_UNIT_TEST = disable rollout if code run in unit test mode to ignore mocha process stuck on running
|
|
11
|
-
const USE_FEATURE_FLAGS = !IS_ON_PREM && !process.env.IS_UNIT_TEST && !GATEWAY_URL;
|
|
12
|
-
|
|
13
|
-
const FORCE_FETCH_TIMEOUT_MS = 20000; // rollout sometimes takes up to 15 seconds to load
|
|
14
|
-
const SEC_IN_DAY = 60 * 60 * 24;
|
|
15
|
-
|
|
16
|
-
/** @type {['labs', 'disabled', 'enabled'] as const} */
|
|
17
|
-
const LAB_FEATURE_FLAG_VALUES = ['labs', 'disabled', 'enabled'];
|
|
18
|
-
|
|
19
|
-
class LabFeatureFlag extends Rox.Variant {
|
|
20
|
-
constructor(initialValue = 'disabled') {
|
|
21
|
-
super(initialValue, LAB_FEATURE_FLAG_VALUES);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** @returns {(typeof LAB_FEATURE_FLAG_VALUES)[number]} */
|
|
25
|
-
getValue() {
|
|
26
|
-
const value = super.getValue();
|
|
27
|
-
if (!LAB_FEATURE_FLAG_VALUES.includes(value)) {
|
|
28
|
-
logger.warn('unexpected value for lab feature flag. Falling back to value "labs"', { featureFlagName: this.name, value });
|
|
29
|
-
return 'labs';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
class FeatureFlagsService {
|
|
37
|
-
constructor() {
|
|
38
|
-
this.flags = {
|
|
39
|
-
useNewWSCLI: new Rox.Flag(),
|
|
40
|
-
useSafariWebdriverVisibilityChecks: new Rox.Flag(),
|
|
41
|
-
useClickimVisibilityChecks: new Rox.Flag(),
|
|
42
|
-
runGetElementCodeInAut: new Rox.Flag(),
|
|
43
|
-
enableFrameSwitchOptimization: new Rox.Flag(),
|
|
44
|
-
maximumJsResultSize: new Rox.Configuration(2000 * 1024),
|
|
45
|
-
skipFileInputClicks: new Rox.Flag(),
|
|
46
|
-
errorMessageOnBadNetwork: new Rox.Flag(true),
|
|
47
|
-
warnOnBadNetwork: new Rox.Flag(false),
|
|
48
|
-
overrideAzureStorageUrl: new Rox.Flag(),
|
|
49
|
-
useJsInputCodeInSafari: new Rox.Flag(),
|
|
50
|
-
useJsInputCodeInFirefox: new Rox.Flag(),
|
|
51
|
-
autoSaveDownloadFileFireFox: new Rox.Flag(true),
|
|
52
|
-
safariSelectOptionDispatchEventOnSelectElement: new Rox.Flag(true),
|
|
53
|
-
experimentalPreCodeCompilation: new Rox.Flag(true),
|
|
54
|
-
/** Enables using top level await inside custom actions */
|
|
55
|
-
experimentalAsyncCustomCode: new Rox.Flag(),
|
|
56
|
-
useSameBrowserForMultiTests: new LabFeatureFlag('labs'),
|
|
57
|
-
highSpeedMode: new LabFeatureFlag(),
|
|
58
|
-
usePortedHtml5DragDrop: new Rox.Flag(),
|
|
59
|
-
testNamesToBeforeSuiteHook: new Rox.Flag(),
|
|
60
|
-
addCustomCapabilities: new Rox.Variant('{}'),
|
|
61
|
-
enableWorkerThreadsCliCodeExecution: new Rox.Flag(true),
|
|
62
|
-
LTNetworkCapabilities: new Rox.Flag(),
|
|
63
|
-
downloadToBase64: new Rox.Flag(),
|
|
64
|
-
dec2022eolBrowsers: new Rox.Flag(),
|
|
65
|
-
publicGridURL: new Rox.Configuration('public-grid.testim.io'),
|
|
66
|
-
};
|
|
67
|
-
Rox.register('default', this.flags);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** @param {string} projectId */
|
|
71
|
-
setProjectId(projectId) {
|
|
72
|
-
Rox.setCustomStringProperty('projectId', projectId);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** @param {string} projectType */
|
|
76
|
-
setProjectType(projectType) {
|
|
77
|
-
Rox.setCustomStringProperty('projectType', projectType);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** @param {string} productType */
|
|
81
|
-
setCompanyProductType(productType) {
|
|
82
|
-
Rox.setCustomStringProperty('productType', productType);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** @param {string} companyId */
|
|
86
|
-
setCompanyId(companyId) {
|
|
87
|
-
Rox.setCustomStringProperty('companyId', companyId);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** @param {string} planType */
|
|
91
|
-
setPlanType(planType) {
|
|
92
|
-
Rox.setCustomStringProperty('planType', planType);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** @param {boolean} isPOC */
|
|
96
|
-
setIsPOC(isPOC) {
|
|
97
|
-
Rox.setCustomBooleanProperty('isPOC', isPOC);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** @param {boolean} isStartUp */
|
|
101
|
-
setIsStartUp(isStartUp) {
|
|
102
|
-
Rox.setCustomBooleanProperty('isStartUp', isStartUp);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** @param {string} mode */
|
|
106
|
-
setRunnerMode(mode) {
|
|
107
|
-
Rox.setCustomStringProperty('runnerMode', mode);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
async fetch() {
|
|
111
|
-
if (!USE_FEATURE_FLAGS) {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
114
|
-
/** @type {Rox.RoxSetupOptions} */
|
|
115
|
-
const opts = {
|
|
116
|
-
fetchIntervalInSec: SEC_IN_DAY, // we don't actually want to refresh feature flags in the CLI,
|
|
117
|
-
disableNetworkFetch: false,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (global.ProxyAgent) {
|
|
122
|
-
const agent = new global.ProxyAgent(global.proxyUri);
|
|
123
|
-
opts.httpsAgent = agent;
|
|
124
|
-
opts.httpAgent = agent;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return promiseTimeout(Rox.setup(ROLLOUT_KEY, opts), FORCE_FETCH_TIMEOUT_MS)
|
|
128
|
-
.catch(err => logger.error('failed to get feature flag status', err));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
module.exports = new FeatureFlagsService();
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { join, resolve } = require('path');
|
|
4
|
-
|
|
5
|
-
/** @type {{ playerPath: string | undefined }} */ module.exports.options = { playerPath: undefined };
|
|
6
|
-
|
|
7
|
-
/** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit | undefined} */ let sessionPlayerInit;
|
|
8
|
-
|
|
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
|
-
};
|