@mablhq/mabl-cli 2.49.1 → 2.50.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.
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const HideKeyboardStep_1 = require("../../steps/HideKeyboardStep");
4
- const StepTestsUtil_1 = require("../StepTestsUtil");
5
- describe('HideKeyboard steps parse correctly', () => {
6
- it('Parses a HideKeyboard step', () => {
7
- const hideKeyboardStepDescriptor = {
8
- actionCode: 'hide_keyboard',
9
- id: 'HideTheDangKeyboard',
10
- };
11
- const steps = [
12
- {
13
- HideKeyboard: hideKeyboardStepDescriptor,
14
- },
15
- ];
16
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, HideKeyboardStep_1.HideKeyboardStep.stepName, hideKeyboardStepDescriptor);
17
- const hideKeyboardStep = new HideKeyboardStep_1.HideKeyboardStep(hideKeyboardStepDescriptor);
18
- expect(hideKeyboardStep.stepId()).toEqual(hideKeyboardStepDescriptor.id);
19
- });
20
- it('Humanizes a HideKeyboard step', () => {
21
- const stepYaml = {
22
- HideKeyboard: { actionCode: 'hide_keyboard' },
23
- };
24
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
25
- expect(step.stepDescription()).toEqual(`Hide keyboard if present`);
26
- });
27
- });
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const InstallAppStep_1 = require("../../steps/InstallAppStep");
4
- const StepTestsUtil_1 = require("../StepTestsUtil");
5
- describe('Install App steps parse correctly', () => {
6
- it('Parses an InstallApp step', () => {
7
- const stepDescriptor = {
8
- id: 'hereYouGo',
9
- actionCode: 'installApp',
10
- };
11
- const steps = [
12
- {
13
- InstallApp: stepDescriptor,
14
- },
15
- ];
16
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, InstallAppStep_1.InstallAppStep.stepName, stepDescriptor);
17
- const tapStep = new InstallAppStep_1.InstallAppStep(stepDescriptor);
18
- expect(tapStep.stepId()).toEqual(stepDescriptor.id);
19
- });
20
- });
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const NavigateBackStep_1 = require("../../steps/NavigateBackStep");
4
- const StepTestsUtil_1 = require("../StepTestsUtil");
5
- describe('NavigateBack steps parse correctly', () => {
6
- it('Parses a NavigateBack step', () => {
7
- const navigateBackStepDescriptor = {
8
- actionCode: 'navigate_back',
9
- id: 'WeHaveToGoBack',
10
- };
11
- const steps = [
12
- {
13
- NavigateBack: navigateBackStepDescriptor,
14
- },
15
- ];
16
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, NavigateBackStep_1.NavigateBackStep.stepName, navigateBackStepDescriptor);
17
- const navBackStep = new NavigateBackStep_1.NavigateBackStep(navigateBackStepDescriptor);
18
- expect(navBackStep.stepId()).toEqual(navigateBackStepDescriptor.id);
19
- });
20
- it('Humanizes a NavigateHome back', () => {
21
- const stepYaml = {
22
- NavigateBack: { actionCode: 'navigate_back' },
23
- };
24
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
25
- expect(step.stepDescription()).toEqual(`Navigate back`);
26
- });
27
- });
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const NavigateHomeStep_1 = require("../../steps/NavigateHomeStep");
4
- const StepTestsUtil_1 = require("../StepTestsUtil");
5
- describe('NavigateHome steps parse correctly', () => {
6
- it('Parses a NavigateHome step', () => {
7
- const navigateHomeStepDescriptor = {
8
- actionCode: 'navigate_home',
9
- id: 'OhHomeLetMeComeHome',
10
- };
11
- const steps = [
12
- {
13
- NavigateHome: navigateHomeStepDescriptor,
14
- },
15
- ];
16
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, NavigateHomeStep_1.NavigateHomeStep.stepName, navigateHomeStepDescriptor);
17
- const navHomeStep = new NavigateHomeStep_1.NavigateHomeStep(navigateHomeStepDescriptor);
18
- expect(navHomeStep.stepId()).toEqual(navigateHomeStepDescriptor.id);
19
- });
20
- it('Humanizes a NavigateHome step', () => {
21
- const stepYaml = {
22
- NavigateHome: { actionCode: 'navigate_home' },
23
- };
24
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
25
- expect(step.stepDescription()).toEqual(`Navigate home`);
26
- });
27
- });
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const OpenLinkStep_1 = require("../../steps/OpenLinkStep");
4
- const StepTestsUtil_1 = require("../StepTestsUtil");
5
- describe('Open link steps parse correctly', () => {
6
- it('Parses an OpenLink step', () => {
7
- const stepDescriptor = {
8
- url: `testing-app://what/the/thing`,
9
- packageName: 'testing-app',
10
- };
11
- const steps = [
12
- {
13
- OpenLink: stepDescriptor,
14
- },
15
- ];
16
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, OpenLinkStep_1.OpenLinkStep.stepName, stepDescriptor);
17
- const openLinkStep = new OpenLinkStep_1.OpenLinkStep(stepDescriptor);
18
- expect(openLinkStep.stepId()).toEqual(stepDescriptor.id);
19
- });
20
- });
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const StepTestsUtil_1 = require("../StepTestsUtil");
4
- const PushFileStep_1 = require("../../steps/PushFileStep");
5
- describe('Push File steps parse correctly', () => {
6
- it('Parses a PushFile step', () => {
7
- const pushFileDescriptor = {
8
- id: 'pushItRealGood',
9
- files: [
10
- {
11
- file: {
12
- id: 'id-1',
13
- name: 'candy1.jpeg',
14
- },
15
- path: '@mabl.sandbox:documents/Presentation.key',
16
- },
17
- ],
18
- };
19
- const steps = [
20
- {
21
- PushFile: pushFileDescriptor,
22
- },
23
- ];
24
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, PushFileStep_1.PushFileStep.stepName, pushFileDescriptor);
25
- const pushFileStep = new PushFileStep_1.PushFileStep(pushFileDescriptor);
26
- expect(pushFileStep.stepId()).toEqual(pushFileDescriptor.id);
27
- const stepDescription = pushFileStep.stepDescription();
28
- expect(stepDescription).toEqual(`Push the file \"candy1.jpeg\" to the test device at path \"@mabl.sandbox:documents/Presentation.key\"`);
29
- });
30
- it('Humanizes a push file step with multiple files', () => {
31
- const pushFileDescriptor = {
32
- id: 'pushItRealGood',
33
- files: [
34
- {
35
- file: {
36
- id: 'id-1',
37
- name: 'candy1.jpeg',
38
- },
39
- path: '@mabl.sandbox:documents/Presentation.key',
40
- },
41
- {
42
- file: {
43
- id: 'id-2',
44
- name: 'candy2.jpeg',
45
- },
46
- path: '@mabl.sandbox:documents/Presentations.key',
47
- },
48
- ],
49
- };
50
- const pushFileStep = new PushFileStep_1.PushFileStep(pushFileDescriptor);
51
- expect(pushFileStep.stepId()).toEqual(pushFileDescriptor.id);
52
- const stepDescription = pushFileStep.stepDescription();
53
- expect(stepDescription).toEqual(`Push 2 files to the test device`);
54
- });
55
- });
@@ -1,386 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const ScrollStep_1 = require("../../steps/ScrollStep");
4
- const ScrollStepDescriptor_1 = require("../../../types/mobile/ScrollStepDescriptor");
5
- const StepTestsUtil_1 = require("../StepTestsUtil");
6
- const domUtil_1 = require("../../../../domUtil");
7
- describe('Scroll steps parse correctly', () => {
8
- describe('ScrollType.ScrollDeviceScreen', () => {
9
- it('Parses a ScrollDeviceScreen step', () => {
10
- const windowSize = { width: 1440, height: 2392 };
11
- const scrollStepDescriptor = {
12
- description: 'Scroll down 94.06% of the screen',
13
- id: 'scrolliePolieOlie',
14
- coordinates: {
15
- from: {
16
- xPercent: 1074 / windowSize.width,
17
- yPercent: 2350 / windowSize.height,
18
- },
19
- to: {
20
- xPercent: 1074 / windowSize.width,
21
- yPercent: 100 / windowSize.height,
22
- },
23
- },
24
- actionCode: 'scroll',
25
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
26
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
27
- };
28
- const steps = [
29
- {
30
- Scroll: scrollStepDescriptor,
31
- },
32
- ];
33
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
34
- const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
35
- expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
36
- });
37
- it('Humanizes a ScrollDeviceScreen step', () => {
38
- const windowSize = { width: 1440, height: 2392 };
39
- const stepYaml = {
40
- Scroll: {
41
- coordinates: {
42
- from: {
43
- xPercent: 1074 / windowSize.width,
44
- yPercent: 2350 / windowSize.height,
45
- },
46
- to: {
47
- xPercent: 1074 / windowSize.width,
48
- yPercent: 100 / windowSize.height,
49
- },
50
- },
51
- actionCode: 'scroll',
52
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
53
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
54
- },
55
- };
56
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
57
- expect(step.stepDescription()).toEqual(`Scroll down 94.06% of the screen`);
58
- });
59
- it('Humanizes scroll directions as expected', () => {
60
- const scrollUpStepYaml = {
61
- Scroll: {
62
- coordinates: {
63
- from: {
64
- xPercent: 0.109212,
65
- yPercent: 0.241223,
66
- },
67
- to: {
68
- xPercent: 0.145543,
69
- yPercent: 0.865454,
70
- },
71
- },
72
- actionCode: 'scroll',
73
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
74
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
75
- },
76
- };
77
- const scrollUpStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollUpStepYaml);
78
- expect(scrollUpStep.stepDescription()).toEqual(`Scroll up 62.42% of the screen`);
79
- const scrollDownStepYaml = {
80
- Scroll: {
81
- coordinates: {
82
- from: {
83
- xPercent: 0.48351,
84
- yPercent: 0.89123,
85
- },
86
- to: {
87
- xPercent: 0.4515,
88
- yPercent: 0.0874,
89
- },
90
- },
91
- actionCode: 'scroll',
92
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
93
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
94
- },
95
- };
96
- const scrollDownStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollDownStepYaml);
97
- expect(scrollDownStep.stepDescription()).toEqual(`Scroll down 80.38% of the screen`);
98
- const scrollLeftStepYaml = {
99
- Scroll: {
100
- coordinates: {
101
- from: {
102
- xPercent: 0.08111,
103
- yPercent: 0.46123,
104
- },
105
- to: {
106
- xPercent: 0.90295,
107
- yPercent: 0.4574,
108
- },
109
- },
110
- actionCode: 'scroll',
111
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
112
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
113
- },
114
- };
115
- const scrollLeftStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollLeftStepYaml);
116
- expect(scrollLeftStep.stepDescription()).toEqual(`Scroll left 82.18% of the screen`);
117
- const scrollRightStepYaml = {
118
- Scroll: {
119
- coordinates: {
120
- from: {
121
- xPercent: 0.88111,
122
- yPercent: 0.46123,
123
- },
124
- to: {
125
- xPercent: 0.09295,
126
- yPercent: 0.4574,
127
- },
128
- },
129
- actionCode: 'scroll',
130
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
131
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollDeviceScreen,
132
- },
133
- };
134
- const scrollRightStep = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(scrollRightStepYaml);
135
- expect(scrollRightStep.stepDescription()).toEqual(`Scroll right 78.82% of the screen`);
136
- });
137
- });
138
- describe('ScrollType.ScrollToElement', () => {
139
- const find = {
140
- findType: domUtil_1.FindType.FIND_ONE,
141
- findTarget: {
142
- selector: {
143
- iOS: {
144
- name: 'Name field',
145
- },
146
- uuid: '',
147
- },
148
- },
149
- };
150
- const innerFindTarget = {
151
- findType: domUtil_1.FindType.FIND_ONE,
152
- findTarget: {
153
- selector: {
154
- iOS: {
155
- name: 'Email field',
156
- },
157
- uuid: '',
158
- },
159
- },
160
- };
161
- it('Parses a ScrollToElement step', () => {
162
- const scrollStepDescriptor = {
163
- description: 'Scroll right a maximum of 6 times within the "Name field" element until the "Email field" element is visible',
164
- id: 'scrollMe',
165
- actionCode: 'scroll',
166
- find,
167
- maxScrollAttempts: 6,
168
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
169
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
170
- targetElementDescriptor: innerFindTarget,
171
- };
172
- const steps = [
173
- {
174
- Scroll: scrollStepDescriptor,
175
- },
176
- ];
177
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
178
- const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
179
- expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
180
- });
181
- it('Humanizes ScrollToElement step with container element', () => {
182
- const scrollStepDescriptor = {
183
- id: 'scrollMe',
184
- actionCode: 'scroll',
185
- coordinates: {
186
- from: {
187
- xPercent: 0.109212,
188
- yPercent: 0.241223,
189
- },
190
- to: {
191
- xPercent: 0.145543,
192
- yPercent: 0.865454,
193
- },
194
- },
195
- find,
196
- maxScrollAttempts: 6,
197
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
198
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
199
- targetElementDescriptor: innerFindTarget,
200
- };
201
- const stepYaml = {
202
- Scroll: scrollStepDescriptor,
203
- };
204
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
205
- expect(step.stepDescription()).toEqual(`Scroll up 62.42% a maximum of 6 times within the "Name field" element until the "Email field" element is visible`);
206
- });
207
- it('Humanizes ScrollToElement step without container element', () => {
208
- const scrollStepDescriptor = {
209
- id: 'scrollMe',
210
- actionCode: 'scroll',
211
- coordinates: {
212
- from: {
213
- xPercent: 0.109212,
214
- yPercent: 0.241223,
215
- },
216
- to: {
217
- xPercent: 0.145543,
218
- yPercent: 0.865454,
219
- },
220
- },
221
- maxScrollAttempts: 6,
222
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
223
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
224
- targetElementDescriptor: innerFindTarget,
225
- };
226
- const stepYaml = {
227
- Scroll: scrollStepDescriptor,
228
- };
229
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
230
- expect(step.stepDescription()).toEqual(`Scroll up 62.42% a maximum of 6 times within the screen until the "Email field" element is visible`);
231
- });
232
- it('Humanizes a legacy ScrollToElement step', () => {
233
- const scrollStepDescriptor = {
234
- id: 'scrollMe',
235
- actionCode: 'scroll',
236
- find,
237
- maxScrollAttempts: 6,
238
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
239
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollToElement,
240
- targetElementDescriptor: innerFindTarget,
241
- };
242
- const stepYaml = {
243
- Scroll: scrollStepDescriptor,
244
- };
245
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
246
- expect(step.stepDescription()).toEqual(`Scroll right a maximum of 6 times within the "Name field" element until the "Email field" element is visible`);
247
- });
248
- });
249
- describe('ScrollType.ScrollWithinElement', () => {
250
- const find = {
251
- findType: domUtil_1.FindType.FIND_ONE,
252
- findTarget: {
253
- selector: {
254
- iOS: {
255
- name: 'Name field',
256
- },
257
- uuid: '',
258
- },
259
- },
260
- };
261
- it('Parses a ScrollWithinElement step', () => {
262
- const scrollStepDescriptor = {
263
- description: 'Scroll right 80% within the "Name field" element',
264
- id: 'scrollMe',
265
- actionCode: 'scroll',
266
- coordinates: {
267
- from: {
268
- xPercent: 0.9,
269
- yPercent: 0.6,
270
- },
271
- to: {
272
- xPercent: 0.1,
273
- yPercent: 0.5,
274
- },
275
- },
276
- find,
277
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
278
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
279
- };
280
- const steps = [
281
- {
282
- Scroll: scrollStepDescriptor,
283
- },
284
- ];
285
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, ScrollStep_1.ScrollStep.stepName, scrollStepDescriptor);
286
- const scrollStep = new ScrollStep_1.ScrollStep(scrollStepDescriptor);
287
- expect(scrollStep.stepId()).toEqual(scrollStepDescriptor.id);
288
- });
289
- it('Humanizes a ScrollWithinElement step', () => {
290
- const scrollStepDescriptor = {
291
- id: 'scrollMe',
292
- actionCode: 'scroll',
293
- coordinates: {
294
- from: {
295
- xPercent: 0.9,
296
- yPercent: 0.6,
297
- },
298
- to: {
299
- xPercent: 0.1,
300
- yPercent: 0.5,
301
- },
302
- },
303
- find,
304
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
305
- scrollType: ScrollStepDescriptor_1.ScrollType.ScrollWithinElement,
306
- };
307
- const stepYaml = {
308
- Scroll: scrollStepDescriptor,
309
- };
310
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
311
- expect(step.stepDescription()).toEqual(`Scroll right 80% within the "Name field" element`);
312
- });
313
- });
314
- });
315
- describe('getScrollDirectionAndPercentageFromCoordinates', () => {
316
- it('returned default down 80% if no coordinates supplied', () => {
317
- expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(undefined)).toEqual({
318
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
319
- scrollPercent: '80%',
320
- });
321
- });
322
- it('determines correct down direction and percentage', () => {
323
- const scrollCoordinates = {
324
- from: {
325
- xPercent: 0.3,
326
- yPercent: 0.75,
327
- },
328
- to: {
329
- xPercent: 0.5,
330
- yPercent: 0.25,
331
- },
332
- };
333
- expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
334
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Down,
335
- scrollPercent: '50%',
336
- });
337
- });
338
- it('determines correct up direction and percentage', () => {
339
- const scrollCoordinates = {
340
- from: {
341
- xPercent: 0.7,
342
- yPercent: 0,
343
- },
344
- to: {
345
- xPercent: 0.4,
346
- yPercent: 1,
347
- },
348
- };
349
- expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
350
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Up,
351
- scrollPercent: '100%',
352
- });
353
- });
354
- it('determines correct right direction and percentage', () => {
355
- const scrollCoordinates = {
356
- from: {
357
- xPercent: 0.95,
358
- yPercent: 0.4,
359
- },
360
- to: {
361
- xPercent: 0.12,
362
- yPercent: 0.5,
363
- },
364
- };
365
- expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
366
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Right,
367
- scrollPercent: '83%',
368
- });
369
- });
370
- it('determines correct left direction and percentage', () => {
371
- const scrollCoordinates = {
372
- from: {
373
- xPercent: 0.04,
374
- yPercent: 0.7,
375
- },
376
- to: {
377
- xPercent: 0.82,
378
- yPercent: 0.4,
379
- },
380
- };
381
- expect((0, ScrollStep_1.getScrollDirectionAndPercentageFromCoordinates)(scrollCoordinates)).toEqual({
382
- scrollDirection: ScrollStepDescriptor_1.ScrollDirection.Left,
383
- scrollPercent: '78%',
384
- });
385
- });
386
- });
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const SetOrientationStep_1 = require("../../steps/SetOrientationStep");
4
- const SetOrientationStepDescriptor_1 = require("../../../types/mobile/SetOrientationStepDescriptor");
5
- const StepTestsUtil_1 = require("../StepTestsUtil");
6
- describe('SetOrientation steps parse correctly', () => {
7
- it('Parses a SetOrientation step', () => {
8
- const setOrientationStepDescriptor = {
9
- id: 'theOrientalExpress',
10
- orientation: SetOrientationStepDescriptor_1.Orientation.Landscape,
11
- actionCode: 'set_orientation',
12
- };
13
- const steps = [
14
- {
15
- SetOrientation: setOrientationStepDescriptor,
16
- },
17
- ];
18
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, SetOrientationStep_1.SetOrientationStep.stepName, setOrientationStepDescriptor);
19
- const orientationStep = new SetOrientationStep_1.SetOrientationStep(setOrientationStepDescriptor);
20
- expect(orientationStep.stepId()).toEqual(setOrientationStepDescriptor.id);
21
- });
22
- it('Humanizes a SetOrientation step', () => {
23
- const stepYaml = {
24
- SetOrientation: {
25
- orientation: SetOrientationStepDescriptor_1.Orientation.Landscape,
26
- actionCode: 'set_orientation',
27
- },
28
- };
29
- const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
30
- expect(step.stepDescription()).toEqual(`Set orientation of device to landscape`);
31
- });
32
- });
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const TapStep_1 = require("../../steps/TapStep");
4
- const domUtil_1 = require("../../../../domUtil");
5
- const StepTestsUtil_1 = require("../StepTestsUtil");
6
- const TapStepDescriptor_1 = require("../../../types/mobile/TapStepDescriptor");
7
- const TestMobileFindDescriptors_1 = require("../TestMobileFindDescriptors");
8
- describe('Tap steps parse correctly', () => {
9
- it('Parses a Tap step with a Find One selector', () => {
10
- const find = {
11
- findType: domUtil_1.FindType.FIND_ONE,
12
- findTarget: {
13
- selector: {
14
- iOS: {
15
- name: '{{@varInFind}}',
16
- },
17
- uuid: '',
18
- },
19
- },
20
- };
21
- const stepDescriptor = {
22
- id: 'TappyMcTapperson',
23
- find,
24
- type: TapStepDescriptor_1.TapType.tap,
25
- actionCode: 'tap',
26
- };
27
- const steps = [
28
- {
29
- Tap: stepDescriptor,
30
- },
31
- ];
32
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, TapStep_1.TapStep.stepName, stepDescriptor);
33
- const tapStep = new TapStep_1.TapStep(stepDescriptor);
34
- expect(tapStep.stepId()).toEqual(stepDescriptor.id);
35
- expect(tapStep.getInputVariables()).toStrictEqual(['varInFind']);
36
- });
37
- it('Parses a WebView Tap step', () => {
38
- const stepDescriptor = {
39
- find: TestMobileFindDescriptors_1.iOSWebViewTextFieldMobileFindDescriptor,
40
- type: TapStepDescriptor_1.TapType.tap,
41
- actionCode: 'tap',
42
- };
43
- const steps = [
44
- {
45
- Tap: stepDescriptor,
46
- },
47
- ];
48
- (0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, TapStep_1.TapStep.stepName, stepDescriptor);
49
- });
50
- it('Renders description for step without find', () => {
51
- const stepDescriptor = {
52
- type: TapStepDescriptor_1.TapType.tap,
53
- };
54
- const tapStep = new TapStep_1.TapStep(stepDescriptor);
55
- expect(tapStep.stepDescription()).toEqual('Tap on unknown element');
56
- });
57
- });
@@ -1,20 +0,0 @@
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
- });