danielandrioli / appiumSauceLabsApp

UI automated tests on Android OS using Appium. Sauce Labs demo app was used.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automated GUI tests with Appium πŸ“±πŸ€–

This project is part of my Appium learning.
For my tests, I used Sauce Labs demo app on Android OS. This app is open source, and you can check it here: https://github.com/saucelabs/my-demo-app-android/releases
Feel free to fork this project and create additional tests. Don't forget to leave a star ⭐


πŸ‘¨πŸ»β€πŸ’» Technology Stack:

  • Programming language - Java (JDK 19)
  • Automation framework - Appium 2.1.3
  • Testing framework - TestNG
  • Project management tool - Maven

🎨 Design Patterns:

  • Page Object Model (through Page Factory)
  • Fluent Page

πŸ§ͺ Tests:

  • Login functionality
    S1: Login using valid credentials should succeed
    S2: Login using invalid credentials should fail
    S3: Logout should redirect to the login page

  • Catalog's filter functionality
    Verify that the sort filter...
    S1: Name - Ascending sort the searched product list alphabetically
    S2: Name - Descending sort the searched product list in reverse alphabetical order
    S3: Price - Ascending sort the searched product list in ascending price order
    S4: Price - Descending sort the searched product list in descending price order

  • Cart functionality
    S1: Verify information on the Cart page is correct after adding products to the cart
    S2: Verify remove item button works
    S3: Verify product is removed from the cart after decreasing its quantity to zero

  • Product's page
    S1: Verify the add to cart button is disabled after decreasing the product's quantity to zero


πŸ€– Example:

  • Catalog's filter functionality:
appium.-.note.screen.mp4

πŸ“œ Instructions:

Appium instalation on Windows OS

You can learn how to install Appium step by step here: https://www.youtube.com/watch?v=KiWIb0HhwRw
Anyway, here's the resume:

  • Install Java, Maven and Node/Npm
  • Install Appium through Node: npm i -g appium@next. If you don't get the latest version, try npm install --location=global appium@latest. You can check the version running appium -v
  • Install Appium Android uiautomator2 driver: appium driver install uiautomator2. Feel free to install the drivers you want
  • Install Android Studio and create a virtual device
  • Configure Android Path in your environment variables.
  • Install Appium doctor: npm install -g appium-doctor. Run it: appium-doctor --android
    • Check the "manual fixes needed" and fix them
  • If Appium Doctor tells you apkanalyzer.bat is not found, maybe it exists, but you need to rename it putting .bat at the end of the file name. This was my case. Probable apkanalyzer location: C:\Users\YOUR_USER_NAME\AppData\Local\Android\Sdk\tools\bin
  • Install Appium inspector or run it on the web: https://inspector.appiumpro.com/
  • Configure the Appium Inspector. Below is the image of my configuration:

appium inspector

  • To know the device's name, first you need to run the device. Then run this command on cmd: adb devices
  • Run adb shell dumpsys window | find "mCurrentFocus" to see the app package name and the app activity that is currently on focus in your device
  • Run adb shell getprop ro.build.version.release to see the android version of the device. You can check the version in the Android Studio also

Uff, now everything seems good, right? Time to run the tests!

Executing the tests:

  • Run appium command. If you're executing Appium inspector on the web, run appium --allow-cors
  • Launch your virtual device
  • Run appium inspector
  • Finally, execute the tests! πŸ˜€

About

UI automated tests on Android OS using Appium. Sauce Labs demo app was used.


Languages

Language:Java 100.0%