Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Espresso test recording feature in Android Studio 2.2

In Android Studio 2.2 there is supposed to be a test recording function? Where do I find it and how do I use it?

like image 677
Peter Avatar asked May 19 '16 09:05

Peter


People also ask

What is espresso testing in Android?

Espresso is an open source android user interface (UI) testing framework developed by Google. The term Espresso is of Italian origin, meaning Coffee. Espresso is a simple, efficient and flexible testing framework.

How do you test espresso intent?

Validate intentsUsing the intended() method, which is similar to Mockito. verify() , you can assert that a given intent has been seen. However, Espresso-Intents doesn't stub out responses to intents unless you explicitly configure it to do so. // User action that results in an external "phone" activity being launched.

What is espresso testing tool?

Espresso is a testing framework that helps developers write automation test cases for user interface (UI) testing. It has been developed by Google and aims to provide a simple yet powerful framework. It allows both black-box testing as well as testing of individual components during development cycles.


1 Answers

Update june 9th:
It is now available with android studio 2.2 preview 3!

Espresso Test Recorder
Demo of the Espresso Test Recorder shown at IO is now included in Preview 3

Screenshot of my pc:
enter image description here

Download it here or patch directly from android studio preview 2.2


Update may 30:
Android Studio 2.2 preview 2 is out, but no 'Record Espresso Test' option yet.

Unfortunately the Espresso Test Recorder is still not in this build; we're addressing a few more issues and then hope to have it ready in the next build!

From the changelog.


Update:
It was not in the Advanced Espresso presentation as I expected, but in What's new in Android development tools (credit to flackery). They show where to find it:

enter image description here

It's also explained in the latest android-developers blog

Espresso Test Recorder: Sometimes writing UI tests can be tedious. With the Record Espresso UI tests feature, creating tests is now as easy as just using your app. Android Studio will capture all your UI interactions and convert them into a fully reusable Espresso Test that you can run locally or even on Firebase Test lab. To use the recorder, go to the Run menu and select Record Espresso Test.

However there is no way to get that option in the current release, updating all (platform)tools etc won't make a difference either.

For now we can only assume that this was unintentionally left out, and will be included in the first next release.


The only sensible thing I could find about this is

Creating tests is now as easy as using your app. Run your app in debug mode and enable recording, and this feature will capture UI events and convert them into Espresso Tests that you can run locally or even in the Firebase Test lab.

From venturebeat

Running in debug is simple, but enabling recording.. I'm not sure what they mean by that. There is a recording option, but that is for capturing the screen and saving it to a mp4 file.

There is currently nothing to be found on the net, and nothing in android studio itself either, that explains this feature in more detail than "it's there".


There will however be a talk at Google I/O today, Advanced Espresso, where they will talk about this new feature and I expect it to be clearer after that.

I will update my answer once I've seen the presentation.

like image 174
Tim Avatar answered Sep 20 '22 22:09

Tim