-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathutils.js
792 lines (707 loc) · 20.9 KB
/
utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
/**
* External dependencies
*/
const childProcess = require( 'child_process' );
// eslint-disable-next-line import/no-extraneous-dependencies, import/named
import { remote, Key } from 'webdriverio';
// TODO: Replace usage of wd in favor of WebdriverIO
const wd = null;
const crypto = require( 'crypto' );
const path = require( 'path' );
/**
* Internal dependencies
*/
const serverConfigs = require( './serverConfigs' );
const {
iosServer,
iosLocal,
android,
sauceOptions,
prefixKeysWithAppium,
} = require( './caps' );
const AppiumLocal = require( './appium-local' );
// Platform setup.
const defaultPlatform = 'android';
const rnPlatform = process.env.TEST_RN_PLATFORM || defaultPlatform;
const iPadDevice = process.env.IPAD;
// Environment setup, local environment or Sauce Labs.
const defaultEnvironment = 'local';
const testEnvironment = process.env.TEST_ENV || defaultEnvironment;
// Local App Paths.
const defaultAndroidAppPath =
'./android/app/build/outputs/apk/debug/app-debug.apk';
const defaultIOSAppPath =
'./ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app';
const webDriverAgentPath = process.env.WDA_PATH || './ios/build/WDA';
const localAndroidAppPath =
process.env.ANDROID_APP_PATH || defaultAndroidAppPath;
const localIOSAppPath = process.env.IOS_APP_PATH || defaultIOSAppPath;
const localAppiumPort = serverConfigs.local.port; // Port to spawn appium process for local runs.
let appiumProcess;
const backspace = '\u0008';
// $block-edge-to-content value
const blockEdgeToContent = 16;
const IOS_BUNDLE_ID = 'org.wordpress.gutenberg.development';
const ANDROID_COMPONENT_NAME = 'com.gutenberg/.MainActivity';
const SAUCE_LABS_TIMEOUT = 240;
const timer = ( ms ) => new Promise( ( res ) => setTimeout( res, ms ) );
const isAndroid = () => {
return rnPlatform.toLowerCase() === 'android';
};
const isLocalEnvironment = () => {
return testEnvironment.toLowerCase() === 'local';
};
const getIOSPlatformVersions = ( { requiredVersion } ) => {
const { runtimes = [] } = JSON.parse(
childProcess.execSync( 'xcrun simctl list runtimes --json' ).toString()
);
const majorVersion = requiredVersion.split( '.' )[ 0 ];
return runtimes
.reverse()
.filter(
( { name, isAvailable, version } ) =>
name.startsWith( 'iOS' ) &&
new RegExp( `^${ majorVersion }(\\.\\d+)*$` ).test( version ) &&
isAvailable
);
};
const PLATFORM_NAME = isAndroid() ? 'Android' : 'iOS';
// Initialises the driver and desired capabilities for appium.
const setupDriver = async () => {
const branch = process.env.CIRCLE_BRANCH || '';
const safeBranchName = branch.replace( /\//g, '-' );
if ( isLocalEnvironment() ) {
try {
appiumProcess = await AppiumLocal.start( {
port: localAppiumPort,
} );
} catch ( err ) {
// Ignore error here, Appium is probably already running (Appium Inspector has its own server for instance)
// eslint-disable-next-line no-console
await console.log(
'Could not start Appium server',
err.toString()
);
}
}
let desiredCaps;
if ( isAndroid() ) {
desiredCaps = { ...android };
if ( isLocalEnvironment() ) {
desiredCaps.app = path.resolve( localAndroidAppPath );
try {
const androidVersion = childProcess
.execSync( 'adb shell getprop ro.build.version.release' )
.toString()
.replace( /^\s+|\s+$/g, '' );
delete desiredCaps.platformVersion;
desiredCaps.deviceName = 'Android Emulator';
// eslint-disable-next-line no-console
console.log(
'Detected Android device running Android %s',
androidVersion
);
} catch ( error ) {
// Ignore error.
}
} else {
desiredCaps.app = `storage:filename=Gutenberg-${ safeBranchName }.apk`; // App should be preloaded to sauce storage, this can also be a URL.
desiredCaps.newCommandTimeout = SAUCE_LABS_TIMEOUT;
}
} else {
desiredCaps = iosServer( { iPadDevice } );
desiredCaps.newCommandTimeout = SAUCE_LABS_TIMEOUT;
desiredCaps.app = `storage:filename=Gutenberg-${ safeBranchName }.app.zip`; // App should be preloaded to sauce storage, this can also be a URL.
if ( isLocalEnvironment() ) {
desiredCaps = iosLocal( { iPadDevice } );
const iosPlatformVersions = getIOSPlatformVersions( {
requiredVersion: desiredCaps.platformVersion,
} );
if ( iosPlatformVersions.length === 0 ) {
throw new Error(
`No compatible iOS simulators available! Please verify that you have iOS ${ desiredCaps.platformVersion } simulators installed.`
);
}
// eslint-disable-next-line no-console
console.log(
'Available iOS platform versions:',
iosPlatformVersions.map( ( { name } ) => name )
);
if ( ! desiredCaps.platformVersion ) {
desiredCaps.platformVersion = iosPlatformVersions[ 0 ].version;
// eslint-disable-next-line no-console
console.log(
`Using iOS ${ desiredCaps.platformVersion } platform version`
);
}
desiredCaps.app = path.resolve( localIOSAppPath );
desiredCaps.derivedDataPath = path.resolve( webDriverAgentPath );
}
}
const sauceOptionsConfig = ! isLocalEnvironment()
? {
'sauce:options': {
...sauceOptions,
name: `Gutenberg Editor Tests[${ rnPlatform }]-${ branch }`,
tags: [ 'Gutenberg', branch ],
},
}
: {};
const serverConfig = isLocalEnvironment()
? serverConfigs.local
: serverConfigs.sauce;
const driver = await remote( {
...serverConfig,
logLevel: 'error',
capabilities: {
platformName: PLATFORM_NAME,
...prefixKeysWithAppium( desiredCaps ),
...sauceOptionsConfig,
},
} );
await driver.setOrientation( 'PORTRAIT' );
return driver;
};
const stopDriver = async ( driver ) => {
if ( ! isLocalEnvironment() ) {
const sessionId = driver.sessionId;
const secret = `${ serverConfigs.sauce.user }:${ serverConfigs.sauce.key }`;
const token = crypto
.createHmac( 'md5', secret )
.update( sessionId )
.digest( 'hex' );
const jobURL = `https://app.saucelabs.com/tests/${ sessionId }?auth=${ token }`;
// eslint-disable-next-line no-console
console.log( `You can view the video of this test run at ${ jobURL }` );
}
if ( driver === undefined ) {
return;
}
await driver.deleteSession();
if ( appiumProcess !== undefined ) {
await AppiumLocal.stop( appiumProcess );
}
};
const typeString = async ( driver, element, str, clear ) => {
if ( isKeycode( str ) ) {
const keyCode = isAndroid() ? getKeycode( str ) : str;
return await pressKeycode( driver, keyCode );
}
if ( clear ) {
await element.clearValue();
}
await element.addValue( str );
if ( ! isAndroid() ) {
// Await the completion of the scroll-to-text-input animation
await driver.pause( 3000 );
}
};
const doubleTap = async ( driver, element ) => {
const action = new wd.TouchAction( driver );
action.tap( { el: element, count: 2 } );
await action.perform();
};
/**
* Returns the mapped keycode for a string to use in `pressKeycode` function.
*
* @param {string} str String associated to a keycode
*/
const getKeycode = ( str ) => {
if ( isAndroid() ) {
// On Android, we map keycodes using Android values.
// Reference: https://developer.android.com/reference/android/view/KeyEvent.html
return {
'\n': 66,
[ backspace ]: 67,
}[ str ];
}
// On iOS, we map keycodes using the special keys defined in WebdriverIO.
// Reference: https://webdriver.io/docs/api/browser/action/#special-characters
return {
'\n': Key.Enter,
[ backspace ]: Key.Backspace,
}[ str ];
};
/**
* Determines if the string is mapped to a keycode.
*
* @param {string} str String potentially associated to a keycode
*/
const isKeycode = ( str ) => {
return !! getKeycode( str );
};
/**
* Presses the specified keycode.
*
* @param {*} driver WebDriver instance
* @param {*} keycode Keycode to press
*/
const pressKeycode = async ( driver, keycode ) => {
if ( isAndroid() ) {
// `pressKeyCode` command is only implemented on Android
return await driver.pressKeyCode( keycode );
}
// `sendKeys` command only works on iOS. On Android, executing this
// results in typing a special character instead.
return await driver.sendKeys( [ keycode ] );
};
// Calculates middle x,y and clicks that position
const clickMiddleOfElement = async ( driver, element ) => {
const location = await element.getLocation();
const size = await element.getSize();
const action = await new wd.TouchAction( driver );
action.press( { x: location.x + size.width / 2, y: location.y } );
action.release();
await action.perform();
};
// Clicks in the top left of an element.
const clickBeginningOfElement = async ( driver, element ) => {
const location = await element.getLocation();
const action = await new wd.TouchAction( driver );
action.press( { x: location.x, y: location.y } );
action.release();
await action.perform();
};
// Clicks in the top left of a text-based element outside of the TextInput
const clickElementOutsideOfTextInput = async ( driver, element ) => {
const location = await element.getLocation();
const y = isAndroid() ? location.y - blockEdgeToContent : location.y;
const x = isAndroid() ? location.x - blockEdgeToContent : location.x;
const action = new wd.TouchAction( driver ).press( { x, y } ).release();
await action.perform();
};
// Long press to activate context menu.
const longPressMiddleOfElement = async (
driver,
element,
waitTime = 5000, // Setting to wait a bit longer because this is failing more frequently on the CI
customElementSize
) => {
const location = await element.getLocation();
const size = customElementSize || ( await element.getSize() );
const x = location.x + size.width / 2;
const y = location.y + size.height / 2;
const action = new wd.TouchAction( driver )
.longPress( { x, y } )
.wait( waitTime )
.release();
await action.perform();
};
// Press "Select All" in floating context menu.
const tapSelectAllAboveElement = async ( driver, element ) => {
const location = await element.getLocation();
const action = await new wd.TouchAction( driver );
const x = location.x + 300;
const y = location.y - 50;
action.press( { x, y } );
action.release();
await action.perform();
};
// Press "Copy" in floating context menu.
const tapCopyAboveElement = async ( driver, element ) => {
const location = await element.getLocation();
const action = await new wd.TouchAction( driver );
const x = location.x + 220;
const y = location.y - 50;
action.wait( 2000 );
action.press( { x, y } );
action.wait( 2000 );
action.release();
await action.perform();
};
// Press "Paste" in floating context menu.
const tapPasteAboveElement = async ( driver, element ) => {
await longPressMiddleOfElement( driver, element );
if ( isAndroid() ) {
const location = await element.getLocation();
const action = await new wd.TouchAction( driver );
action.wait( 2000 );
action.press( { x: location.x + 100, y: location.y - 50 } );
action.wait( 2000 );
action.release();
await action.perform();
} else {
const pasteButtonLocator = '//XCUIElementTypeMenuItem[@name="Paste"]';
await clickIfClickable( driver, pasteButtonLocator );
await driver.sleep( 3000 ); // Wait for paste notification to disappear.
}
};
const tapStatusBariOS = async ( driver ) => {
await driver.touchPerform( [
{
action: 'press',
options: { x: 20, y: 20 },
},
{
action: 'wait',
options: {
ms: 100,
},
},
{
action: 'release',
options: {},
},
] );
// Wait for the scroll animation to finish
await driver.pause( 3000 );
};
const selectTextFromElement = async ( driver, element ) => {
if ( isAndroid() ) {
await longPressMiddleOfElement( driver, element, 0 );
} else {
await doubleTap( driver, element );
await driver.waitForElementByXPath(
'//XCUIElementTypeMenuItem[@name="Copy"]',
wd.asserters.isDisplayed,
4000
);
}
};
// Starts from the middle of the screen or the element(if specified)
// and swipes upwards.
const swipeUp = async (
driver,
element = undefined,
delay = 3000,
endYCoefficient = 0.5
) => {
let size = await driver.getWindowSize();
let y = 0;
if ( element !== undefined ) {
size = await element.getSize();
const location = await element.getLocation();
y = location.y;
}
const startX = size.width / 2;
const startY = y + size.height / 3;
const endX = startX;
const endY = startY + startY * -1 * endYCoefficient;
await swipeFromTo(
driver,
{ x: startX, y: startY },
{ x: endX, y: endY },
delay
);
};
const defaultCoordinates = { x: 0, y: 0 };
const swipeFromTo = async (
driver,
from = defaultCoordinates,
to = defaultCoordinates,
delay
) =>
driver.touchPerform( [
{
action: 'press',
options: from,
},
{
action: 'wait',
options: {
ms: delay,
},
},
{
action: 'moveTo',
options: to,
},
{
action: 'release',
options: {},
},
] );
// Starts from the middle of the screen and swipes downwards
const swipeDown = async ( driver, delay = 3000 ) => {
const size = await driver.getWindowSize();
const y = 0;
const startX = size.width / 2;
const startY = y + size.height / 3;
const endX = startX;
const endY = startY - startY * -1 * 0.5;
await swipeFromTo(
driver,
{ x: startX, y: startY },
{ x: endX, y: endY },
delay
);
};
// Drag & Drop after element
const dragAndDropAfterElement = async ( driver, element, nextElement ) => {
// Element to drag & drop
const elementLocation = await element.getLocation();
const elementSize = await element.getSize();
const x = elementLocation.x + elementSize.width / 2;
const y = elementLocation.y + elementSize.height / 2;
// Element to drag & drop to
const nextElementLocation = await nextElement.getLocation();
const nextElementSize = await nextElement.getSize();
const nextYPosition = isAndroid()
? elementLocation.y + nextElementLocation.y + nextElementSize.height
: nextElementLocation.y + nextElementSize.height;
const action = new wd.TouchAction( driver )
.press( { x, y } )
.wait( 5000 )
.moveTo( { x, y: nextYPosition } )
.release();
await action.perform();
};
const toggleHtmlMode = async ( driver, toggleOn ) => {
if ( isAndroid() ) {
const moreOptionsButton = await driver.$( '~More options' );
await moreOptionsButton.click();
const showHtmlButtonXpath =
'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ListView/android.widget.TextView[9]';
await clickIfClickable( driver, showHtmlButtonXpath );
} else if ( toggleOn ) {
const moreOptionsButton = await driver.$( '~editor-menu-button' );
await moreOptionsButton.click();
await clickIfClickable(
driver,
'//XCUIElementTypeButton[@name="Switch to HTML"]'
);
} else {
// This is to wait for the clipboard paste notification to disappear, currently it overlaps with the menu button
await driver.pause( 3000 );
const moreOptionsButton = await driver.$( '~editor-menu-button' );
await moreOptionsButton.click();
await clickIfClickable(
driver,
'//XCUIElementTypeButton[@name="Switch To Visual"]'
);
}
};
const toggleOrientation = async ( driver ) => {
const orientation = await driver.getOrientation();
if ( orientation === 'LANDSCAPE' ) {
await driver.setOrientation( 'PORTRAIT' );
} else {
await driver.setOrientation( 'LANDSCAPE' );
}
};
/**
* Toggle the device dark mode.
*
* @param {Object} driver Driver
* @param {boolean} darkMode Whether to enable dark mode or not
*/
const toggleDarkMode = ( driver, darkMode = true ) => {
if ( isAndroid() ) {
return driver.execute( 'mobile: shell', [
{
command: `cmd uimode night ${ darkMode ? 'yes' : 'no' }`,
},
] );
}
return driver.execute( 'mobile: setAppearance', {
style: darkMode ? 'dark' : 'light',
} );
};
const isEditorVisible = async ( driver ) => {
const postTitleLocator = isAndroid()
? `//android.widget.EditText[contains(@content-desc, "Post title")]`
: `(//XCUIElementTypeScrollView/XCUIElementTypeOther/XCUIElementTypeOther[contains(@name, "Post title")])`;
await driver.$( postTitleLocator ).waitForDisplayed( { timeout: 30000 } );
};
const waitForMediaLibrary = async ( driver ) => {
const accessibilityIdXPathAttrib = isAndroid() ? 'content-desc' : 'name';
const accessibilityId = 'WordPress Media Library';
const locator = `//*[@${ accessibilityIdXPathAttrib }="${ accessibilityId }"]`;
await waitForVisible( driver, locator );
};
/**
* @param {string} driver
* @param {string} elementLocator
* @param {number} maxIteration - Default value is 25
* @param {string} elementToReturn - Options are allElements, lastElement, firstElement. Defaults to "firstElement"
* @param {number} iteration - Default value is 0
* @return {string} - Returns the first element found, empty string if not found
*/
const waitForVisible = async (
driver,
elementLocator,
maxIteration = 25,
elementToReturn = 'firstElement',
iteration = 0
) => {
const timeout = 1000;
if ( iteration >= maxIteration ) {
// if element not found, print error and return empty string
// eslint-disable-next-line no-console
console.error(
`"${ elementLocator }" is still not visible after ${ iteration } retries!`
);
return '';
} else if ( iteration !== 0 ) {
// wait before trying to locate element again
await driver.pause( timeout );
}
const elements = await driver.$$( elementLocator );
if ( elements.length === 0 ) {
// if locator is not visible, try again
return waitForVisible(
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration + 1
);
}
switch ( elementToReturn ) {
case 'allElements':
return elements;
case 'lastElement':
return elements[ elements.length - 1 ];
default:
// Default is to return first element
return elements[ 0 ];
}
};
/**
* @param {string} driver
* @param {string} elementLocator
* @param {number} maxIteration - Default value is 25, can be adjusted to be less to wait for element to not be visible
* @param {string} elementToReturn - Options are allElements, lastElement, firstElement. Defaults to "firstElement"
* @return {boolean} - Returns true if element is found, false otherwise
*/
const isElementVisible = async (
driver,
elementLocator,
maxIteration = 25,
elementToReturn = 'firstElement'
) => {
const element = await waitForVisible(
driver,
elementLocator,
maxIteration,
elementToReturn
);
// if there is no element, return false
if ( ! element ) {
return false;
}
return true;
};
const clickIfClickable = async (
driver,
elementLocator,
maxIteration = 25,
elementToReturn = 'firstElement',
iteration = 0
) => {
const element = await waitForVisible(
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration
);
try {
return await element.click();
} catch ( error ) {
if ( iteration >= maxIteration ) {
// eslint-disable-next-line no-console
console.error(
`"${ elementLocator }" still not clickable after "${ iteration }" retries`
);
return '';
}
return clickIfClickable(
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration + 1
);
}
};
// Only for Android
const waitIfAndroid = async () => {
if ( isAndroid() ) {
await editorPage.driver.sleep( 1000 );
}
};
/**
* Content type definitions.
* Note: Android only supports plaintext.
*
* @typedef {"plaintext" | "image" | "url"} ClipboardContentType
*/
/**
* Helper to set content in the clipboard.
*
* @param {Object} driver Driver
* @param {string} content Content to set in the clipboard
* @param {ClipboardContentType} contentType Type of the content
*/
const setClipboard = async ( driver, content, contentType = 'plaintext' ) => {
const base64String = Buffer.from( content ).toString( 'base64' );
await driver.setClipboard( base64String, contentType );
};
/**
* Helper to clear the clipboard
*
* @param {Object} driver Driver
* @param {ClipboardContentType} contentType Type of the content
*/
const clearClipboard = async ( driver, contentType = 'plaintext' ) => {
await driver.setClipboard( '', contentType );
};
const launchApp = async ( driver, initialProps = {} ) => {
if ( isAndroid() ) {
await driver.execute( 'mobile: startActivity', {
component: ANDROID_COMPONENT_NAME,
stop: true,
extras: [
[
's',
'initialProps',
`'${ JSON.stringify( initialProps ) }'`,
],
],
} );
} else {
await driver.execute( 'mobile: terminateApp', {
bundleId: IOS_BUNDLE_ID,
} );
await driver.execute( 'mobile: launchApp', {
bundleId: IOS_BUNDLE_ID,
arguments: [ 'uitesting', JSON.stringify( initialProps ) ],
} );
}
};
module.exports = {
backspace,
clearClipboard,
clickBeginningOfElement,
clickElementOutsideOfTextInput,
clickIfClickable,
clickMiddleOfElement,
doubleTap,
dragAndDropAfterElement,
isAndroid,
isEditorVisible,
isElementVisible,
isLocalEnvironment,
launchApp,
longPressMiddleOfElement,
selectTextFromElement,
setClipboard,
setupDriver,
stopDriver,
swipeDown,
swipeFromTo,
swipeUp,
tapCopyAboveElement,
tapPasteAboveElement,
tapSelectAllAboveElement,
tapStatusBariOS,
timer,
toggleDarkMode,
toggleHtmlMode,
toggleOrientation,
typeString,
waitForMediaLibrary,
waitForVisible,
waitIfAndroid,
};