This project is a test automation suite for an Android Calculator app using WebdriverIO and Appium. It is designed to validate the core functionalities of the Calculator app by performing end-to-end tests on various arithmetic operations. The tests are executed on BrowserStack to ensure compatibility across different devices and configurations. Additionally, tests were also conducted locally using Appium, with a Samsung S8 smartphone. Detailed test results are available through Allure reports for comprehensive analysis.
The following test cases are designed to validate the core functionalities of the Android Calculator app:
Preconditions
Test Case | Description | Steps |
---|---|---|
Addition Test | Adds 1 and 2 and verifies the result is 3 | 1. Clear the calculator. 2. Press 1. 3. Press the addition (+) button. 4. Press 2. 5. Press the equals (=) button. 6. Verify the result is 3. |
Subtraction Test | Subtracts 3 from 4 and verifies the result is 1 | 1. Clear the calculator. 2. Press 4. 3. Press the subtraction (-) button. 4. Press 3. 5. Press the equals (=) button. 6. Verify the result is 1. |
Multiplication Test | Multiplies 5 by 6 and verifies the result is 30 | 1. Clear the calculator. 2. Press 5. 3. Press the multiplication (*) button. 4. Press 6. 5. Press the equals (=) button. 6. Verify the result is 30. |
Division Test | Divides 8 by 2 and verifies the result is 4 | 1. Clear the calculator. 2. Press 8. 3. Press the division (/) button. 4. Press 2. 5. Press the equals (=) button. 6. Verify the result is 4. |
Percentage Calculation Test | Calculates 10% of 90 and verifies the result is 9 | 1. Clear the calculator. 2. Press 1. 3. Press 0. 4. Press the percentage (%) button. 5. Press 9. 6. Press 0. 7. Press the equals (=) button. 8. Verify the result is 9. |
Change Sign Test | Changes the sign of the number and verifies the result | 1. Clear the calculator. 2. Press 5. 3. Press the plus/minus (±) button. 4. Verify the result is -5. |
The test automation suite was executed both locally using Appium and on BrowserStack for cross-device compatibility.
Detailed test results, including screenshots and logs, are available through Allure reports. Below is a sample screenshot of the Allure report:
Tests were also run on BrowserStack, and you can view the detailed results and logs through the following public link: BrowserStack Test Results
To get started with the project, follow these steps to set up your environment and install all necessary dependencies:
git clone https://github.com/gadiim/mobile_native_application_testing.git
cd mobile_native_application_testing
npm install
Note: The provided APK file works with the current project configuration. If you download a different APK file, you will need to update the project configuration to match the APK file’s requirements.
adb install path/to/your/calculator.apk
path/to/your/calculator.apk
with the actual path to your APK file..env
file in the root of the project.BROWSERSTACK_USERNAME=your_browserstack_username
BROWSERSTACK_ACCESS_KEY=your_browserstack_access_key
BROWSERSTACK_ANDROID_APP_ID=your_browserstack_android_app_id
Ensure Device Requirements:
- Verify the device meets the necessary requirements for testing.
Follow these instructions to run the tests both locally and on BrowserStack.
#### Running Tests Locally Ensure you have your device or emulator ready.
npm run test
#### Running Tests on BrowserStack Set up environment variables as described in the Installation section.
npm run test:bs
#### Generate Allure Reports
npm run allure:generate
npm run allure
mobile_native_application_testing/
├── .github/
│ └── workflows/
│ └── ci.yml -- GitHub Actions CI workflow
├── config/
│ ├── wdio.conf.android.bs.ts -- Configuration for BrowserStack
│ └── wdio.conf.android.ts -- Local configuration
│ └── wdio.conf.ts -- Common WebdriverIO configuration
├── test/
│ ├── specs/
│ │ └── test.e2e.ts -- End-to-end test cases for the calculator
│ └── pageobjects/
│ └── calculator.ts -- Page object methods for the calculator
├── reporters/ -- Directory for Allure and other reports
│ ├── allure-results/ -- Allure results
├── .gitignore -- Git ignore file
├── package.json -- Project dependencies and scripts
├── tsconfig.json -- TypeScript configuration
└── README.md -- Project documentation
This project is licensed under the MIT License. You are free to use, modify, and distribute this project. See the LICENSE file for more details.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.