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
![image](https://private-user-images.githubusercontent.com/102797648/240484909-47ad7431-58e5-4dc8-ae5c-43212c9487ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTYzNDEsIm5iZiI6MTcyMzg5NjA0MSwicGF0aCI6Ii8xMDI3OTc2NDgvMjQwNDg0OTA5LTQ3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