You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {object} [options] Options for closing the app (optional)
28
+
* @param {string} [options.bundleId] The bundle ID of the iOS app to close. If not provided, the currently active app is closed. <br /><strong>iOS-ONLY</strong>
29
+
* @param {string} [options.appId] The package name of the Android app to close. If not provided, the currently active app is closed. <br /><strong>ANDROID-ONLY</strong>
30
+
*
16
31
* @support ["ios","android"]
17
32
*/
18
33
exportasyncfunctioncloseApp(
19
-
this: WebdriverIO.Browser
34
+
this: WebdriverIO.Browser,
35
+
options?: {
36
+
bundleId?: string
37
+
appId?: string
38
+
}
20
39
){
21
40
constbrowser=this
22
41
23
42
if(!browser.isMobile){
24
43
thrownewError('The `closeApp` command is only available for mobile platforms.')
* @param {string} link The deep link URL that should be opened in the mobile app. It should be a valid deep link URL (e.g. `myapp://path`). If it's a universal deep link, which can be used for iOS, use the `browser.url("your-url")`-method.
20
-
* @param {string} appIdentifier The value of the `package` (Android) or `bundleId` (iOS) of the app that the deep link should open.
23
+
* @param {string} link The deep link URL that should be opened in the mobile app. It should be a valid deep link URL (e.g. `myapp://path`). If it's a universal deep link, which can be used for iOS, use the `browser.url("your-url")`-method.
24
+
* @param {string} appIdentifier The value of the `package` (Android) or `bundleId` (iOS) of the app that the deep link should open.
25
+
* @param {boolean} [waitForLaunch] Whether to wait for the app to launch after opening the deep link. Default is `true`. <br /><strong>ANDROID-ONLY</strong>
21
26
*
22
27
* @support ["ios","android"]
23
28
*/
24
29
exportasyncfunctiondeepLink(
25
30
this: WebdriverIO.Browser,
26
31
link: string,
27
-
appIdentifier: string
32
+
appIdentifier: string,
33
+
waitForLaunch?: boolean
28
34
){
29
35
constbrowser=this
30
36
@@ -43,10 +49,16 @@ export async function deepLink(
43
49
thrownewError(`When using a deep link URL for ${mobileOS}, you need to provide the \`${identifierValue}\` of the app that the deep link should open.`)
it('should activate the currently active app', async () => {
29
+
// Automatically detect and activate the current app
12
30
await browser.launchApp()
13
31
})
14
32
* </example>
15
33
*
34
+
* @param {object} [options] Options for launching the app (optional)
35
+
* @param {string} [options.bundleId] The bundle ID of the iOS app to launch. If not provided, the currently active app is used. <br /><strong>iOS-ONLY</strong>
36
+
* @param {string|string[]} [options.arguments] Command line arguments to pass to the app on launch. <br /><strong>iOS-ONLY</strong>
37
+
* @param {object} [options.environment] Environment variables to set when launching the app (key-value pairs). <br /><strong>iOS-ONLY</strong>
38
+
* @param {string} [options.appId] The package name of the Android app to activate. If not provided, the currently active app is used. <br /><strong>ANDROID-ONLY</strong>
39
+
*
16
40
* @support ["ios","android"]
17
41
*/
18
42
exportasyncfunctionlaunchApp(
19
-
this: WebdriverIO.Browser
43
+
this: WebdriverIO.Browser,
44
+
options?: {
45
+
bundleId?: string
46
+
arguments?: string|string[]
47
+
environment?: Record<string,string>
48
+
appId?: string
49
+
}
20
50
){
21
51
constbrowser=this
22
52
23
53
if(!browser.isMobile){
24
54
thrownewError('The `launchApp` command is only available for mobile platforms.')
* @param {string} keycode The keycode to send (as a string, e.g. '3' for Home)
21
-
* @param {string} [metastate] Meta state to press the keycode with (e.g. '1' for Shift)
22
+
* @param {string} keycode The keycode to send (as a string, e.g. `'3'` for Home). See [Android KeyEvent](https://developer.android.com/reference/android/view/KeyEvent) for all available keycodes.
23
+
* @param {string} [metastate] The meta state to apply during the key press as a string (e.g. `'1'` for Shift). See [Android KeyEvent](https://developer.android.com/reference/android/view/KeyEvent) for all meta state values.
22
24
*
23
25
* @support ["android"]
24
26
*/
@@ -38,7 +40,11 @@ export async function sendKeyEvent(
0 commit comments