Skip to content

Latest commit

 

History

History
87 lines (45 loc) · 2.99 KB

running-the-tests.md

File metadata and controls

87 lines (45 loc) · 2.99 KB

How To - Running the tests

Introduction

This guide shows you how to run both the unit and instrumentation tests for an Android app.

Finding the tests

With the project open in Android Studio, expand the project directory in the Project tab:

Screenshot showing the project directory selected in Android Studio

Now expand the app directory:

Screenshot showing the app directory selected in Android Studio

And finally the src directory:

Screenshot showing the source directory selected in Android Studio

Running the unit tests

Right click on the test [unitTest] directory:

Screenshot showing the test directory selected in Android Studio

Click the Run Tests... option and the test execution will begin:

Screenshot showing the run tests option Screenshot showing the unit tests running

Once complete the test results are displayed:

Screenshot showing the unit test output

Running the instrumentation tests

Right click on the androidTest directory:

Screenshot showing the android test directory selected in Android Studio

Click the Run 'All Tests' option and the test execution will begin:

Screenshot showing the run all tests option Screenshot showing the instrumentation tests running

While the tests are running you will see the Android Virtual Devices (AVD)s screen launching and relaunching the app and flicking through pages as each view or journey is tested.

Once complete the test results are displayed:

Screenshot showing the instrumentation test output