An open API service indexing awesome lists of open source software.

https://github.com/lynix28/ios-mobileui-appium-wdio-example

iOS Mobile UI Automation Test Project Example with Appium + WebdriverIO
https://github.com/lynix28/ios-mobileui-appium-wdio-example

appium appium-ios automated-testing ios-testing mobile-testing mocha-framework wdio webdriverio

Last synced: about 1 year ago
JSON representation

iOS Mobile UI Automation Test Project Example with Appium + WebdriverIO

Awesome Lists containing this project

README

          

# [MERGED TO OTHER PROJECT]
# iOS MobileUI Automation Test Project Example with Appium & WebdriverIO
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/lynix28/ios-mobileui-appium-wdio-example/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/lynix28/ios-mobileui-appium-wdio-example/tree/master)
[![SauceLabs](https://img.shields.io/badge/integrated%20to-SauceLabs-red)](https://app.saucelabs.com/u/oauth-lynixizunia-7ba4e)

---

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](https://github.com/lynix28/ios-mobileui-appium-wdio-example/assets/102797648/e56c37f0-e265-490b-b062-a54334501278)

SauceLabs Build & Test Status
![image](https://github.com/lynix28/ios-mobileui-appium-wdio-example/assets/102797648/cc8cf331-91cd-4d44-89f8-80204cfb3675)