Skip to content

Firebase Cloud Test Lab

David González edited this page Jul 31, 2016 · 1 revision

Run UI tests in Firebase

Until October 1st we can use virtual devices for free in Firebase Cloud Test Lab!

Documentation

In order to run your UI tests look at the androidTest folder and choose the SuperHeroesActivityTest. Click on run tests and you'll see this dialog

cloud_test_lab_1

We are going to use virtual devices

cloud_test_lab_2

Select the ones you want

cloud_test_lab_3

And then run the tests!

testing_started

testing_completed

Take screenshots of your tests

You can take screenshots of your tests, download the Screenshot library and copy the .aar file to the ./aars folder.

allprojects {
   repositories {
       jcenter()
       flatDir {
           dirs '../aars'
       }
       maven { url "https://jitpack.io" }
   }

Remove espresso intents and add the new dependency

// Cloud testing
androidTestCompile (name:'cloudtestingscreenshotter_lib', ext:'aar')

Add permission to the Manifest

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>

Take some screenshots from your tests

ScreenShotter.takeScreenshot("screenshot_name", getActivity());

View the results

test_screenshot_cta

test_screenshots