An example project about Mobile automation (Android & iOS) testing using WebdriverIO. The test examples are created in Mocha Framework and Cucumber Framework.
- NodeJS
- Appium Server
- Appium Inspector (to find selector)
- Android Studio (for device emulator)
- Xcode (for iOS Simulator)
- Demo App (for testing sample) by Sauce Labs
- WebdriverIO Packages
- Mocha and Cucumber as Test Framework
- Allure as Test Reporter
- Appium Server as a service to run the test
- Appium Driver (
uiautomator2
&xcuitest
) sauce-service
to run the test on Sauce Labs cloud service
- Clone the project
Runnpm install
- all the test
npm run test-android
ornpm run test-android-bdd
- specific spec / test file
npm run test-android -- --spec ./to/file/location.js
ornpm run test-android-bdd -- --spec ./to/file/location.feature
- specific suite / test suite
npm run test-android -- --suite "suiteName"
- specific test case
npm run test-android -- --spec ./to/file/location.js --mochaOpts.grep "testcase name or testing tag"
npm run test-android -- --suite "suiteName" --mochaOpts.grep "testcase name or testing tag"
- all the test
npm run test-ios
- specific spec / test file
npm run test-ios -- --spec ./to/file/location.js
- specific suite / test suite
npm run test-ios -- --suite "suiteName"
- specific test case
npm run test-ios -- --spec ./to/file/location.js --mochaOpts.grep "testcase name or testing tag"
npm run test-ios -- --suite "suiteName" --mochaOpts.grep "testcase name or testing tag"
-
Appium doesn't start automatically during the test (in local)
- to solve the issue, just run the Appium server manually and re-run your test.
-
WDA (web driver agent) is not installed in iOS Simultor when tried to run the test
- to solve the issue, try to run Appium Inspector and access the Simulator, It might take some time for the first time but once the WDA is installed, the test / inspection will run normal.
use npm run report
to open the test report