@testim/testim-cli 3.289.0 → 3.290.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 +22390 -122
- package/cli.js.map +1 -0
- package/npm-shrinkwrap.json +1951 -203
- package/package.json +9 -5
- 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 -13
- 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,175 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const _ = require('lodash');
|
|
4
|
-
|
|
5
|
-
const COMMUNICATION_BUFFER_TIME = 1000;
|
|
6
|
-
const UI_VERIFICATION_STEPS = ['simple-ui-verification', 'wait-for-simple-ui-verification'];
|
|
7
|
-
const FULL_TIMEOUT_STEP_TYPES = [
|
|
8
|
-
...UI_VERIFICATION_STEPS,
|
|
9
|
-
'custom-validation',
|
|
10
|
-
'sfdc-recorded-step',
|
|
11
|
-
'sfdc-step-login',
|
|
12
|
-
'sfdc-step-logout',
|
|
13
|
-
'sfdc-step-sobjectcreate',
|
|
14
|
-
'sfdc-step-sobjectdelete',
|
|
15
|
-
'sfdc-step-findrecord',
|
|
16
|
-
'sfdc-step-quickaction',
|
|
17
|
-
'sfdc-step-sobjectvalidate',
|
|
18
|
-
'sfdc-step-launchapp',
|
|
19
|
-
'sfdc-step-closeconsoletabs',
|
|
20
|
-
'sfdc-step-sobjectedit',
|
|
21
|
-
'sfdc-step-relatedlistaction',
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
class PlaybackTimeoutCalculator {
|
|
25
|
-
constructor(isDebuggerConnected) {
|
|
26
|
-
this.resetStepVariables();
|
|
27
|
-
this.resetRetryVariables();
|
|
28
|
-
this.isDebuggerConnected = isDebuggerConnected;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
resetStepVariables(totalStepTime, currentRetryTimes) {
|
|
32
|
-
this.currentRetryTimes = currentRetryTimes || [];
|
|
33
|
-
this.totalStepTime = totalStepTime || 0;
|
|
34
|
-
this.totalStepTimesReport = [];
|
|
35
|
-
this.currentRetryTimesReport = {};
|
|
36
|
-
const now = Date.now();
|
|
37
|
-
this.currentRetryStart = now;
|
|
38
|
-
this.lastUpdateTime = now;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
resetRetryVariables() {
|
|
42
|
-
const now = Date.now();
|
|
43
|
-
this.currentRetryStart = now;
|
|
44
|
-
this.lastUpdateTime = now;
|
|
45
|
-
this.totalStepTimesReport.push(this.currentRetryTimesReport);
|
|
46
|
-
this.currentRetryTimesReport = {};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
initStepRun(stepPlayback) {
|
|
50
|
-
const getRetryTimeoutSuggestions = (totalStepTime) => {
|
|
51
|
-
const timeToPlayStep = this.getTotalStepTimeLeftToPlay(stepPlayback, totalStepTime);
|
|
52
|
-
const MINIMAL_RETRY_TIME = 5000;
|
|
53
|
-
if (timeToPlayStep <= MINIMAL_RETRY_TIME) {
|
|
54
|
-
return [MINIMAL_RETRY_TIME];
|
|
55
|
-
}
|
|
56
|
-
return [Math.max(MINIMAL_RETRY_TIME, timeToPlayStep / 3)];
|
|
57
|
-
};
|
|
58
|
-
stepPlayback.setStartTimestamp();
|
|
59
|
-
const totalStepTime = this.getTotalStepRunTime(stepPlayback);
|
|
60
|
-
const currentRetryTimes = FULL_TIMEOUT_STEP_TYPES.includes(stepPlayback.stepType) ? [totalStepTime] : getRetryTimeoutSuggestions(totalStepTime);
|
|
61
|
-
this.resetStepVariables(totalStepTime, currentRetryTimes);
|
|
62
|
-
stepPlayback.context.data.maxTotalStepTime = totalStepTime;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
getStepTimes() {
|
|
66
|
-
this.totalStepTimesReport.push(this.currentRetryTimesReport);
|
|
67
|
-
return _.cloneDeep(this.totalStepTimesReport);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
initRetryTime() {
|
|
71
|
-
this.resetRetryVariables();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
getTotalStepRunTime(stepPlayback) {
|
|
75
|
-
const HALF_HOUR_IN_MS = 30 * 60 * 1000;
|
|
76
|
-
let fallbackTimeout = stepPlayback.context.config.stepTimeout;
|
|
77
|
-
if (UI_VERIFICATION_STEPS.includes(stepPlayback.stepType)) {
|
|
78
|
-
fallbackTimeout = stepPlayback.context.config.applitoolsStepTimeout || HALF_HOUR_IN_MS;
|
|
79
|
-
}
|
|
80
|
-
if (stepPlayback.step.type.startsWith('sfdc-')) {
|
|
81
|
-
fallbackTimeout = stepPlayback.step.defaultTimeout;
|
|
82
|
-
}
|
|
83
|
-
return (stepPlayback.step.useStepTimeout && stepPlayback.step.stepTimeout) ? stepPlayback.step.stepTimeout : fallbackTimeout;
|
|
84
|
-
}
|
|
85
|
-
getTotalStepTimeLeftToPlay(stepPlayback, totalStepTime = this.totalStepTime) {
|
|
86
|
-
const playTimeSoFar = Date.now() - stepPlayback.startTimestamp;
|
|
87
|
-
return totalStepTime - playTimeSoFar;
|
|
88
|
-
}
|
|
89
|
-
getCurrentRetryTime(stepPlayback) {
|
|
90
|
-
return (stepPlayback.retryIndex < this.currentRetryTimes.length) ?
|
|
91
|
-
this.currentRetryTimes[stepPlayback.retryIndex] :
|
|
92
|
-
this.getTotalStepTimeLeftToPlay(stepPlayback);
|
|
93
|
-
}
|
|
94
|
-
getTotalCurrentRetryTimeLeft(stepPlayback) {
|
|
95
|
-
const totalRetryTime = Date.now() - this.currentRetryStart;
|
|
96
|
-
return this.getCurrentRetryTime(stepPlayback) - totalRetryTime + COMMUNICATION_BUFFER_TIME;
|
|
97
|
-
}
|
|
98
|
-
getTabTimeout(stepPlayback) {
|
|
99
|
-
return this.getTotalCurrentRetryTimeLeft(stepPlayback);
|
|
100
|
-
}
|
|
101
|
-
getDynamicParentTimeout(stepPlayback) {
|
|
102
|
-
return this.getTotalCurrentRetryTimeLeft(stepPlayback);
|
|
103
|
-
}
|
|
104
|
-
getFrameTimeout(stepPlayback) {
|
|
105
|
-
return this.getTotalCurrentRetryTimeLeft(stepPlayback);
|
|
106
|
-
}
|
|
107
|
-
getLocateTimeout(stepPlayback) {
|
|
108
|
-
return this.getTotalCurrentRetryTimeLeft(stepPlayback);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
calcAndroidScrollTimeout(stepPlayback) {
|
|
112
|
-
const buffer = 5000;
|
|
113
|
-
let timePerEvent = 2000; // absolute scroll - 2 seconds per event + buffer
|
|
114
|
-
|
|
115
|
-
if (stepPlayback.step.isScrollToElement) {
|
|
116
|
-
// scroll to element, 4 secs per event to account for locate flow in each event
|
|
117
|
-
timePerEvent = 4000;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return (stepPlayback.step.events.length * timePerEvent) + buffer;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
getActionTimeout(stepPlayback) {
|
|
124
|
-
if (this.isDebuggerConnected) {
|
|
125
|
-
return 6e5;
|
|
126
|
-
}
|
|
127
|
-
const SLEEP_ERROR_MARGIN_MS = 5000;
|
|
128
|
-
const actionType = stepPlayback.step.type;
|
|
129
|
-
const MIN_ACTION_PLAYBACK_TIME = 30000;
|
|
130
|
-
|
|
131
|
-
let actionTime;
|
|
132
|
-
if (actionType === 'sleep') {
|
|
133
|
-
actionTime = stepPlayback.step.durationMS + SLEEP_ERROR_MARGIN_MS;
|
|
134
|
-
} else if (actionType === 'android-scroll') {
|
|
135
|
-
actionTime = Math.max(this.calcAndroidScrollTimeout(stepPlayback), MIN_ACTION_PLAYBACK_TIME);
|
|
136
|
-
} else {
|
|
137
|
-
actionTime = Math.max(this.getTotalStepTimeLeftToPlay(stepPlayback), MIN_ACTION_PLAYBACK_TIME);
|
|
138
|
-
}
|
|
139
|
-
return actionTime;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
setStepPhaseTime(phase) {
|
|
143
|
-
const now = Date.now();
|
|
144
|
-
const totalTime = now - this.lastUpdateTime;
|
|
145
|
-
this.lastUpdateTime = now;
|
|
146
|
-
this.currentRetryTimesReport[phase] = totalTime;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
reportGetTabTime() {
|
|
150
|
-
this.setStepPhaseTime('tab');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
reportGetFrameTime() {
|
|
154
|
-
this.setStepPhaseTime('frame');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
reportCalcConditionTime() {
|
|
158
|
-
this.setStepPhaseTime('condition');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
reportPreLocateActionsTime() {
|
|
162
|
-
this.setStepPhaseTime('pre-locate');
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
reportFindElementsTime() {
|
|
166
|
-
this.setStepPhaseTime('locate');
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
reportStepActionTime() {
|
|
170
|
-
this.setStepPhaseTime('action');
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
module.exports = PlaybackTimeoutCalculator;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Legacy code not supported in selenium mode
|
|
4
|
-
class PortSelector {
|
|
5
|
-
// eslint-disable-next-line no-useless-constructor, no-empty-function
|
|
6
|
-
constructor() { }
|
|
7
|
-
select() {
|
|
8
|
-
// eslint-disable-next-line no-console
|
|
9
|
-
console.log('\n\t\t\tinternal error - cant use port selector in selenium!!!!\n');
|
|
10
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
|
11
|
-
return Promise.reject({ reason: 'cant use port selector in selenium!' });
|
|
12
|
-
}
|
|
13
|
-
prepare() {}
|
|
14
|
-
handleLegacyDataCaching() {}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = new PortSelector();
|
|
18
|
-
|
|
19
|
-
|