@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.
- package/core/execution/ApiTestUtils.js +1 -0
- package/execution/index.js +2 -2
- package/index.d.ts +21 -0
- package/package.json +1 -2
- package/proxy/index.js +1 -1
- package/mablscript/mobile/tests/steps/CreateVariableMobileStep.mobiletest.js +0 -298
- package/mablscript/mobile/tests/steps/EnterTextStep.mobiletest.js +0 -79
- package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +0 -304
- package/mablscript/mobile/tests/steps/HideKeyboardStep.mobiletest.js +0 -27
- package/mablscript/mobile/tests/steps/InstallAppStep.mobiletest.js +0 -20
- package/mablscript/mobile/tests/steps/NavigateBackStep.mobiletest.js +0 -27
- package/mablscript/mobile/tests/steps/NavigateHomeStep.mobiletest.js +0 -27
- package/mablscript/mobile/tests/steps/OpenLinkStep.mobiletest.js +0 -20
- package/mablscript/mobile/tests/steps/PushFileStep.mobiletest.js +0 -55
- package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +0 -386
- package/mablscript/mobile/tests/steps/SetOrientationStep.mobiletest.js +0 -32
- package/mablscript/mobile/tests/steps/TapStep.mobiletest.js +0 -57
- package/mablscript/mobile/tests/steps/UninstallAppStep.mobiletest.js +0 -20
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const domUtil_1 = require("../../../../domUtil");
|
|
4
|
-
const CreateVariableStepDescriptor_1 = require("../../../types/CreateVariableStepDescriptor");
|
|
5
|
-
const CreateVariableMobileStep_1 = require("../../steps/CreateVariableMobileStep");
|
|
6
|
-
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
7
|
-
describe('CreateVariable mobile steps parse correctly', () => {
|
|
8
|
-
it('Parses a CreateVariable mobile step with variable pattern', () => {
|
|
9
|
-
const stepDescriptor = {
|
|
10
|
-
id: 'VariableSchmariable',
|
|
11
|
-
generator: {
|
|
12
|
-
pattern: `my value: {{digit:3}}`,
|
|
13
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.PATTERN,
|
|
14
|
-
},
|
|
15
|
-
actionCode: 'as',
|
|
16
|
-
name: 'myValue',
|
|
17
|
-
};
|
|
18
|
-
const steps = [
|
|
19
|
-
{
|
|
20
|
-
CreateVariable: stepDescriptor,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
24
|
-
const varStep = new CreateVariableMobileStep_1.CreateVariableMobileStep(stepDescriptor);
|
|
25
|
-
expect(varStep.stepId()).toEqual(stepDescriptor.id);
|
|
26
|
-
});
|
|
27
|
-
it('Parses a CreateVariable mobile step for generating email address', () => {
|
|
28
|
-
const stepDescriptor = {
|
|
29
|
-
generator: {
|
|
30
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.EMAIL,
|
|
31
|
-
},
|
|
32
|
-
name: 'email',
|
|
33
|
-
actionCode: 'as',
|
|
34
|
-
};
|
|
35
|
-
const steps = [
|
|
36
|
-
{
|
|
37
|
-
CreateVariable: stepDescriptor,
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
41
|
-
});
|
|
42
|
-
it('Parses a CreateVariable mobile step for element attribute (Android)', () => {
|
|
43
|
-
const stepDescriptor = {
|
|
44
|
-
find: {
|
|
45
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
46
|
-
findTarget: {
|
|
47
|
-
selector: {
|
|
48
|
-
android: {
|
|
49
|
-
text: 'Profile',
|
|
50
|
-
},
|
|
51
|
-
uuid: '',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
generator: {
|
|
56
|
-
attribute: 'text',
|
|
57
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE,
|
|
58
|
-
},
|
|
59
|
-
name: 'profile',
|
|
60
|
-
actionCode: 'as',
|
|
61
|
-
};
|
|
62
|
-
const steps = [
|
|
63
|
-
{
|
|
64
|
-
CreateVariable: stepDescriptor,
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
68
|
-
});
|
|
69
|
-
it('Parses a CreateVariable mobile step for element attribute (iOS)', () => {
|
|
70
|
-
const stepDescriptor = {
|
|
71
|
-
find: {
|
|
72
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
73
|
-
findTarget: {
|
|
74
|
-
selector: {
|
|
75
|
-
iOS: {
|
|
76
|
-
name: `PROFILE`,
|
|
77
|
-
},
|
|
78
|
-
uuid: '',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
generator: {
|
|
83
|
-
attribute: 'name',
|
|
84
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE,
|
|
85
|
-
},
|
|
86
|
-
name: 'profile',
|
|
87
|
-
actionCode: 'as',
|
|
88
|
-
};
|
|
89
|
-
const steps = [
|
|
90
|
-
{
|
|
91
|
-
CreateVariable: stepDescriptor,
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
95
|
-
});
|
|
96
|
-
it('Parses a CreateVariable mobile step for element count (Android)', () => {
|
|
97
|
-
const stepDescriptor = {
|
|
98
|
-
find: {
|
|
99
|
-
findType: domUtil_1.FindType.FIND_ALL,
|
|
100
|
-
findTarget: {
|
|
101
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
102
|
-
},
|
|
103
|
-
foundElementSelectors: {
|
|
104
|
-
android: {
|
|
105
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
106
|
-
},
|
|
107
|
-
uuid: '',
|
|
108
|
-
},
|
|
109
|
-
primarySelectors: {
|
|
110
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
generator: {
|
|
114
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT,
|
|
115
|
-
},
|
|
116
|
-
name: 'count',
|
|
117
|
-
actionCode: 'as',
|
|
118
|
-
};
|
|
119
|
-
const steps = [
|
|
120
|
-
{
|
|
121
|
-
CreateVariable: stepDescriptor,
|
|
122
|
-
},
|
|
123
|
-
];
|
|
124
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
125
|
-
});
|
|
126
|
-
it('Parses a CreateVariable mobile step for element count (iOS)', () => {
|
|
127
|
-
const stepDescriptor = {
|
|
128
|
-
find: {
|
|
129
|
-
findType: domUtil_1.FindType.FIND_ALL,
|
|
130
|
-
findTarget: {
|
|
131
|
-
xpath: "//XCUIElementTypeStaticText[@name='Car']",
|
|
132
|
-
},
|
|
133
|
-
foundElementSelectors: {
|
|
134
|
-
android: {
|
|
135
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
136
|
-
},
|
|
137
|
-
uuid: '',
|
|
138
|
-
},
|
|
139
|
-
primarySelectors: {
|
|
140
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
generator: {
|
|
144
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT,
|
|
145
|
-
},
|
|
146
|
-
name: 'count',
|
|
147
|
-
actionCode: 'as',
|
|
148
|
-
};
|
|
149
|
-
const steps = [
|
|
150
|
-
{
|
|
151
|
-
CreateVariable: stepDescriptor,
|
|
152
|
-
},
|
|
153
|
-
];
|
|
154
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
155
|
-
});
|
|
156
|
-
it('Parses a CreateVariable mobile step for JavaScript snippet (Android)', () => {
|
|
157
|
-
const stepDescriptor = {
|
|
158
|
-
generator: {
|
|
159
|
-
javaScript: { encodedJS: 'myScript', actionCode: 'evaluate_js' },
|
|
160
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT,
|
|
161
|
-
},
|
|
162
|
-
actionCode: 'as',
|
|
163
|
-
name: 'result',
|
|
164
|
-
};
|
|
165
|
-
const steps = [
|
|
166
|
-
{
|
|
167
|
-
CreateVariable: stepDescriptor,
|
|
168
|
-
},
|
|
169
|
-
];
|
|
170
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
171
|
-
});
|
|
172
|
-
it('Parses a CreateVariable mobile step for element count (iOS)', () => {
|
|
173
|
-
const stepDescriptor = {
|
|
174
|
-
generator: {
|
|
175
|
-
javaScript: { encodedJS: 'myScript', actionCode: 'evaluate_js' },
|
|
176
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT,
|
|
177
|
-
},
|
|
178
|
-
name: 'result',
|
|
179
|
-
actionCode: 'as',
|
|
180
|
-
};
|
|
181
|
-
const steps = [
|
|
182
|
-
{
|
|
183
|
-
CreateVariable: stepDescriptor,
|
|
184
|
-
},
|
|
185
|
-
];
|
|
186
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, CreateVariableMobileStep_1.CreateVariableMobileStep.stepName, stepDescriptor);
|
|
187
|
-
});
|
|
188
|
-
it('Humanizes a Create variable from pattern step', () => {
|
|
189
|
-
const stepDescriptor = {
|
|
190
|
-
CreateVariable: {
|
|
191
|
-
generator: {
|
|
192
|
-
pattern: `my value: {{digit:3}}`,
|
|
193
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.PATTERN,
|
|
194
|
-
},
|
|
195
|
-
name: 'myValue',
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
199
|
-
expect(step.stepDescription()).toEqual(`Assign variable \"myValue\" value from string generated with format \"my value: {{digit:3}}\"`);
|
|
200
|
-
});
|
|
201
|
-
it('Humanizes a Create variable from email step', () => {
|
|
202
|
-
const stepDescriptor = {
|
|
203
|
-
CreateVariable: {
|
|
204
|
-
generator: {
|
|
205
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.EMAIL,
|
|
206
|
-
},
|
|
207
|
-
name: 'email',
|
|
208
|
-
},
|
|
209
|
-
};
|
|
210
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
211
|
-
expect(step.stepDescription()).toEqual(`Generate a new mabl mailbox email address`);
|
|
212
|
-
});
|
|
213
|
-
it('Humanizes a Create variable from element attribute step (android)', () => {
|
|
214
|
-
const stepDescriptor = {
|
|
215
|
-
CreateVariable: {
|
|
216
|
-
find: {
|
|
217
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
218
|
-
findTarget: {
|
|
219
|
-
selector: {
|
|
220
|
-
android: {
|
|
221
|
-
text: 'Profile',
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
generator: {
|
|
227
|
-
attribute: 'text',
|
|
228
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE,
|
|
229
|
-
},
|
|
230
|
-
name: 'profile',
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
234
|
-
expect(step.stepDescription()).toEqual(`Assign variable \"profile\" value from element attribute \"text\"`);
|
|
235
|
-
});
|
|
236
|
-
it('Humanizes a Create variable from element attribute step (iOS)', () => {
|
|
237
|
-
const stepDescriptor = {
|
|
238
|
-
CreateVariable: {
|
|
239
|
-
find: {
|
|
240
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
241
|
-
findTarget: {
|
|
242
|
-
selector: {
|
|
243
|
-
iOS: {
|
|
244
|
-
name: `PROFILE`,
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
generator: {
|
|
250
|
-
attribute: 'name',
|
|
251
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ATTRIBUTE,
|
|
252
|
-
},
|
|
253
|
-
name: 'profile',
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
257
|
-
expect(step.stepDescription()).toEqual(`Assign variable \"profile\" value from element attribute \"name\"`);
|
|
258
|
-
});
|
|
259
|
-
it('Humanizes a Create variable from element count', () => {
|
|
260
|
-
const stepDescriptor = {
|
|
261
|
-
CreateVariable: {
|
|
262
|
-
find: {
|
|
263
|
-
findType: domUtil_1.FindType.FIND_ALL,
|
|
264
|
-
findTarget: {
|
|
265
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
266
|
-
},
|
|
267
|
-
foundElementSelectors: {
|
|
268
|
-
android: {
|
|
269
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
primarySelectors: {
|
|
273
|
-
xpath: "//android.widget.TextView[@text='Car']",
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
generator: {
|
|
277
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.ELEMENT_COUNT,
|
|
278
|
-
},
|
|
279
|
-
name: 'count',
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
283
|
-
expect(step.stepDescription()).toEqual(`Assign variable \"count\" value from element count using xpath: //android.widget.TextView[@text='Car']`);
|
|
284
|
-
});
|
|
285
|
-
it('Humanizes a Create variable from script snippet', () => {
|
|
286
|
-
const stepDescriptor = {
|
|
287
|
-
CreateVariable: {
|
|
288
|
-
generator: {
|
|
289
|
-
javaScript: { encodedJS: 'myScript' },
|
|
290
|
-
type: CreateVariableStepDescriptor_1.VariableGenerator.JAVASCRIPT,
|
|
291
|
-
},
|
|
292
|
-
name: 'result',
|
|
293
|
-
},
|
|
294
|
-
};
|
|
295
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepDescriptor);
|
|
296
|
-
expect(step.stepDescription()).toEqual(`Assign variable \"result\" using script`);
|
|
297
|
-
});
|
|
298
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const EnterTextStep_1 = require("../../steps/EnterTextStep");
|
|
4
|
-
const domUtil_1 = require("../../../../domUtil");
|
|
5
|
-
const MablSymbol_1 = require("../../../MablSymbol");
|
|
6
|
-
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
7
|
-
const TestMobileFindDescriptors_1 = require("../TestMobileFindDescriptors");
|
|
8
|
-
describe('EnterText steps parse correctly', () => {
|
|
9
|
-
it('Parses an EnterText step with a Find One selector', () => {
|
|
10
|
-
const find = {
|
|
11
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
12
|
-
findTarget: {
|
|
13
|
-
selector: {
|
|
14
|
-
iOS: {
|
|
15
|
-
name: 'Name field',
|
|
16
|
-
},
|
|
17
|
-
uuid: '',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
const enterTextStepDescriptor = {
|
|
22
|
-
find,
|
|
23
|
-
text: 'Mauro',
|
|
24
|
-
actionCode: 'enter_text',
|
|
25
|
-
};
|
|
26
|
-
const steps = [
|
|
27
|
-
{
|
|
28
|
-
EnterText: enterTextStepDescriptor,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, EnterTextStep_1.EnterTextStep.stepName, enterTextStepDescriptor);
|
|
32
|
-
const enterTextStep = new EnterTextStep_1.EnterTextStep(enterTextStepDescriptor);
|
|
33
|
-
expect(enterTextStep.getInputVariables()).toHaveLength(0);
|
|
34
|
-
});
|
|
35
|
-
it('Parses an EnterText step with a Find One selector and a variable', () => {
|
|
36
|
-
const find = {
|
|
37
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
38
|
-
findTarget: {
|
|
39
|
-
selector: {
|
|
40
|
-
iOS: {
|
|
41
|
-
name: '{{@varInFind}}',
|
|
42
|
-
},
|
|
43
|
-
uuid: '',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
const enterTextStepDescriptor = {
|
|
48
|
-
id: 'TypingTypesForTypers',
|
|
49
|
-
find,
|
|
50
|
-
text: new MablSymbol_1.MablSymbol('user.input'),
|
|
51
|
-
actionCode: 'enter_text',
|
|
52
|
-
};
|
|
53
|
-
const steps = [
|
|
54
|
-
{
|
|
55
|
-
EnterText: enterTextStepDescriptor,
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, EnterTextStep_1.EnterTextStep.stepName, enterTextStepDescriptor);
|
|
59
|
-
const enterTextStep = new EnterTextStep_1.EnterTextStep(enterTextStepDescriptor);
|
|
60
|
-
expect(enterTextStep.getInputVariables()).toStrictEqual([
|
|
61
|
-
'varInFind',
|
|
62
|
-
'user.input',
|
|
63
|
-
]);
|
|
64
|
-
expect(enterTextStep.stepId()).toEqual(enterTextStepDescriptor.id);
|
|
65
|
-
});
|
|
66
|
-
it('Parses a WebView EnterText step with a Find One selector and a variable', () => {
|
|
67
|
-
const enterTextStepDescriptor = {
|
|
68
|
-
find: TestMobileFindDescriptors_1.iOSWebViewTextFieldMobileFindDescriptor,
|
|
69
|
-
text: new MablSymbol_1.MablSymbol('user.input'),
|
|
70
|
-
actionCode: 'enter_text',
|
|
71
|
-
};
|
|
72
|
-
const steps = [
|
|
73
|
-
{
|
|
74
|
-
EnterText: enterTextStepDescriptor,
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
(0, StepTestsUtil_1.parseAndValidateYamlConversion)(steps, EnterTextStep_1.EnterTextStep.stepName, enterTextStepDescriptor);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const domUtil_1 = require("../../../../domUtil");
|
|
4
|
-
const StepTestsUtil_1 = require("../StepTestsUtil");
|
|
5
|
-
describe('Humanization of steps work', () => {
|
|
6
|
-
it('Humanizes an iOS Tap step properly for accessibility ID', () => {
|
|
7
|
-
const stepYaml = {
|
|
8
|
-
Tap: {
|
|
9
|
-
find: {
|
|
10
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
11
|
-
findTarget: {
|
|
12
|
-
selector: {
|
|
13
|
-
iOS: {
|
|
14
|
-
name: 'Name field',
|
|
15
|
-
type: 'XCUIElementTypeButton',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
type: 'tap',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
24
|
-
expect(step.stepDescription()).toEqual(`Tap on "Name field" element`);
|
|
25
|
-
});
|
|
26
|
-
it('Humanizes an iOS Tap step properly for label', () => {
|
|
27
|
-
const stepYaml = {
|
|
28
|
-
Tap: {
|
|
29
|
-
find: {
|
|
30
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
31
|
-
findTarget: {
|
|
32
|
-
selector: {
|
|
33
|
-
iOS: {
|
|
34
|
-
type: 'XCUIElementTypeButton',
|
|
35
|
-
label: 'Click here for more',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
type: 'tap',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
44
|
-
expect(step.stepDescription()).toEqual(`Tap on "Button" element with label "Click here for more"`);
|
|
45
|
-
});
|
|
46
|
-
it('Humanizes an iOS Tap step properly when only type is available', () => {
|
|
47
|
-
const stepYaml = {
|
|
48
|
-
Tap: {
|
|
49
|
-
find: {
|
|
50
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
51
|
-
findTarget: {
|
|
52
|
-
selector: {
|
|
53
|
-
android: {},
|
|
54
|
-
iOS: {
|
|
55
|
-
type: 'XCUIElementTypeButton',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
type: 'tap',
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
64
|
-
expect(step.stepDescription()).toEqual(`Tap on "Button" element`);
|
|
65
|
-
});
|
|
66
|
-
it('Humanizes an android Tap step properly when text is available', () => {
|
|
67
|
-
const stepYaml = {
|
|
68
|
-
Tap: {
|
|
69
|
-
find: {
|
|
70
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
71
|
-
findTarget: {
|
|
72
|
-
selector: {
|
|
73
|
-
android: {
|
|
74
|
-
class: 'android.widget.Button',
|
|
75
|
-
text: 'submit form',
|
|
76
|
-
},
|
|
77
|
-
iOS: {},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
type: 'tap',
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
85
|
-
expect(step.stepDescription()).toEqual(`Tap on "Button" element with text "submit form"`);
|
|
86
|
-
});
|
|
87
|
-
it('Humanizes an android Tap step properly when only class is available', () => {
|
|
88
|
-
const stepYaml = {
|
|
89
|
-
Tap: {
|
|
90
|
-
find: {
|
|
91
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
92
|
-
findTarget: {
|
|
93
|
-
selector: {
|
|
94
|
-
android: {
|
|
95
|
-
class: 'android.widget.Button',
|
|
96
|
-
},
|
|
97
|
-
iOS: {},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
type: 'tap',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
105
|
-
expect(step.stepDescription()).toEqual(`Tap on "Button" element`);
|
|
106
|
-
});
|
|
107
|
-
it('Humanizes an iOS Enter Text step properly for accessibility ID', () => {
|
|
108
|
-
const stepYaml = {
|
|
109
|
-
EnterText: {
|
|
110
|
-
text: 'Bailey',
|
|
111
|
-
find: {
|
|
112
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
113
|
-
findTarget: {
|
|
114
|
-
selector: {
|
|
115
|
-
iOS: {
|
|
116
|
-
name: 'Name field',
|
|
117
|
-
type: 'XCUIElementTypeButton',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
125
|
-
expect(step.stepDescription()).toEqual(`Enter text "Bailey" in "Name field" element`);
|
|
126
|
-
});
|
|
127
|
-
it('Humanizes an iOS Enter Text step properly for label', () => {
|
|
128
|
-
const stepYaml = {
|
|
129
|
-
EnterText: {
|
|
130
|
-
text: 'Bailey',
|
|
131
|
-
find: {
|
|
132
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
133
|
-
findTarget: {
|
|
134
|
-
selector: {
|
|
135
|
-
iOS: {
|
|
136
|
-
type: 'XCUIElementTypeTextField',
|
|
137
|
-
label: 'add name here',
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
145
|
-
expect(step.stepDescription()).toEqual(`Enter text "Bailey" in "TextField" element with label "add name here"`);
|
|
146
|
-
});
|
|
147
|
-
it('Humanizes an android Enter Text step properly using android text', () => {
|
|
148
|
-
const stepYaml = {
|
|
149
|
-
EnterText: {
|
|
150
|
-
text: 'Bailey',
|
|
151
|
-
find: {
|
|
152
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
153
|
-
findTarget: {
|
|
154
|
-
selector: {
|
|
155
|
-
android: {
|
|
156
|
-
class: 'android.widget.EditText',
|
|
157
|
-
text: 'submit form',
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
165
|
-
expect(step.stepDescription()).toEqual(`Enter text "Bailey" in "EditText" element with text "submit form"`);
|
|
166
|
-
});
|
|
167
|
-
it('humanizes an android button with contentDesc attribute', () => {
|
|
168
|
-
const stepYaml = {
|
|
169
|
-
Tap: {
|
|
170
|
-
find: {
|
|
171
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
172
|
-
findTarget: {
|
|
173
|
-
selector: {
|
|
174
|
-
android: {
|
|
175
|
-
displayed: true,
|
|
176
|
-
resourceId: '',
|
|
177
|
-
package: 'com.polar.android.debug',
|
|
178
|
-
checkable: false,
|
|
179
|
-
clickable: true,
|
|
180
|
-
index: 0,
|
|
181
|
-
focusable: true,
|
|
182
|
-
alternateXPaths: [
|
|
183
|
-
'//android.widget.Button[@content-desc="MySeltzer"',
|
|
184
|
-
],
|
|
185
|
-
contentDesc: 'MySeltzer',
|
|
186
|
-
enabled: true,
|
|
187
|
-
longClickable: false,
|
|
188
|
-
password: false,
|
|
189
|
-
xpath: '//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.Button',
|
|
190
|
-
bounds: '[42,616][465,784]',
|
|
191
|
-
focused: false,
|
|
192
|
-
checked: false,
|
|
193
|
-
text: '',
|
|
194
|
-
class: 'android.widget.Button',
|
|
195
|
-
scrollable: false,
|
|
196
|
-
selected: false,
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
204
|
-
expect(step.stepDescription()).toEqual(`Tap on "Button" element with content-desc "MySeltzer"`);
|
|
205
|
-
});
|
|
206
|
-
it('humanizes an android text field that contains a password', () => {
|
|
207
|
-
const stepYaml = {
|
|
208
|
-
EnterText: {
|
|
209
|
-
text: 'superSecretClassified',
|
|
210
|
-
find: {
|
|
211
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
212
|
-
findTarget: {
|
|
213
|
-
selector: {
|
|
214
|
-
android: {
|
|
215
|
-
displayed: true,
|
|
216
|
-
resourceId: '',
|
|
217
|
-
package: 'com.polar.android.debug',
|
|
218
|
-
checkable: false,
|
|
219
|
-
clickable: true,
|
|
220
|
-
index: 0,
|
|
221
|
-
focusable: true,
|
|
222
|
-
alternateXPaths: [],
|
|
223
|
-
enabled: true,
|
|
224
|
-
longClickable: false,
|
|
225
|
-
password: true,
|
|
226
|
-
xpath: '//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.Button',
|
|
227
|
-
bounds: '[42,616][465,784]',
|
|
228
|
-
focused: false,
|
|
229
|
-
checked: false,
|
|
230
|
-
text: '',
|
|
231
|
-
class: 'android.widget.EditText',
|
|
232
|
-
scrollable: false,
|
|
233
|
-
selected: false,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
};
|
|
240
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
241
|
-
expect(step.stepDescription()).toEqual(`Enter password in "EditText" element`);
|
|
242
|
-
});
|
|
243
|
-
it('humanizes an iOS text field that contains a password', () => {
|
|
244
|
-
const stepYaml = {
|
|
245
|
-
EnterText: {
|
|
246
|
-
text: 'iWillNeverTell',
|
|
247
|
-
find: {
|
|
248
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
249
|
-
findTarget: {
|
|
250
|
-
selector: {
|
|
251
|
-
android: {},
|
|
252
|
-
iOS: {
|
|
253
|
-
type: 'XCUIElementTypeSecureTextField',
|
|
254
|
-
name: 'Password field',
|
|
255
|
-
label: 'Password field',
|
|
256
|
-
enabled: true,
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
type: 'tap',
|
|
262
|
-
},
|
|
263
|
-
};
|
|
264
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
265
|
-
expect(step.stepDescription()).toEqual(`Enter password in "Password field" element`);
|
|
266
|
-
});
|
|
267
|
-
it('humanizes an android text field that has a hint attribute', () => {
|
|
268
|
-
const stepYaml = {
|
|
269
|
-
Tap: {
|
|
270
|
-
find: {
|
|
271
|
-
findType: domUtil_1.FindType.FIND_ONE,
|
|
272
|
-
findTarget: {
|
|
273
|
-
selector: {
|
|
274
|
-
android: {
|
|
275
|
-
displayed: true,
|
|
276
|
-
resourceId: '',
|
|
277
|
-
package: 'com.polar.android.debug',
|
|
278
|
-
checkable: false,
|
|
279
|
-
clickable: true,
|
|
280
|
-
index: 0,
|
|
281
|
-
focusable: true,
|
|
282
|
-
alternateXPaths: [],
|
|
283
|
-
enabled: true,
|
|
284
|
-
longClickable: false,
|
|
285
|
-
password: false,
|
|
286
|
-
hint: 'Search for the things',
|
|
287
|
-
xpath: '//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.EditText',
|
|
288
|
-
bounds: '[42,616][465,784]',
|
|
289
|
-
focused: false,
|
|
290
|
-
checked: false,
|
|
291
|
-
text: '',
|
|
292
|
-
class: 'android.widget.EditText',
|
|
293
|
-
scrollable: false,
|
|
294
|
-
selected: false,
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
};
|
|
301
|
-
const step = (0, StepTestsUtil_1.loadRawStepIntoMablStep)(stepYaml);
|
|
302
|
-
expect(step.stepDescription()).toEqual(`Tap on "EditText" element with hint "Search for the things"`);
|
|
303
|
-
});
|
|
304
|
-
});
|