Skip to content

iOS Mobile UI Automation Test Project Example with Appium + WebdriverIO

Notifications You must be signed in to change notification settings

lynix28/ios-mobileui-appium-wdio-example

Repository files navigation

[MERGED TO OTHER PROJECT]

iOS MobileUI Automation Test Project Example with Appium & WebdriverIO

CircleCI SauceLabs


This project example is merged to: https://github.com/lynix28/mobileui-appium-wdio-example

For further update check on the new repo


Requirements

  • NodeJS
  • Appium Server
  • Appium Inspector (to find selector)
  • XCode (for iOS Simulator)
  • Demo App (for testing sample) by Sauce Labs

Node Modules

  • WebdriverIO
  • Mocha (for Test Framework)
  • Allure (for Test Reporting)
  • Chai (for Assessment)
  • Sauce Labs (for Test on Cloud)
  • Dotenv

Setup with `package.json`

  • npm install

Setup manually

  • npm init -y
  • npm install @wdio/cli
  • ./node_modules/.bin/wdio config -> for quick setup or continue to install the following module below.
  • npm install @wdio/local-runner
  • npm install @wdio/appium-service
  • npm install @wdio/sauce-service
  • npm install @wdio/mocha-framework
  • npm install @wdio/allure-reporter
  • npm install dotenv
  • npm install chai

Setup WDA to Simulator | webdriveragent

  • npm install --save-dev appium@next
  • ./node_modules/.bin/appium driver install xcuitest -> install Appium driver for iOS testing
  • Run Appium Server
  • Run Appium Inspector and try to connect to the Simulator (It will take quite long)
  • If success accessing the Simulator by Appium Inspector, then the WDA is completely installed

To compile the test result

  • npm install --save-dev allure-commandline
  • ./node_modules/.bin/allure generate [allure_output_dir] && ./node_modules/.bin/allure open (edit the 'allure_output_dir' with your directory)

or follow this instruction to make it automatically -> https://webdriver.io/docs/allure-reporter#autogenerate-report

To run the test

Command Description
npm run test Run all tests
npm run test -- --suite SuiteName Run a specific Test Suite Bundle (need to define it inside 'wdio.conf.js')
npm run test -- --spec ./path/to/file/FileName Run a specific Test Case / Suite (need to define it inside 'wdio.conf.js')

Common issue that probably occured after the setup

If u get this error Error: "ts-node/esm/transpile-only 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include 'shortCircuit: true' in the hook's return.

try to fix it with npm install --save-dev ts-node

To check the report

  • npm run report

How the report look like?

Allure Report image

SauceLabs Build & Test Status image