Appium, WebdriverIO, Mocha, JavaScript, Allure
- Node.js and NPM
- Java +8
- Android SDK +16 (Android Emulator and Command line tools)
- Android Studio
- Start "Android Studio" and start your virtual device from "Virtual Device Manager" page
- Add your virtual device's capabilities within the WebdriverIO config in
wdio.conf.js
file - Open terminal and install dependencies by running command
npm install
- Run test using command
npm test
- Generate the HTML test report using
npm run report
- An HTML test report will be generated and opened using Allure
- Get list devices using command
xcrun xctrace list devices
- Get list installed apps using command
xcrun simctl listapps {{udid}}
npm init -y
on project pathnpm install @wdio/cli appium allure-commandline --save-dev
npm install -g appium
npx wdio config -y
and select appium driver- Setup capabilities on
wdio.conf.js
- Setup Device Emulator on Android Studio
- Install and run
appium-doctor
- After setting up device in Android Studio, install and open Appium Inspector
- Set remote path as
/wd/hub
- Start appium server with
appium
command - Set Desired Capabilities e.g. For Android:
{
"platformName": "Android",
"appium:platformVersion": "13.0",
"appium:deviceName": "Pixel_3a",
"appium:automationName": "UIAutomator2",
"appium:autoGrantPermissions": true,
"appium:udid": "emulator-5554",
"appium:app": "C:\\demo\\wdio-appium-test\\apk\\NativeDemoApp.apk",
"appium:appPackage": "com.wdiodemoapp",
"appium:appActivity": "com.wdiodemoapp.MainActivity"
}
For iOS:
capabilities: [{
'appium:platformName': 'iOS',
'appium:automationName': 'XCUITest',
'appium:platformVersion': '16.4',
'appium:deviceName': 'iPhone 14 Pro Simulator',
'appium:udid':'072599DA-1969-45AB-AB8D-A1871ABA2B8D',
'appium:bundleId': 'com.saucelabs.SwagLabsMobileApp',
'appium:noReset': true
}],
- Start Session on Appium Inspector
- Element locators should be displayed on the side panel once you start interacting with the mobile app on Android Emulator
- Start Android Studio
npm install
npm test
npm run report