@testim/testim-cli 3.261.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/commons/testimServicesApi.js +10 -7
- package/executionQueue.js +9 -1
- package/npm-shrinkwrap.json +52 -52
- package/package.json +1 -1
- package/player/stepActions/RefreshStepAction.js +7 -4
- package/player/stepActions/baseJsStepAction.js +45 -46
- package/player/stepActions/dropFileStepAction.js +11 -12
- package/player/stepActions/evaluateExpressionStepAction.js +32 -33
- package/player/stepActions/extensionOnlyStepAction.js +3 -4
- package/player/stepActions/extractTextStepAction.js +8 -10
- package/player/stepActions/hoverStepAction.js +3 -3
- package/player/stepActions/locateStepAction.js +39 -34
- package/player/stepActions/mouseStepAction.js +36 -34
- package/player/stepActions/navigationStepAction.js +7 -8
- package/player/stepActions/scrollStepAction.js +22 -22
- package/player/stepActions/stepAction.js +21 -21
- package/player/stepActions/stepActionRegistrar.js +63 -58
- package/player/stepActions/submitStepAction.js +2 -3
- package/player/stepActions/textStepAction.js +14 -14
- package/player/stepActions/textValidationStepAction.js +50 -38
- package/player/stepActions/wheelStepAction.js +5 -11
- package/polyfills/Array.prototype.at.js +13 -0
- package/polyfills/index.js +1 -0
- package/processHandler.js +2 -0
- package/reports/junitReporter.js +18 -1
- package/runOptions.d.ts +4 -0
- package/runOptions.js +8 -1
- package/runner.js +7 -0
- package/runners/TestPlanRunner.js +20 -19
- package/runners/runnerUtils.js +1 -2
- package/testRunHandler.js +18 -9
- package/testRunStatus.js +209 -157
- package/utils/index.js +9 -2
- package/workers/BaseWorker.js +11 -0
- package/workers/WorkerExtension.js +117 -91
- package/workers/WorkerSelenium.js +8 -3
- package/player/stepActions/scripts/polyfills.js +0 -393
|
@@ -21,7 +21,7 @@ class HoverStepAction extends StepAction {
|
|
|
21
21
|
this.getTarget().rect;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
performAction() {
|
|
24
|
+
async performAction() {
|
|
25
25
|
const target = this.getTarget();
|
|
26
26
|
const { seleniumElement, rectWithoutFrameOffset, rect } = target;
|
|
27
27
|
|
|
@@ -49,8 +49,8 @@ class HoverStepAction extends StepAction {
|
|
|
49
49
|
clickOffset: { x: Math.floor(clickOffsetX), y: Math.floor(clickOffsetY) },
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
await this.driver.hover(seleniumElement, offsets);
|
|
53
|
+
return { success: true };
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
'use strict';
|
|
2
4
|
|
|
3
5
|
const StepAction = require('./stepAction');
|
|
@@ -14,15 +16,16 @@ const {
|
|
|
14
16
|
|
|
15
17
|
const DEFAULT_VISIBILITY_RESULT = { opacity: 1, clientRects: {} };
|
|
16
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @param {import('../webdriver')} driver
|
|
21
|
+
*/
|
|
17
22
|
function createUtils(driver) {
|
|
18
23
|
return {
|
|
19
24
|
getFrameIdByTestimFrameId() { },
|
|
20
25
|
|
|
21
|
-
setElementResultDataOnContext(target) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
target.seleniumElement = seleniumResponse.value;
|
|
25
|
-
});
|
|
26
|
+
async setElementResultDataOnContext(target) {
|
|
27
|
+
const seleniumResponse = await driver.getElement(target.locatedElement);
|
|
28
|
+
target.seleniumElement = seleniumResponse.value;
|
|
26
29
|
},
|
|
27
30
|
|
|
28
31
|
getElementRectangle(target) {
|
|
@@ -76,14 +79,18 @@ function createUtils(driver) {
|
|
|
76
79
|
},
|
|
77
80
|
|
|
78
81
|
/** @type {typeof import('clickim/src/background/stepActions/locateStepAction').LocateStepAction['isVisible']} */
|
|
79
|
-
isVisible(target, targetElement, rect, locateStep, frameHandler, allOffsets, dom) {
|
|
80
|
-
const skipVisibilityCheck =
|
|
81
|
-
featureFlags.flags.disableEdgeVisibilityChecks.isEnabled() && driver.isEdge();
|
|
82
|
+
async isVisible(target, targetElement, rect, locateStep, frameHandler, allOffsets, dom) {
|
|
83
|
+
const skipVisibilityCheck = featureFlags.flags.disableEdgeVisibilityChecks.isEnabled() && driver.isEdge();
|
|
82
84
|
|
|
83
85
|
if (skipVisibilityCheck) {
|
|
84
86
|
logger.info('bypassed visibility check because of feature flag');
|
|
85
87
|
target.visibilityCheckSkipped = skipVisibilityCheck;
|
|
86
|
-
|
|
88
|
+
try {
|
|
89
|
+
await driver.isVisible(target.seleniumElement);
|
|
90
|
+
} catch {
|
|
91
|
+
/* ignored */
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
const useNativeVisibilityCheck = this.shouldUseNativeVisibilityCheck(locateStep, driver, visibilityUtils, positionUtils);
|
|
@@ -91,35 +98,33 @@ function createUtils(driver) {
|
|
|
91
98
|
return driver.isVisible(target.seleniumElement);
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
const handler = res => {
|
|
95
|
-
if (!targetElement || locatorBuilderUtils.isEmptyResult(targetElement)) {
|
|
96
|
-
return Promise.resolve({ visible: false, invisibleReason: 'element not found' });
|
|
97
|
-
}
|
|
98
|
-
const middlePosition = positionUtils.calculateElementMiddlePoint(rect);
|
|
99
|
-
const points = [middlePosition, positionUtils.calculateClickPoint(locateStep.clickOffset, rect)].filter(Boolean);
|
|
100
|
-
const code = codeSnippets.getVisibilityCode.getCompoundVisibilityInfoCode(target.locatedElement, points, false, locateStep);
|
|
101
|
-
return driver.execute(`return ${code}`)
|
|
102
|
-
.catch(err => {
|
|
103
|
-
logger.error('failed to execute getVisibilityCode', { err });
|
|
104
|
-
throw err;
|
|
105
|
-
})
|
|
106
|
-
.then((response = {}) => {
|
|
107
|
-
const { value: result } = response;
|
|
108
|
-
const elementVisibilityInfo = result.elementVisibilityInfo || DEFAULT_VISIBILITY_RESULT;
|
|
109
|
-
const [middleElementFromPoint, clickElementFromPoint] = result.elementsFromPointResults || [null, null];
|
|
110
|
-
|
|
111
|
-
return visibilityUtils.checkElementVisibility(elementVisibilityInfo, locateStep, clickElementFromPoint, middleElementFromPoint, dom, targetElement);
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
|
|
115
101
|
if (!target.seleniumElement) {
|
|
116
|
-
return
|
|
102
|
+
return { visible: false, invisibleReason: 'element not found' };
|
|
117
103
|
}
|
|
118
104
|
|
|
119
105
|
// this is here for the side effects.
|
|
120
|
-
|
|
121
|
-
.
|
|
122
|
-
|
|
106
|
+
try {
|
|
107
|
+
await driver.isVisible(target.seleniumElement);
|
|
108
|
+
} catch {
|
|
109
|
+
/* ignored */
|
|
110
|
+
}
|
|
111
|
+
if (!targetElement || locatorBuilderUtils.isEmptyResult(targetElement)) {
|
|
112
|
+
return { visible: false, invisibleReason: 'element not found' };
|
|
113
|
+
}
|
|
114
|
+
const middlePosition = positionUtils.calculateElementMiddlePoint(rect);
|
|
115
|
+
const points = [middlePosition, positionUtils.calculateClickPoint(locateStep.clickOffset, rect)].filter(Boolean);
|
|
116
|
+
const code = codeSnippets.getVisibilityCode.getCompoundVisibilityInfoCode(target.locatedElement, points, false, locateStep);
|
|
117
|
+
let response;
|
|
118
|
+
try {
|
|
119
|
+
response = await driver.execute(`return ${code}`);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
logger.error('failed to execute getVisibilityCode', { err });
|
|
122
|
+
throw err;
|
|
123
|
+
}
|
|
124
|
+
const { value } = response || {};
|
|
125
|
+
const elementVisibilityInfo = value.elementVisibilityInfo || DEFAULT_VISIBILITY_RESULT;
|
|
126
|
+
const [middleElementFromPoint, clickElementFromPoint] = value.elementsFromPointResults || [null, null];
|
|
127
|
+
return visibilityUtils.checkElementVisibility(elementVisibilityInfo, locateStep, clickElementFromPoint, middleElementFromPoint, dom, targetElement);
|
|
123
128
|
},
|
|
124
129
|
|
|
125
130
|
scrollToElement(frameHandler, locatedElement) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
const StepAction = require('./stepAction');
|
|
2
4
|
const html5dndAction = require('./scripts/html5dragAction');
|
|
3
5
|
const html5dndActionV2 = require('./scripts/html5dragActionV2');
|
|
@@ -22,7 +24,7 @@ class MouseStepAction extends StepAction {
|
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
clickJs() {
|
|
27
|
+
async clickJs() {
|
|
26
28
|
const step = this.step;
|
|
27
29
|
const context = this.context;
|
|
28
30
|
const target = context.data[step.targetId || 'targetId'];
|
|
@@ -30,7 +32,7 @@ class MouseStepAction extends StepAction {
|
|
|
30
32
|
const events = step.events;
|
|
31
33
|
|
|
32
34
|
if (!events?.length) {
|
|
33
|
-
return
|
|
35
|
+
return undefined;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const eventMessage = {
|
|
@@ -55,18 +57,19 @@ class MouseStepAction extends StepAction {
|
|
|
55
57
|
// values between 0 and -1 -_-.
|
|
56
58
|
const eventParam = this.driver.isEdge() ? JSON.stringify(eventMessage) : eventMessage;
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
try {
|
|
61
|
+
const result = await this.driver.executeCodeAsync(doClickCode, timeout, eventParam);
|
|
62
|
+
if (result.value?.success) {
|
|
63
|
+
return { success: true };
|
|
64
|
+
}
|
|
65
|
+
return { success: false };
|
|
66
|
+
} catch (err) {
|
|
67
|
+
return {
|
|
66
68
|
success: false,
|
|
67
69
|
reason: err.message,
|
|
68
70
|
exception: err,
|
|
69
|
-
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
isWithinBounds(start, end, point) {
|
|
@@ -126,14 +129,14 @@ class MouseStepAction extends StepAction {
|
|
|
126
129
|
this.addOffsetToEvents(this.getEventSequenceOffset());
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
dragPathJs() {
|
|
132
|
+
async dragPathJs() {
|
|
130
133
|
const step = this.step;
|
|
131
134
|
const context = this.context;
|
|
132
135
|
const target = context.data[step.targetId || 'targetId'];
|
|
133
136
|
const timeout = context.data.timeToPlayStep + 3000;
|
|
134
137
|
|
|
135
138
|
if (!this.step.events || !this.step.events.length) {
|
|
136
|
-
return
|
|
139
|
+
return undefined;
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
this.fixAbsoluteDragEventSequence();
|
|
@@ -158,18 +161,19 @@ class MouseStepAction extends StepAction {
|
|
|
158
161
|
return doDragPath.apply(null, arguments);
|
|
159
162
|
`;
|
|
160
163
|
|
|
161
|
-
|
|
162
|
-
.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
try {
|
|
165
|
+
const result = await this.driver.executeCodeAsync(doDragPathCode, timeout, eventMessage);
|
|
166
|
+
if (result.value?.success) {
|
|
167
|
+
return { success: true };
|
|
168
|
+
}
|
|
169
|
+
return { success: false };
|
|
170
|
+
} catch (err) {
|
|
171
|
+
return {
|
|
169
172
|
success: false,
|
|
170
173
|
reason: err.message,
|
|
171
174
|
exception: err,
|
|
172
|
-
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
173
177
|
}
|
|
174
178
|
|
|
175
179
|
chooseAndRunAction() {
|
|
@@ -295,18 +299,16 @@ class MouseStepAction extends StepAction {
|
|
|
295
299
|
return this.driver.leftClick(seleniumElement, offsets);
|
|
296
300
|
}
|
|
297
301
|
|
|
298
|
-
performAction() {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
return undefined;
|
|
309
|
-
});
|
|
302
|
+
async performAction() {
|
|
303
|
+
let res = await this.chooseAndRunAction();
|
|
304
|
+
if (!res.status && res.value && res.value.keep) {
|
|
305
|
+
res = res.value;
|
|
306
|
+
}
|
|
307
|
+
if (res.keep) {
|
|
308
|
+
delete res.keep;
|
|
309
|
+
return res;
|
|
310
|
+
}
|
|
311
|
+
return undefined;
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
addDragendIfNeeded(events) {
|
|
@@ -2,28 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
const StepAction = require('./stepAction');
|
|
4
4
|
const requiredUrl = require('url');
|
|
5
|
-
const Promise = require('bluebird');
|
|
6
5
|
|
|
7
6
|
class NavigationStepAction extends StepAction {
|
|
8
|
-
updateBaseUrl(location) {
|
|
7
|
+
async updateBaseUrl(location) {
|
|
9
8
|
const orgUrl = requiredUrl.parse(location);
|
|
10
9
|
const baseLocation = requiredUrl.parse(this.context.recordedBaseUrl);
|
|
11
10
|
const newBaseLocation = requiredUrl.parse(this.context.baseUrl);
|
|
12
11
|
if (orgUrl.host === baseLocation.host && baseLocation.host !== newBaseLocation.host) {
|
|
13
12
|
orgUrl.host = newBaseLocation.host;
|
|
14
13
|
}
|
|
15
|
-
return
|
|
14
|
+
return orgUrl.href;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
performAction() {
|
|
17
|
+
async performAction() {
|
|
19
18
|
const url = this.context.data.testimNavigationStepDestination || this.context.data.url;
|
|
20
19
|
// Opens a new tab and switches to new tab
|
|
21
20
|
if (this.step.openInNewTab) {
|
|
22
|
-
|
|
21
|
+
await this.driver.client.newWindow(url);
|
|
22
|
+
return;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.then(() => {});
|
|
24
|
+
const updatedUrl = await this.updateBaseUrl(url);
|
|
25
|
+
await this.driver.url(updatedUrl);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -21,7 +21,7 @@ class ScrollStepAction extends StepAction {
|
|
|
21
21
|
return failureMessage;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
scroll(elementToScrollTo, step, elementToScrollOn) {
|
|
24
|
+
async scroll(elementToScrollTo, step, elementToScrollOn) {
|
|
25
25
|
const expectedY = Math.round(Number(step.isScrollToElement ? step.marginTop : step.y));
|
|
26
26
|
const expectedX = Math.round(Number(step.isScrollToElement ? step.marginLeft : step.x));
|
|
27
27
|
|
|
@@ -39,8 +39,8 @@ class ScrollStepAction extends StepAction {
|
|
|
39
39
|
return scroll.apply(null, arguments)
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
.executeJSWithArray(scrollCode, [
|
|
42
|
+
try {
|
|
43
|
+
const res = await this.driver.executeJSWithArray(scrollCode, [
|
|
44
44
|
elementToScrollOn,
|
|
45
45
|
elementToScrollTo,
|
|
46
46
|
Boolean(step.isScrollToElement),
|
|
@@ -49,31 +49,31 @@ class ScrollStepAction extends StepAction {
|
|
|
49
49
|
expectedY,
|
|
50
50
|
step.shouldScrollLeft,
|
|
51
51
|
step.shouldScrollTop,
|
|
52
|
-
])
|
|
53
|
-
|
|
54
|
-
if (!res || !res.value) {
|
|
55
|
-
return {
|
|
56
|
-
errorType: constants.SCROLL_ACTION_FAILURE,
|
|
57
|
-
success: false,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const { success, actualX, actualY } = res.value;
|
|
62
|
-
|
|
63
|
-
if (success) {
|
|
64
|
-
return { success: true };
|
|
65
|
-
}
|
|
66
|
-
|
|
52
|
+
]);
|
|
53
|
+
if (!res?.value) {
|
|
67
54
|
return {
|
|
68
55
|
errorType: constants.SCROLL_ACTION_FAILURE,
|
|
69
56
|
success: false,
|
|
70
|
-
resultInfo: { error: this.getFailureString(step, expectedX, expectedY, actualX, actualY) },
|
|
71
57
|
};
|
|
72
|
-
}
|
|
73
|
-
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { success, actualX, actualY } = res.value;
|
|
61
|
+
|
|
62
|
+
if (success) {
|
|
63
|
+
return { success: true };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
errorType: constants.SCROLL_ACTION_FAILURE,
|
|
68
|
+
success: false,
|
|
69
|
+
resultInfo: { error: this.getFailureString(step, expectedX, expectedY, actualX, actualY) },
|
|
70
|
+
};
|
|
71
|
+
} catch (error) {
|
|
72
|
+
return {
|
|
74
73
|
errorType: constants.SCROLL_ACTION_FAILURE,
|
|
75
74
|
success: false,
|
|
76
|
-
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
scrollOnDocument(step, elementToScrollTo) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { commonConstants } = require('../../commons/getSessionPlayerRequire');
|
|
4
|
-
const Promise = require('bluebird');
|
|
5
4
|
|
|
6
5
|
/** @typedef {typeof import('clickim/src/background/stepActions/stepAction').StepAction} ClickimStepActionCtor */
|
|
7
6
|
/** @typedef {ConstructorParameters<ClickimStepActionCtor>} ClickimStepActionCtorParams */
|
|
@@ -33,7 +32,7 @@ class StepAction {
|
|
|
33
32
|
return this.stepActionUtils.driver;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
performAction() {
|
|
35
|
+
async performAction() {
|
|
37
36
|
throw new Error('not implemented');
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -43,25 +42,26 @@ class StepAction {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
/** @type {ClickimStepAction['execute']} */
|
|
46
|
-
execute(stepActionFactory, step) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}
|
|
45
|
+
async execute(stepActionFactory, step) {
|
|
46
|
+
try {
|
|
47
|
+
const res = await this.performAction(stepActionFactory, step);
|
|
48
|
+
return { success: true, ...res };
|
|
49
|
+
} catch (err) {
|
|
50
|
+
const errorMsg = err?.message || err?.seleniumStack?.message;
|
|
51
|
+
const displayMsg = err?.displayMessage;
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
reason: errorMsg,
|
|
55
|
+
exception: err,
|
|
56
|
+
errorType: commonConstants.stepResult.ACTION_EXCEPTION,
|
|
57
|
+
resultInfo: {
|
|
58
|
+
exception: `selenium exception: ${errorMsg}`,
|
|
59
|
+
// clickim -> playbackStepResultHandler.js -> FAILURE_REASON_MAPPING -> ACTION_EXCEPTION
|
|
60
|
+
// expects resultInfo.error or resultInfo.reason
|
|
61
|
+
error: displayMsg || errorMsg,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
'use strict';
|
|
2
4
|
|
|
3
5
|
const LocateStepAction = require('./locateStepAction');
|
|
@@ -22,7 +24,6 @@ const ApiStepAction = require('./apiStepAction');
|
|
|
22
24
|
const ExtractTextStepAction = require('./extractTextStepAction');
|
|
23
25
|
const TdkHybridStepAction = require('./tdkHybridStepAction');
|
|
24
26
|
const PixelValidationStepAction = require('./pixelValidationStepAction');
|
|
25
|
-
|
|
26
27
|
const CliJsStepAction = require('./cliJsStepAction');
|
|
27
28
|
const CliConditionStepAction = require('./cliConditionStepAction');
|
|
28
29
|
const NodePackageStepAction = require('./nodePackageStepAction');
|
|
@@ -36,69 +37,73 @@ function register(stepActionByType, stepActionFactory) {
|
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
'wait-for-simple-ui-verification': PixelValidationStepAction,
|
|
40
|
+
const STEP_ACTION_MAPPING = {
|
|
41
|
+
locate: LocateStepAction,
|
|
42
|
+
scroll: ScrollStepAction,
|
|
43
|
+
mouse: MouseStepAction,
|
|
44
|
+
submit: SubmitStepAction,
|
|
45
|
+
text: TextStepAction,
|
|
46
|
+
'special-key': SpecialKeyStepAction,
|
|
47
|
+
'user-code': JsCodeStepAction,
|
|
48
|
+
'validation-code-step': JsCodeStepAction,
|
|
49
|
+
'wait-for-code-step': JsCodeStepAction,
|
|
50
|
+
'action-code-step': JsCodeStepAction,
|
|
51
|
+
'condition-step': JsConditionStepAction,
|
|
52
|
+
'skip-code-step': JsConditionStepAction,
|
|
53
|
+
'element-code-step': JsConditionStepAction,
|
|
54
|
+
'evaluate-expression': EvaluateExpressionStepAction,
|
|
55
|
+
'text-validation': TextValidationStepAction,
|
|
56
|
+
'wait-for-text-validation': TextValidationStepAction,
|
|
57
|
+
'select-option': SelectOptionStepAction,
|
|
58
|
+
'drop-file': DropFileStepAction,
|
|
59
|
+
'input-file': InputFileStepAction,
|
|
60
|
+
hover: HoverStepAction,
|
|
61
|
+
navigation: NavigationStepAction,
|
|
62
|
+
wheel: WheelStepAction,
|
|
63
|
+
sleep: SleepStepAction,
|
|
64
|
+
refresh: RefreshStepAction,
|
|
65
|
+
'api-validation': ApiStepAction,
|
|
66
|
+
'api-action': ApiStepAction,
|
|
67
|
+
'api-code-step': JsCodeStepAction,
|
|
68
|
+
'extract-text': ExtractTextStepAction,
|
|
69
|
+
'simple-ui-verification': PixelValidationStepAction,
|
|
70
|
+
'wait-for-simple-ui-verification': PixelValidationStepAction,
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
'cli-validation-download-file': ExtensionOnlyStepAction,
|
|
73
|
+
'cli-wait-for-download-file': ExtensionOnlyStepAction,
|
|
74
|
+
'network-validation-step': ExtensionOnlyStepAction,
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
'cli-validation-code-step': CliJsStepAction,
|
|
77
|
+
'cli-wait-for-code-step': CliJsStepAction,
|
|
78
|
+
'cli-action-code-step': CliJsStepAction,
|
|
79
|
+
'cli-api-code-step': CliJsStepAction,
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
'cli-condition-step': CliConditionStepAction,
|
|
82
|
+
'node-package': NodePackageStepAction,
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
'email-code-step': JsCodeStepAction,
|
|
85
|
+
'cli-email-code-step': CliJsStepAction,
|
|
86
|
+
'tdk-hybrid': TdkHybridStepAction,
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
'sfdc-recorded-step': SfdcRecordedStepAction,
|
|
89
|
+
'sfdc-step-login': SfdcStepAction,
|
|
90
|
+
'sfdc-step-logout': SfdcStepAction,
|
|
91
|
+
'sfdc-step-sobjectcreate': SfdcStepAction,
|
|
92
|
+
'sfdc-step-sobjectdelete': SfdcStepAction,
|
|
93
|
+
'sfdc-step-findrecord': SfdcStepAction,
|
|
94
|
+
'sfdc-step-quickaction': SfdcStepAction,
|
|
95
|
+
'sfdc-step-sobjectedit': SfdcStepAction,
|
|
96
|
+
'sfdc-step-sobjectvalidate': SfdcStepAction,
|
|
97
|
+
'sfdc-step-launchapp': SfdcStepAction,
|
|
98
|
+
'sfdc-step-closeconsoletabs': SfdcStepAction,
|
|
99
|
+
'sfdc-step-relatedlistaction': SfdcStepAction,
|
|
100
|
+
};
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* @param {import('../webdriver')} driver
|
|
104
|
+
* @param {import('clickim/src/background/stepActions/stepActionFactory').StepActionFactory} stepActionFactory
|
|
105
|
+
*/
|
|
106
|
+
module.exports = function (driver, stepActionFactory, runMode) {
|
|
102
107
|
register(STEP_ACTION_MAPPING, stepActionFactory);
|
|
103
108
|
if (stepActionFactory.registerLocateStepActionUtils) {
|
|
104
109
|
stepActionFactory.registerLocateStepActionUtils(LocateStepAction.getUtils(driver));
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
const StepAction = require('./stepAction');
|
|
4
4
|
|
|
5
5
|
class SubmitStepAction extends StepAction {
|
|
6
|
-
performAction() {
|
|
7
|
-
|
|
8
|
-
.then(() => {});
|
|
6
|
+
async performAction() {
|
|
7
|
+
await this.driver.submitForm(this.getTarget().seleniumElement);
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
|