1.0.1 • Published 3 years ago

zz-gidtest-webdriverio6-appium-mocha v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

GiD-AppiumTest

Description

  • Automation tests for GiD app

Tests is devide in to:

  • Main file (test.js) where all test flows are located
  • Data file (variables.js) all data like GiD name, password… are located here
  • Test operations (“pages” folder) where operations and commands are located

Based on

Supports

  • Native Android and iOS apps
  • Android Chrome browser
  • iOS Safari browser
  • Supports Page Object Model
  • Contains sample test scenarios in mocha
  • Supports eslint
  • Supports allure reporting

Source

Click below to know more

Running tests

Follow the below commands -

  • Before runing tests, install Appium (For example: How to Install Appium: Step-by-Step Complete Tutorial : https://www.edureka.co/blog/appium-installation/#appium-installation-mac)

  • Clone the project

  • Install dependencies using npm i in the terminal.

  • Update the deviceName and platFormVersion in config/android.info.js or config/ios.info.js.

  • Add latest apk in the "apps" folder and name it "gid.apk"

  • Execute npm run ios to run ios native app

  • Execute npm run iosBrowser to run ios safari browser

  • Execute npm run android(device model) to run android native app

  • Execute npm run androidBrowser to run android chrome browser

  • Execute npm run lint to run the eslint for the project

  • Execute npm run allure to generate the allure report

Running multiple tests on multiple devices

  • In android.info.js add/change deviceName and platformVersion and add phone model at the end (example: "deviceNameA51: 'devname'", "platformVersionA51: '10'")

  • Create/copy new android.config.js file and add phone model at the end (example: "android.configA51.js")

  • Change Port number, device name (example: "deviceName: androidInfo.deviceNameA51") and platform version (example: "platformVersion: androidInfo.platformVersionA51")

  • In package.json add created script under "scripts" (example: "androidA51": "wdio ./config/android.configA51.js")

  • in separate terminals run appium servers (example: "appium -p 4000 -bp 5000" and "appium -p 4001 -bp 5001"), ports must match the ports that were specified earlier

  • in separate terminals run tests (example: "npm run androidA51" and "npm run androidS9")

  • Warning: Be careful to change users, coordinates... for each device (look revokeAcc.page.js)

APPIUM important info

RUN APPIUM DESKTOP APP:

  1. In Terminal run: “ sudo /Applications/Appium.app/Contents/MacOS/Appium “
  2. Set up JAVA_HOME and ANDROID_HOME in Appium desktop before staring the server
  3. In advanced set “Override session” checkbox

SETING UP CORRECT PATH (User “correct path” below):

###@MacBook-Pro ~ % nano .bash_profile ###@MacBook-Pro ~ % source .bash_profile ###@MacBook-Pro ~ % echo $ANDROID_HOME
/Users/###/Library/Android/sdk ###@MacBook-Pro ~ % echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home ###@MacBook-Pro ~ % appium-doctor

CORRECT PATH:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home export PATH=$JAVA_HOME/bin:$PATH export ANDROID_HOME=/Users/###/Library/Android/sdk export PATH=/Users/###/Library/Android/sdk/platform-tools:$PATH