Espresso for Android is here!
piatok, októbra 18, 2013
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!
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!
Android Test Kit: https://code.google.com/p/android-test-kit/
Look forward to giving this a go!
OdpovedaťOdstrániťSo, is this framework intended to replace the UIAutomator framework? Or is it used just as a quick-and-easy UI test scripting set?
OdpovedaťOdstrániť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.
Odstrániť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.
OdstrániťIs it possible to take screenshots?
OdpovedaťOdstrániť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
Odstrániť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.
OdpovedaťOdstrániťandroid
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.
OdstrániťYou can also try Espresso on real devices at Testdroid Cloud. Only 3 steps and instructions can be found here:
OdpovedaťOdstrániťhttp://testdroid.com/testdroid/6384/how-to-run-espresso-tests-in-testdroid-cloud
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
OdpovedaťOdstrániťIt's not easy to setup, it takes 2 engineers for one week to conclude we may change to Robotium..
OdpovedaťOdstrániťThanks for this awesome testing-framework! TestObject does also have support for Espresso on real devices: https://testobject.com/features/automation
OdpovedaťOdstrániťDisclaimer: I'm co-founder of TestObject.
Hi,
OdpovedaťOdstrániťIs there any tutorials helping to write espresso test cases for accessibility checking? Thanks!
I am trying to have multiple @Test annotations with each test being a continuation from the previous screen. ex : From home page -> Do a search -> Click a search result et
OdpovedaťOdstrániťHowever @Rule cause the MainActivity to launch each time.
How can I maintain the flow of my test without having to launch Main activity before each test.