Friday, October 18, 2013

Espresso for Android is here!

Cross-posted from the Android Developers Google+ Page

Earlier this year, we presented Espresso at GTAC as a solution to the UI testing problem. Today we are announcing the launch of the developer preview for Espresso!

The compelling thing about developing Espresso was making it easy and fun for developers to write reliable UI tests. Espresso has a small, predictable, and easy to learn API, which is still open for customization. But most importantly - Espresso removes the need to think about the complexity of multi-threaded testing. With Espresso, you can think procedurally and write concise, beautiful, and reliable Android UI tests quickly.

Espresso is now being used by over 30 applications within Google (Drive, Maps and G+, just to name a few). Starting from today, Espresso will also be available to our great developer community. We hope you will also enjoy testing your applications with Espresso and looking forward to your feedback and contributions!



12 comments:

  1. Really cool! Good work! I gave it a test run. It was really quick to setup and is super powerful, muuuuch better than standard instrumentation. If anyone is interested you can see a basics tutorial I put together here: http://www.stevenmarkford.com/android-ui-testing-with-espresso-basics-tutorial/

    ReplyDelete
    Replies
    1. It's not easy to setup, it takes 2 engineers for one week to conclude we may change to Robotium..

      Delete
  2. So, is this framework intended to replace the UIAutomator framework? Or is it used just as a quick-and-easy UI test scripting set?

    ReplyDelete
    Replies
    1. UIAutomator has its place, UIAutomator is really cool for system-wide integration tests. e.g. turning settings on and off while testing app in particular system state, it is pretty powerful in that way. Where as Espresso seems to shine when needing to do neat little test runs per activity.

      Delete
    2. Alright. I use UIAutomator fairly extensively; are there any plans to integrate Expresso functionality with UIAutomator? UIAutomator, while very powerful, is terribly unwieldy for simple tasks. Expresso appears to be capable to fast and quick 'click' actions and the like within activities. Obviously, you could just implement a script to call a UIAutomator Watcher and engage an Expresso action in order to "combine" them, but I am wondering if these frameworks could be complementary rather than parallel.

      Delete
  3. Is it possible to take screenshots?

    ReplyDelete
    Replies
    1. Screenshots are outside the scope of Espresso, but there are solutions out there. Take a look at the discussion here: https://groups.google.com/forum/#!searchin/android-test-kit-discuss/screenshot/android-test-kit-discuss/Fc-yVCedwAg/oXeXJEEB_0oJ

      Delete
  4. What's the best way to get sound options on the advanced power menu i.e. the ability to have sound/mute/vibrate options when you hold down the power key. This is missing.

    android

    ReplyDelete
    Replies
    1. Togging system settings is outside the scope of Espresso. Internally, we have a utility that tests can call into for setting up such state. We will be looking into open sourcing this in the future.

      Delete
  5. You can also try Espresso on real devices at Testdroid Cloud. Only 3 steps and instructions can be found here:

    http://testdroid.com/testdroid/6384/how-to-run-espresso-tests-in-testdroid-cloud

    ReplyDelete
  6. I put here a 5 minuts set up of Espresso in Android Studio projects together with the Github link to the working example: https://medium.com/p/c476d3b5ba45

    ReplyDelete

The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.