@mablhq/mabl-cli 2.8.25 → 2.12.7
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/api/mablApiClient.js +24 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +2 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +0 -3
- package/commands/environments/environments_cmds/create.js +3 -2
- package/commands/environments/environments_cmds/update.js +1 -1
- package/commands/tests/testsUtil.js +2 -0
- package/core/execution/newman-types.js +2 -1
- package/execution/index.js +9 -9
- package/execution/index.js.LICENSE.txt +60 -0
- package/execution/runAppiumServer.js +16 -4
- package/index.d.ts +2 -0
- package/mablApi/index.js +1 -1
- package/mablscript/importer.js +6 -0
- package/mablscript/mobile/steps/EnterTextStep.js +3 -0
- package/mablscript/mobile/steps/InstallAppStep.js +22 -0
- package/mablscript/mobile/steps/PrepareSessionStep.js +19 -0
- package/mablscript/mobile/steps/ScrollStep.js +52 -8
- package/mablscript/mobile/steps/UninstallAppStep.js +22 -0
- package/mablscript/mobile/steps/stepUtil.js +51 -12
- package/mablscript/mobile/tests/TestMobileFindDescriptors.js +72 -1
- package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +144 -7
- package/mablscript/mobile/tests/steps/InstallAppStep.mobiletest.js +20 -0
- package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +289 -78
- package/mablscript/mobile/tests/steps/UninstallAppStep.mobiletest.js +20 -0
- package/mablscript/steps/AwaitTabStep.js +36 -8
- package/mablscript/types/mobile/InstallAppStepDescriptor.js +2 -0
- package/mablscript/types/mobile/PrepareSessionStepDescriptor.js +2 -0
- package/mablscript/types/mobile/ScrollStepDescriptor.js +14 -0
- package/mablscript/types/mobile/UninstallAppStepDescriptor.js +2 -0
- package/mablscriptFind/index.js +1 -1
- package/package.json +2 -6
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/embeddedPdfDetection.js +22 -6
- package/socketTunnel/index.js +2 -0
- package/socketTunnel/index.js.LICENSE.txt +66 -0
- package/upload/index.js +1 -1
- package/util/downloadUtil.js +1 -1
|
@@ -1,37 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ScrollStep_1 = require("../../steps/ScrollStep");
|
|
4
|
+
const ScrollStepDescriptor_1 = require("../../../types/mobile/ScrollStepDescriptor");
|
|
4
5
|
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
6
|
+
const domUtil_1 = require("../../../../domUtil");
|
|
5
7
|
describe('Scroll steps parse correctly', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from: {
|
|
12
|
-
xPercent: 1074 / windowSize.width,
|
|
13
|
-
yPercent: 2350 / windowSize.height,
|
|
14
|
-
},
|
|
15
|
-
to: {
|
|
16
|
-
xPercent: 1074 / windowSize.width,
|
|
17
|
-
yPercent: 100 / windowSize.height,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
actionCode: 'scroll',
|
|
21
|
-
};
|
|
22
|
-
const steps = [
|
|
23
|
-
{
|
|
24
|
-
Scroll: scrollStepDescriptor,
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
28
|
-
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
29
|
-
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
30
|
-
});
|
|
31
|
-
it('Humanizes a scroll step', () => {
|
|
32
|
-
const windowSize = { width: 1440, height: 2392 };
|
|
33
|
-
const stepYaml = {
|
|
34
|
-
Scroll: {
|
|
8
|
+
describe('ScrollType.ScrollDeviceScreen', () => {
|
|
9
|
+
it('Parses a ScrollDeviceScreen step', () => {
|
|
10
|
+
const windowSize = { width: 1440, height: 2392 };
|
|
11
|
+
const scrollStepDescriptor = {
|
|
12
|
+
id: 'scrolliePolieOlie',
|
|
35
13
|
coordinates: {
|
|
36
14
|
from: {
|
|
37
15
|
xPercent: 1074 / windowSize.width,
|
|
@@ -43,79 +21,312 @@ describe('Scroll steps parse correctly', () => {
|
|
|
43
21
|
},
|
|
44
22
|
},
|
|
45
23
|
actionCode: 'scroll',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
25
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
26
|
+
};
|
|
27
|
+
const steps = [
|
|
28
|
+
{
|
|
29
|
+
Scroll: scrollStepDescriptor,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
33
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
34
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
35
|
+
});
|
|
36
|
+
it('Humanizes a ScrollDeviceScreen step', () => {
|
|
37
|
+
const windowSize = { width: 1440, height: 2392 };
|
|
38
|
+
const stepYaml = {
|
|
39
|
+
Scroll: {
|
|
40
|
+
coordinates: {
|
|
41
|
+
from: {
|
|
42
|
+
xPercent: 1074 / windowSize.width,
|
|
43
|
+
yPercent: 2350 / windowSize.height,
|
|
44
|
+
},
|
|
45
|
+
to: {
|
|
46
|
+
xPercent: 1074 / windowSize.width,
|
|
47
|
+
yPercent: 100 / windowSize.height,
|
|
48
|
+
},
|
|
58
49
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
actionCode: 'scroll',
|
|
51
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
52
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
56
|
+
expect(step.stepDescription()).toEqual(`Scroll down 94.06% of the screen`);
|
|
57
|
+
});
|
|
58
|
+
it('Humanizes scroll directions as expected', () => {
|
|
59
|
+
const scrollUpStepYaml = {
|
|
60
|
+
Scroll: {
|
|
61
|
+
coordinates: {
|
|
62
|
+
from: {
|
|
63
|
+
xPercent: 0.109212,
|
|
64
|
+
yPercent: 0.241223,
|
|
65
|
+
},
|
|
66
|
+
to: {
|
|
67
|
+
xPercent: 0.145543,
|
|
68
|
+
yPercent: 0.865454,
|
|
69
|
+
},
|
|
62
70
|
},
|
|
71
|
+
actionCode: 'scroll',
|
|
72
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
73
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
const scrollUpStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollUpStepYaml);
|
|
77
|
+
expect(scrollUpStep.stepDescription()).toEqual(`Scroll up 62.42% of the screen`);
|
|
78
|
+
const scrollDownStepYaml = {
|
|
79
|
+
Scroll: {
|
|
80
|
+
coordinates: {
|
|
81
|
+
from: {
|
|
82
|
+
xPercent: 0.48351,
|
|
83
|
+
yPercent: 0.89123,
|
|
84
|
+
},
|
|
85
|
+
to: {
|
|
86
|
+
xPercent: 0.4515,
|
|
87
|
+
yPercent: 0.0874,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
actionCode: 'scroll',
|
|
91
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
92
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
const scrollDownStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollDownStepYaml);
|
|
96
|
+
expect(scrollDownStep.stepDescription()).toEqual(`Scroll down 80.38% of the screen`);
|
|
97
|
+
const scrollLeftStepYaml = {
|
|
98
|
+
Scroll: {
|
|
99
|
+
coordinates: {
|
|
100
|
+
from: {
|
|
101
|
+
xPercent: 0.08111,
|
|
102
|
+
yPercent: 0.46123,
|
|
103
|
+
},
|
|
104
|
+
to: {
|
|
105
|
+
xPercent: 0.90295,
|
|
106
|
+
yPercent: 0.4574,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
actionCode: 'scroll',
|
|
110
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
111
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
const scrollLeftStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollLeftStepYaml);
|
|
115
|
+
expect(scrollLeftStep.stepDescription()).toEqual(`Scroll left 82.18% of the screen`);
|
|
116
|
+
const scrollRightStepYaml = {
|
|
117
|
+
Scroll: {
|
|
118
|
+
coordinates: {
|
|
119
|
+
from: {
|
|
120
|
+
xPercent: 0.88111,
|
|
121
|
+
yPercent: 0.46123,
|
|
122
|
+
},
|
|
123
|
+
to: {
|
|
124
|
+
xPercent: 0.09295,
|
|
125
|
+
yPercent: 0.4574,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
actionCode: 'scroll',
|
|
129
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
130
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
const scrollRightStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollRightStepYaml);
|
|
134
|
+
expect(scrollRightStep.stepDescription()).toEqual(`Scroll right 78.82% of the screen`);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe('ScrollType.ScrollToElement', () => {
|
|
138
|
+
const find = {
|
|
139
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
140
|
+
findTarget: {
|
|
141
|
+
selector: {
|
|
142
|
+
iOS: {
|
|
143
|
+
name: 'Name field',
|
|
144
|
+
},
|
|
145
|
+
uuid: '',
|
|
63
146
|
},
|
|
64
|
-
actionCode: 'scroll',
|
|
65
147
|
},
|
|
66
148
|
};
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
xPercent: 0.48351,
|
|
74
|
-
yPercent: 0.89123,
|
|
75
|
-
},
|
|
76
|
-
to: {
|
|
77
|
-
xPercent: 0.4515,
|
|
78
|
-
yPercent: 0.0874,
|
|
149
|
+
const innerFindTarget = {
|
|
150
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
151
|
+
findTarget: {
|
|
152
|
+
selector: {
|
|
153
|
+
iOS: {
|
|
154
|
+
name: 'Email field',
|
|
79
155
|
},
|
|
156
|
+
uuid: '',
|
|
80
157
|
},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
it('Parses a ScrollToElement step', () => {
|
|
161
|
+
const scrollStepDescriptor = {
|
|
162
|
+
id: 'scrollMe',
|
|
163
|
+
actionCode: 'scroll',
|
|
164
|
+
find,
|
|
165
|
+
maxScrollAttempts: 6,
|
|
166
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
167
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
168
|
+
targetElementDescriptor: innerFindTarget,
|
|
169
|
+
};
|
|
170
|
+
const steps = [
|
|
171
|
+
{
|
|
172
|
+
Scroll: scrollStepDescriptor,
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
176
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
177
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
178
|
+
});
|
|
179
|
+
it('Humanizes a ScrollToElement step', () => {
|
|
180
|
+
const scrollStepDescriptor = {
|
|
181
|
+
id: 'scrollMe',
|
|
81
182
|
actionCode: 'scroll',
|
|
183
|
+
find,
|
|
184
|
+
maxScrollAttempts: 6,
|
|
185
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
186
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
|
|
187
|
+
targetElementDescriptor: innerFindTarget,
|
|
188
|
+
};
|
|
189
|
+
const stepYaml = {
|
|
190
|
+
Scroll: scrollStepDescriptor,
|
|
191
|
+
};
|
|
192
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
193
|
+
expect(step.stepDescription()).toEqual(`Scroll right a maximum of 6 times within the "Name field" element until the "Email field" element is visible`);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
describe('ScrollType.ScrollWithinElement', () => {
|
|
197
|
+
const find = {
|
|
198
|
+
findType: domUtil_1.FindType.FIND_ONE,
|
|
199
|
+
findTarget: {
|
|
200
|
+
selector: {
|
|
201
|
+
iOS: {
|
|
202
|
+
name: 'Name field',
|
|
203
|
+
},
|
|
204
|
+
uuid: '',
|
|
205
|
+
},
|
|
82
206
|
},
|
|
83
207
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
208
|
+
it('Parses a ScrollWithinElement step', () => {
|
|
209
|
+
const scrollStepDescriptor = {
|
|
210
|
+
id: 'scrollMe',
|
|
211
|
+
actionCode: 'scroll',
|
|
88
212
|
coordinates: {
|
|
89
213
|
from: {
|
|
90
|
-
xPercent: 0.
|
|
91
|
-
yPercent: 0.
|
|
214
|
+
xPercent: 0.9,
|
|
215
|
+
yPercent: 0.6,
|
|
92
216
|
},
|
|
93
217
|
to: {
|
|
94
|
-
xPercent: 0.
|
|
95
|
-
yPercent: 0.
|
|
218
|
+
xPercent: 0.1,
|
|
219
|
+
yPercent: 0.5,
|
|
96
220
|
},
|
|
97
221
|
},
|
|
222
|
+
find,
|
|
223
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
224
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
|
|
225
|
+
};
|
|
226
|
+
const steps = [
|
|
227
|
+
{
|
|
228
|
+
Scroll: scrollStepDescriptor,
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
|
|
232
|
+
const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
|
|
233
|
+
expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
|
|
234
|
+
});
|
|
235
|
+
it('Humanizes a ScrollWithinElement step', () => {
|
|
236
|
+
const scrollStepDescriptor = {
|
|
237
|
+
id: 'scrollMe',
|
|
98
238
|
actionCode: 'scroll',
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const swipeRightStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(swipeRightStepYaml);
|
|
102
|
-
expect(swipeRightStep.stepDescription()).toEqual(`Swipe right 82.18% of the screen`);
|
|
103
|
-
const swipeLeftStepYaml = {
|
|
104
|
-
Scroll: {
|
|
105
239
|
coordinates: {
|
|
106
240
|
from: {
|
|
107
|
-
xPercent: 0.
|
|
108
|
-
yPercent: 0.
|
|
241
|
+
xPercent: 0.9,
|
|
242
|
+
yPercent: 0.6,
|
|
109
243
|
},
|
|
110
244
|
to: {
|
|
111
|
-
xPercent: 0.
|
|
112
|
-
yPercent: 0.
|
|
245
|
+
xPercent: 0.1,
|
|
246
|
+
yPercent: 0.5,
|
|
113
247
|
},
|
|
114
248
|
},
|
|
115
|
-
|
|
249
|
+
find,
|
|
250
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
251
|
+
scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
|
|
252
|
+
};
|
|
253
|
+
const stepYaml = {
|
|
254
|
+
Scroll: scrollStepDescriptor,
|
|
255
|
+
};
|
|
256
|
+
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
257
|
+
expect(step.stepDescription()).toEqual(`Scroll right 80% within the "Name field" element`);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
describe('getScrollDirectionAndPercentageFromCoordinates', () => {
|
|
262
|
+
it('returned default down 80% if no coordinates supplied', () => {
|
|
263
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(undefined)).toEqual({
|
|
264
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
265
|
+
scrollPercent: '80%',
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
it('determines correct down direction and percentage', () => {
|
|
269
|
+
const scrollCoordinates = {
|
|
270
|
+
from: {
|
|
271
|
+
xPercent: 0.3,
|
|
272
|
+
yPercent: 0.75,
|
|
273
|
+
},
|
|
274
|
+
to: {
|
|
275
|
+
xPercent: 0.5,
|
|
276
|
+
yPercent: 0.25,
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
280
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
|
|
281
|
+
scrollPercent: '50%',
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
it('determines correct up direction and percentage', () => {
|
|
285
|
+
const scrollCoordinates = {
|
|
286
|
+
from: {
|
|
287
|
+
xPercent: 0.7,
|
|
288
|
+
yPercent: 0,
|
|
289
|
+
},
|
|
290
|
+
to: {
|
|
291
|
+
xPercent: 0.4,
|
|
292
|
+
yPercent: 1,
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
296
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
|
|
297
|
+
scrollPercent: '100%',
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
it('determines correct right direction and percentage', () => {
|
|
301
|
+
const scrollCoordinates = {
|
|
302
|
+
from: {
|
|
303
|
+
xPercent: 0.95,
|
|
304
|
+
yPercent: 0.4,
|
|
305
|
+
},
|
|
306
|
+
to: {
|
|
307
|
+
xPercent: 0.12,
|
|
308
|
+
yPercent: 0.5,
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
312
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
|
|
313
|
+
scrollPercent: '83%',
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
it('determines correct left direction and percentage', () => {
|
|
317
|
+
const scrollCoordinates = {
|
|
318
|
+
from: {
|
|
319
|
+
xPercent: 0.04,
|
|
320
|
+
yPercent: 0.7,
|
|
321
|
+
},
|
|
322
|
+
to: {
|
|
323
|
+
xPercent: 0.82,
|
|
324
|
+
yPercent: 0.4,
|
|
116
325
|
},
|
|
117
326
|
};
|
|
118
|
-
|
|
119
|
-
|
|
327
|
+
expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
|
|
328
|
+
scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
|
|
329
|
+
scrollPercent: '78%',
|
|
330
|
+
});
|
|
120
331
|
});
|
|
121
332
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const UninstallAppStep_1 = require("../../steps/UninstallAppStep");
|
|
4
|
+
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
5
|
+
describe('Uninstall App steps parse correctly', () => {
|
|
6
|
+
it('Parses an UninstallApp step', () => {
|
|
7
|
+
const stepDescriptor = {
|
|
8
|
+
id: 'noAppForYou',
|
|
9
|
+
actionCode: 'uninstallApp',
|
|
10
|
+
};
|
|
11
|
+
const steps = [
|
|
12
|
+
{
|
|
13
|
+
UninstallApp: stepDescriptor,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, UninstallAppStep_1.UninstallAppStep.stepName, stepDescriptor);
|
|
17
|
+
const tapStep = new UninstallAppStep_1.UninstallAppStep(stepDescriptor);
|
|
18
|
+
expect(tapStep.stepId()).toEqual(stepDescriptor.id);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AwaitTabStep = void 0;
|
|
3
|
+
exports.hasCustomFindOptions = exports.AwaitTabStep = void 0;
|
|
4
4
|
const domUtil_1 = require("../../domUtil");
|
|
5
5
|
const MablStep_1 = require("../MablStep");
|
|
6
6
|
class AwaitTabStep extends MablStep_1.MablStep {
|
|
@@ -23,19 +23,47 @@ class AwaitTabStep extends MablStep_1.MablStep {
|
|
|
23
23
|
return step;
|
|
24
24
|
}
|
|
25
25
|
toMablscript() {
|
|
26
|
+
return `await_tab(${AwaitTabStep.getMablscriptSelectorFromTabFindAction(this.tab)})`;
|
|
27
|
+
}
|
|
28
|
+
static hasCustomFindOptions(tab) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return Object.keys((_b = (_a = tab.configuration) === null || _a === void 0 ? void 0 : _a.propertyPreferences) !== null && _b !== void 0 ? _b : {}).length > 0;
|
|
31
|
+
}
|
|
32
|
+
static getMablscriptSelectorFromTabFindAction(tab) {
|
|
26
33
|
const mablscriptSelectorChunks = ['selector_type: "tab"'];
|
|
27
|
-
if (
|
|
28
|
-
mablscriptSelectorChunks.push(`title: "${(0, domUtil_1.escapeMablscriptString)(
|
|
34
|
+
if (tab.title !== undefined) {
|
|
35
|
+
mablscriptSelectorChunks.push(`title: "${(0, domUtil_1.escapeMablscriptString)(tab.title)}"`);
|
|
29
36
|
}
|
|
30
|
-
if (
|
|
31
|
-
mablscriptSelectorChunks.push(`url: "${(0, domUtil_1.escapeMablscriptString)(
|
|
37
|
+
if (tab.url !== undefined) {
|
|
38
|
+
mablscriptSelectorChunks.push(`url: "${(0, domUtil_1.escapeMablscriptString)(tab.url)}"`);
|
|
32
39
|
}
|
|
33
|
-
if (
|
|
34
|
-
mablscriptSelectorChunks.push(`uuid: "${(0, domUtil_1.escapeMablscriptString)(
|
|
40
|
+
if (tab.uuid !== undefined) {
|
|
41
|
+
mablscriptSelectorChunks.push(`uuid: "${(0, domUtil_1.escapeMablscriptString)(tab.uuid)}"`);
|
|
35
42
|
}
|
|
36
|
-
|
|
43
|
+
let descriptor = mablscriptSelectorChunks.join(', ');
|
|
44
|
+
if (tab.configuration) {
|
|
45
|
+
descriptor = `${descriptor}, ${AwaitTabStep.getConfigurationString(tab)}`;
|
|
46
|
+
}
|
|
47
|
+
return `{${descriptor}}`;
|
|
48
|
+
}
|
|
49
|
+
static getConfigurationString(tabSelector) {
|
|
50
|
+
let configString;
|
|
51
|
+
if (hasCustomFindOptions(tabSelector)) {
|
|
52
|
+
configString = (0, domUtil_1.buildStepArgumentString)({
|
|
53
|
+
params: { ...tabSelector.configuration },
|
|
54
|
+
legacy: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (configString) {
|
|
58
|
+
return `configuration: ${configString}`;
|
|
59
|
+
}
|
|
60
|
+
return '';
|
|
37
61
|
}
|
|
38
62
|
}
|
|
39
63
|
exports.AwaitTabStep = AwaitTabStep;
|
|
40
64
|
AwaitTabStep.mablScriptStepNames = ['await_tab'];
|
|
41
65
|
AwaitTabStep.yamlMablScriptNames = ['AwaitTab'];
|
|
66
|
+
function hasCustomFindOptions(tab) {
|
|
67
|
+
return AwaitTabStep.hasCustomFindOptions(tab);
|
|
68
|
+
}
|
|
69
|
+
exports.hasCustomFindOptions = hasCustomFindOptions;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollType = exports.ScrollDirection = void 0;
|
|
4
|
+
var ScrollDirection;
|
|
5
|
+
(function (ScrollDirection) {
|
|
6
|
+
ScrollDirection["Down"] = "down";
|
|
7
|
+
ScrollDirection["Left"] = "left";
|
|
8
|
+
ScrollDirection["Right"] = "right";
|
|
9
|
+
ScrollDirection["Up"] = "up";
|
|
10
|
+
})(ScrollDirection = exports.ScrollDirection || (exports.ScrollDirection = {}));
|
|
11
|
+
var ScrollType;
|
|
12
|
+
(function (ScrollType) {
|
|
13
|
+
ScrollType["ScrollDeviceScreen"] = "scroll_device_screen";
|
|
14
|
+
ScrollType["ScrollToElement"] = "scroll_to_element";
|
|
15
|
+
ScrollType["ScrollWithinElement"] = "scroll_within_element";
|
|
16
|
+
})(ScrollType = exports.ScrollType || (exports.ScrollType = {}));
|