Base Appium E2E mobile tests
It is an automation base suite for mobile applications using Appium and Ruby.
- Install Ruby from here
- Install Bundler from here
- Install Node.js from here
- Install Appium:
$ npm install -g appium
- Install Appium Doctor:
$ npm install -g appium-doctor
- Install Docker Desktop from here
- Install the dependencies:
$ cd path_to_project/ $ bundle install
- For Apple M1 chip, execute:
$ gem uninstall ffi $ gem install --user-install ffi -v 1.15.3 -- --enable-libffi-alloc
- Install Java from here
- Install Android Studio from here
- Install Appium UiAutomator2 Driver:
$ npm install appium-uiautomator2-driver
- Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSl https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install XCode from here
- Install Carthage:
$ brew install carthage
Execute Appium Doctor command:
$ appium-doctor
First of all, create the .env file in the root folder of the project.
LOCAL_APP_PATH="<APK/APP path>"
BROWSERSTACK_USERNAME="<BrowserStack username for test execution>"
BROWSERSTACK_ACCESS_KEY="<BrowserStack key for test execution>"
BROWSERSTACK_APP_HASH="<BrowserStack Android/iOS app hash>"
BUILD="<BrowserStack/Kobiton build name>"
KOBITON_USER_NAME="<Kobiton username for test execution>"
KOBITON_API_KEY="<Kobiton key for test execution>"
KOBITON_APP="<Kobiton Android/iOS app ID>"
Go to the root folder of the project through Terminal and execute the cucumber
command.
- Android local execution:
$ cd path/to/project $ appium $ cucumber -p android_local
- iOS local execution:
$ cd path/to/project $ appium $ cucumber -p ios_local
- BrowserStack Android execution:
$ cd path/to/project $ cucumber -p android_browserstack
- BrowserStack iOS execution:
$ cd path/to/project $ cucumber -p ios_browserstack
- BrowserStack Android execution with Docker:
$ cd path/to/project $ docker build -t bs . $ docker run -v ${PWD}/reports/allure:/tests/reports/allure bs:latest cucumber -p android_browserstack
- BrowserStack iOS execution with Docker:
$ cd path/to/project $ docker build -t bs . $ docker run -v ${PWD}/reports/allure:/tests/reports/allure bs:latest cucumber -p ios_browserstack
- Kobiton Android execution:
$ cd path/to/project $ cucumber -p android_kobiton
- Kobiton iOS execution:
$ cd path/to/project $ cucumber -p ios_kobiton
To execute tests in more than one device use:
$ cd path/to/project
$ rake 'test:multiples["<capability>","<feature file path>",<number of devices>]'
- Install Allure Report:
$ npm install -g allure-commandline
- Execute the tests
- Generate report:
$ allure serve reports/allure
Best practices here Better Gherkin here
Jenifer Silva