Run Included Tests with App Center
- Follow the getting started tutorial to set up the sample app.
Install App Center Command Line Interface
Install Node.js version 6.3 or later.
Open the terminal and run the command below to install the App Center CLI:
npm install -g appcenter-cli
Run the command below and follow the directions to log in to App Center:
Build the project and test APK files
Open terminal and go to the project directory.
Run each of the following commands:
./gradlew assembleDebug ./gradlew assembleDebugAndroidTest
Prepare to run tests in App Center
Go to the Test service in App Center.
Click on Start testing your app.
Select the first device, the Google Pixel XL, and press Select one device at the bottom.
Choose Espresso as the Test framework.
Run the tests
In the Submit step, copy the custom command under Running tests.
Paste it into terminal while in the project directory.
--app-path should point to a mobile app apk and
--build-dir should point to where the test apk is located at.
Navigate into sampleapp-android/app/build/outputs/apk.
Copy the pathname and replace the placeholder text
pathToEspressoBuildFolderin the custom command with the pathname text.
Copy the pathname to app-debug-androidTest.apk and replace the placeholder text
pathToFile.apkin the custom command with the pathname text.
Run the command. You will see the tests begin to run.
In App Center, click Done to close the panel.