This projects is a demo testing framework for validating Android and iOS apps. It uses Cucumber and TestNG for structuring and executing tests. Also, it's configured with Allure reporting framework.
The key feature of this demo is that it can use device, emulator or cloud provider to run tests. The following cloud providers are supported:
- BrowserStack
- Kobiton
- SauceLabs
- Perfecto
TODO: AWS Device Farm
See details for configuring providers below
- JDK8
- Maven
- Update/add profile to
profiles
node ofpom.xml
<profile>
<id>$DEVICE_PROFILE_NAME</id>
<properties>
<provider.name>local</provider.name>
<device.type>device|emulator</device.type>
<device.platform.name>android|ios</device.platform.name>
<device.platform.version>$ANDROID_VERSION</device.platform.version>
<device.name>$DEVICE_NAME</device.name>
</properties>
</profile>
For iOS device you also need to specify device.udid
2. Run tests
mvn clean test -P$DEVICE_PROFILE_NAME -P$SUITE_PROFILE_NAME
You can generate a report using one of the following command:
-
mvn allure:serve
Report will be generated into temp folder. Web server with results will start.
-
mvn allure:report
Report will be generated tо directory:
target/site/allure-maven/index.html
- Signup to cloud device farm service and get your username and access key.
Set them to
$USERNAME
,$ACCESS_KEY
- Upload your app. Set path or ID, provided by cloud provider to
$APP
env variable - Create new device provile in
pom.xml
where<profile> <id>$PROVIDER-$PLATFORM-$DEVICE_TYPE</id> <properties> <provider.name>$PROVIDER</provider.name> <device.type>$DEVICE_TYPE</device.type> <device.platform.name>$PLATFORM</device.platform.name> <device.platform.version>$VERSION</device.platform.version> <device.name>$DEVICE_NAME</device.name> </properties> </profile>
- $PROVIDER - local, browserstack, saucelabs, kobiton or perfecto
- $PLATFORM - ios or android
- $DEVICE_TYPE - device or emulator
- $VERSION - OS version (i.e "7.0" or "12.4")
- $DEVICE_NAME - name of emulator or device
- Run tests
USERNAME=... ACCESS_KEY=... APP=... mvn clean test -P$DEVICE_PROVILE -Psuite-full