Currently, this framework has been developed to run scripts in ANDROID platform with an emulator. The calculator app APK used in this project can be found at: https://m.apkpure.com/calculator/com.google.android.calculator
- Appium - This is the node server which interacts with the mobile devices
- WebdriverIO - It is the selenium webdriver api bindings for node.js, It has a very simple api which could be used to automate web & browser apps in a fast and scalable way.
- JavaScript - (JS) is a lightweight interpreted (or just-in-time compiled) programming language with first-class functions.
-
NodeJS is installed globally in the system. https://nodejs.org/en/download/
-
JAVA(jdk) installed in the system.
-
Andriod(sdk) installed in the system.
-
Set JAVA_HOME & ANDROID_HOME paths correctly in the system.
Tip: Install npm install -g appium-doctor
and run it from the command-line which checks if your java jdk and android sdk paths are set correctly or not.
Clone the repository into a folder
Go inside the folder and run the following command from terminal/command prompt
npm install
All the dependencies from package.json would be installed in node_modules folder.
You will first need to create and open an Android emulator (https://developer.android.com/studio/run/managing-avds) to match with the current capabilities set in config.js. Or change it accordingly with whichever emulator or real device you'd like to use.
capabilities: [
{
platformName: "Android",
"appium:deviceName": "Pixel 7",
"appium:platformVersion": "13.0",
"appium:automationName": "UiAutomator2",
"appium:app": path.join(
process.cwd(),
"./app/android/Calculator_8.4.1.apk"
),
},
],
To run the tests:
npx wdio
or npm run wdio
Kapture.2023-09-22.at.13.28.06.mp4
Currently, this project has been integrated with Allure-Reports. WebdriverIO's Allure Reporter helps us generate detailed reports of our mobile automated tests. Once the test execution is finished you will find the allure-results folder generated automatically with screenshots of the failure attached. Then you would have to run the following command to generate an HTML Report
npx allure generate allure-results --clean && npx allure open