The project uses the Bitbar Sample App, installs it on the device, and then goes through the application.
The project uses:
-
BitBar Cloud - Web service for automated testing on real mobile devices. You'll need to have an active account for launching the tests in cloud.
-
Maven - Compiles and launches the test code.
The project uses Bitbar Sample apps, which are available in this repository test-samples/apps.
Test samples are designed to run with:
- Android: https://github.com/bitbar/test-samples/blob/master/apps/android/bitbar-sample-app.apk
- iOS: https://github.com/bitbar/test-samples/blob/master/apps/ios/bitbar-ios-sample.ipa
To run tests locally, follow these steps:
-
Prepare the Application File
- Place your tested application at the root of the project.
- For Android:
application.apk - For iOS:
application.ipa
- For Android:
- For iOS: The
bitbar-ios-sample.ipafile must be re-signed for your test devices if you want to run tests locally.
- Place your tested application at the root of the project.
-
Start Appium Server
- Ensure an Appium server is running before executing tests.
- For iOS: The UDID of your device must be pre-set in the Appium server settings.
-
Run Tests with Maven To run a specific test method (e.g.,
mainPageTestinAndroidSample):mvn -Dtest=AndroidSample#mainPageTest clean test -
Using an IDE
You can also run tests from your IDE. Make sure the project is imported as a Maven project and that
pom.xmlis recognized for dependency management. -
Reports
Test reports, screenshots, and other artifacts will be available under:
./target/reports/
Run tests as Server Side Appium in BitBar Cloud
Use the following scripts to create the test zip for your project:
./createAndroidZip.sh
or
./createiOSZip.sh
Once you have your test zip and application file ready, follow these steps to run your tests in BitBar Cloud:
-
Upload Files
- Go to the Files Library in BitBar Cloud and upload both your application file and the test zip.
-
Create a Test Run
- Open the Test Run Creator.
- Select the appropriate OS type (Android or iOS).
- Choose the "Server Side" test framework.
- Select your uploaded files and pick the devices you want to test on.
- Start the test execution.
Note:
If you change the name of your Android or iOS test class, update the following variables in run-tests_android.sh or
run-tests_ios.sh as needed:
# Name of the desired test class and optionally a specific test case, e.g., AndroidSample#mainPageTest
TEST=${TEST:="AndroidSample"}
# OPTIONAL: Specify the test case name to use with the `mvn test` command
# Leave blank to test the whole class!
TEST_CASE="#mainPageTest"