Skip to content

nicheinc/wdio-appium-example

Repository files navigation

Appium

This project combines Appium and WebdriverIO to execute end-to-end tests in native apps on iOS and Android.

Setup


Install Android Studio

https://developer.android.com/studio/install

Install Xcode

https://developer.apple.com/xcode/

Install appium

npm i -g appium

Install appium-doctor

npm i -g appium-doctor

As you're addressing issues raised by appium-doctor, make sure to apply these changes in your .bashrc or .zshrc.

Install appium-desktop

https://github.com/appium/appium-desktop/releases

Start appium server

This can be done by opening appium-desktop or running appium from CLI. In either case, use default settings (host: '0.0.0.0', port: '4723')

Start Emulator

Open your preferred emulator (iOS or Android) in Xcode or Android Studio.


Configure capabilities

capabilities are defined in the wdio.conf.* file. These specify the environment we are targeting.

capabilities: [
  {
      platformName: "iOS",
      platformVersion: "11.4",
      deviceName: "iPhone 8",
      app: "/Users/bmurray/Documents/appium/NicheMobileApp.app",
      automationName: "XCUITest"
  },
platform/device

platformName, platformVersion, and deviceName should all match the configuration of your device/emulator.

app

The path set in wdio.conf's capabilities.app is important: this points to the app that you want to run tests on. For Android, any .apk is fine. For iOS, you need a .app to run in an emulator, or an .ipa to run on a device. Note: at the time of this writing, on OS X this path needs to be an absolute path.

automationName

automationName is the driver we're targeting. We're currently using http://appium.io/docs/en/drivers/ios-xcuitest/ and http://appium.io/docs/en/drivers/android-uiautomator2/.


Run tests

To execute tests, reference package.json.

At the time of this writing, you can use npm run test:android or npm run test:ios

App assets

This test suite doesn't run out of the box: as you can see, there is no appium/NicheMobileApp.app file included here.

When CI is integrated to build .apk and .app files we'll want to build off those.

Until then, you can find test files in the Appium assets folder in the QA drive on NicheNAS.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published