Skip to content

Appium: Method closeApp() is allowed for iOS only, though it works with Android #2849

Closed

Description

@mirao

What are you trying to achieve?

I want to use I.closeApp() in an Appium test against Android device.
Appium docs for closeApp() says that it's allowed on Android/UiAutomator

What do you get instead?

CodeceptJS allows it for iOS only.
node_modules/codeceptjs/docs/build/Appium.js:

  /**
   * Close the given application.
   *
   * ```js
   * I.closeApp();
   * ```
   *
   * Appium: support only iOS
   */
  async closeApp() {
    onlyForApps.call(this, 'iOS');
    return this.browser.closeApp();
  }

Note that I created the same method (without blocking of Android platform) in my custom helper and it works well with Android:

async closeApp() {
    const browser = this.helpers["Appium"].browser;
    await browser.closeApp();
}

Details

  • CodeceptJS version: 3.0.5
  • NodeJS Version: v12.21.0
  • Operating System: Ubuntu 20.04
  • Appium 1.15.1
  • Android Studio 4.1.3 emulator Nexus 9 (Android 9)

Activity

  1. mirao commented on Mar 24, 2021

    @mirao
    ContributorAuthor

    Also CodeceptJS docs says that only iOS is supported: https://codecept.io/helpers/Appium.html#closeapp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions