Espresso 3.0.1, Runner 1.0.1, Rules 1.0.1, AndroidTestOrchestrator 1.0.1 (2017-08-28)
-
Espresso
- Added a
IdlingPolicyoption to suppressonTimeout()when a step debugger is attached to the VM. - Issues 64024656, 64247586,
and 64525881: Don't report failures for
unsuccessful class loading unless a user is loading specific classes by
including the
-eclass runner argument. - Issue 64877246: Add missing classes to sources JAR file.
- Added a
-
Runner
- Simplified
ShardingFilterlogic. - Issue 65025743:
@RequiresDevicefilter now supports FTL emulators.
- Simplified
-
AndroidTestOrchestrator
- Don't duplicate report failures. When a test process crashes after failing, now only one failure is reported for the test.
- Fixed Javadoc for Orchestrator.
- Tests now indicated as missed if the remote process crashes.
- Now handles ignored test cases.
- Now excludes ignored test cases from footer to match legacy results.
- Fixed runtime permission issues. Test reports are now written to SD card on Android 7.0 (API level 24) and higher.
Espresso 3.0.0, Runner 1.0.0, Rules 1.0.0, AndroidTestOrchestrator 1.0.0 (2017-07-25, Announcement)
Breaking changes
- All artifacts
- Dropping support for API levels lower than 15 – however, the min SDK still points to API level 9 to give users time to upgrade
- Espresso
- The deprecated
android.support.test.espresso.contrib.CountingIdlingResourceclass has been deleted and moved to
android.support.test.espresso.idling.CountingIdlingResource- Use
getInstance().register()instead ofregisterIdlingResources()
- Use
- Guava is now jarjar'd away to a
different "internal" namespace – if you're accidently using Guava
API through Espresso namespaces, you might see breakages
- Remove any references to shaded Guava (
.core.deps.guava.) - Upgrade your Support Library version to 25.4.0 or higher
- Remove any references to shaded Guava (
- The deprecated
Known issues
- AndroidTestOrchestrator
-e numShardsand-e shardIndexrunner arguments aren't currently supported- Parameterized tests aren't currently supported
New features
- Espresso
- New Multiprocess Espresso
Support on API 26 for
espresso-coreandespresso-web, but notespresso-contrib - New lightweight
IdlingRegistryAPI- Published as part of
com.android.support.test.espresso:espresso-idling-resource:3.0.0 - Deprecated methods:
- Published as part of
- New API to help synchronize against
Executors- New maven artifact:
com.android.support.test.espresso.idling:idling-concurrent:3.0.0 - Contains
IdlingScheduledThreadPoolExecutorandIdlingThreadPoolExecutorclasses
- New maven artifact:
- New API to help synchronize against network requests and responses.
- New maven artifact:
com.android.support.test.espresso.idling:idling-net:3.0.0 - Contains
UriIdlingResourceclass
- New maven artifact:
- New
espresso-coreview matchers:hasBackground()matches against aViewobject's background drawable resourcehasTextColor()matches against aTextViewobject's color
- New view action methods:
- Enhanced
scrollTo()view action to work with descendants ofListView repeatedlyUntil()– Performs the givenViewActionon a view until the view matches the desiredViewMatchers
- Enhanced
- New Espresso methods:
pressBackUnconditionally()– Similar topressBack()but doesn't throw an exception when Espresso navigatesnoActivity()– Removes the need of waiting for an activity before performing aViewActionorViewAssertiononIdle()– Loops the main thread until the app goes idleonIdle(Callable<T>)– Same asonIdle(), but takes an additionalCallableas a parameter, which is executed after the app goes idle
webScrollIntoView()– Newespresso-webatom that allows you to scroll inside aWebView
- New Multiprocess Espresso
Support on API 26 for
- Runner
-
InterceptingActivityFactoryandSingleActivityFactory– Provides a facility of testing an activity in isolation from the outer world by overriding methods likestartService()andsendBroadcast() -
Add support for using JUnitParams
with
AndroidJUnitRunner -
Start handling
@UiThreadTeston the core test runner level and deprecate@UiThreadTestRule– This enables the use of@UiThreadTestannotation directly on methods annotated with@Beforeand@After -
@SdkSupressannotation now supportsmaxSdkVersionvalue (Issue 37067792) -
-e classLoader– Provide the ability to pass class loaders using runner args -
-e filter– Add support for custom JUnit filters to be specified using runner args -
-e runnerBuilder– Allows developers to provide their own implementations ofRunnerBuilderthat can determine whether and how they can run against a specific class
-
- Rules
ProviderTestRule– New API to testContentProviderobjectsgetActivityResult()andActivityResultMatchers– New API to retrieve the activity result of an activity that has calledsetResult()
- AndroidTestOrchestrator
- Android Test Orchestrator
provides a new way of collecting and running tests, with an emphasis on
correctness and isolation. Orchestrator is an independent instrumentation
process, spawning one instrumentation runner process for each test and
collecting the results.
- Application crashes take down the runner instrumentation but not the orchestrator, allowing your test suite to continue
- Requires installation of the orchestrator APK –
'com.android.support.test:orchestrator:1.0.0' - Version 1.0 has a command-line interface only; integration with Android Studio and Firebase Test Labs is planned
- Android Test Orchestrator
provides a new way of collecting and running tests, with an emphasis on
correctness and isolation. Orchestrator is an independent instrumentation
process, spawning one instrumentation runner process for each test and
collecting the results.
Bug fixes
- Espresso
- Improved root view synchronization to significantly reduce flakiness
- Fix corruption of
IdlingResourceRegistry - Better synchronization against
IdlingResourceobjects - Issue 37132680: Espresso doesn't wait for dialog creation to complete before performing the next action
- Issue 37103280: Espresso should ship ProGuard consumer rules so consumers aren't required to add them
- Issue 37094726: Espresso Intents contains unnecessary application label
- Issue 37093953: Espresso: No available check for null/empty error text
- Issue 37071776:
espresso-coreembeds Guava's.pomfiles - Issue 37062612: NPE in
release() - Issue 37063389: Having Guava and
espresso-webasandroidTestdependencies doesn't compile - Issue 37070533: Add support for
NavigationViewin Android Design Support Library
- Runner
-
Fix the ability to use
@UiThreadTestin combination with@Test(timeout = 123) - Fixed
-e notClassrunner arg - Fixed
-e logto support JUnit3 and JUnit4 test suites, as well asParameterizedandEnclosedrunners - Issue 37663530: Wait for all activities to finish before and after each test method
- Issue 37132680: Espresso doesn't wait for dialog creation to complete before performing the next action
-
Issue 37123213:
@RequiresDeviceignored on x86_64 ABI -
Issue 37101485: Some manifest-provided
arguments for
AndroidJUnitRunner—such as test size, annotation and debug—are ignored - Issue 37082857: Espresso semi-parallel test execution fails on static objects
-
Issue 37063396: Context not initialized
with
ProviderTestCase2(causesNullPointerException)
-
Fix the ability to use
- Rules
- Fixed
ActivityTestRulelifecycle to unify behavior across regular and lazyActivityTestRuleinitialization - Issue 37079943: Fix
ServiceTestRuleto allow re-binding - Issue 37109342: Add
getActivityResult()andActivityResultMatchers
- Fixed
- UiAutomator
setUiAutomationFlags()for use withUiAutomation.FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES– this allowsUiAutomatorto be used while other accessibility services are running- Issue 37082813:
setText()on emptyEditTextobjects throwsNullPointerExceptionif API level is 19 or lower
Other notable changes
- Binaries are now published via Google Maven
- Reduced size of
espresso-coreandespresso-webJAR files – embedded dependencies now have ProGuard applied - All
.aarfiles now include ProGuard rules - Add
proguard_library.cfgfiles to released artifacts Tapperinterface has a new version ofsendTap()to implement
External contributions
- Espresso
- Runner
- Rules
Espresso 2.2.2, Runner/Rules 0.5 (2016-02-22, silent release)
New features
- espresso
- Issue 194253: Add support for NavigationView in android support design library
- Added checks for enabled animations and transitions
- New
ViewMatcherAPI:withResourceName()
Bug fixes
- espresso
- Issue 195331: espresso-core embeds guava’s pom files
- Moved counting idling resource out of espresso-contrib
- rules
- Issue 187249: NPE in
Intents.release()
- Issue 187249: NPE in
- runner
- Issue 196066: The
-e log trueargument inAndroidJUnitRunnerdoes not bypass actual test - Wait for debugger in
onCreate()of the runner - Moved all supported test annotation out of platform and into ATSL
- Removed the stack trace dump about no JSBridge
- Fixed
AndroidAnnotatedBuilder
- Issue 196066: The
Other notable changes
ActivityTestRule,UiThreadTestRule,IntentsTestRuleandServiceTestRuleare out of beta- Add code style settings file for uniform code formatting
Espresso 2.2.1, Runner/Rules 0.4 (2015-09-15, Announcement)
New features
- rules
- Added new
IntentsTestRuleconstructor to be fully compatible withActivityTestRule
- Added new
- runner
- Added special case multidex installation for API levels 15 and lower
- Added exclude filters to class and package:
- Running all tests except those in a particular class:
adb shell am instrument -w -e notClass com.android.foo.FooTest - Running all but a single test:
adb shell am instrument -w -e notClass com.android.foo.FooTest#testFoo - Running all tests except a particular package:
adb shell am instrument -w -e notPackage com.android.foo.bar
- Running all tests except those in a particular class:
External contributions
- espresso
- 157911: Add view matcher for input type on an
EditTextobject - 157912: Add view matcher for matching error text on
an
EditTextobject - 150674: Add
DrawerActionssupport for drawers with arbitrary gravity - 150744:
DrawerActionsno longer leakparentListener - 153303: Gravity specified on the "is the drawer open or closed" checks
- 157910: Add
DrawerLayoutopen and close action factories
- 157911: Add view matcher for input type on an
Bug fixes
- espresso
ViewActions.closeSoftKeyboard()now ensures that soft keyboard is completely gone- Fixed synchronization issue with Espresso's
Espresso.pressBack()method on API level 21 and higher - Fixed synchronization for keyboard closure animations on API level 23
- rules
- Fixed
ServiceTestRuleon API level 23,startService()must always be called with an explicitIntent
- Fixed
- runner
- Fixed broken gradle
JaCoCosupport - Fixed broken test sharding support
- Fixed inconsistent state in test runner after
JUnit3style test timeouts
- Fixed broken gradle
Other notable changes
- Javadoc fixes and error message improvements
- Ignore
suite()methods and don't ignore init errors when using method filters
Espresso 2.2 / ATSL 0.3 (2015-06-09, Announcement)
New features
- espresso-web 2.2
- New
WebViewsupport
- New
- espresso-core 2.2
- Migrated to use dagger v2
- Migrated to use hamcrest v1.3
- espresso-contrib 2.2
- Accessibility checks
DrawerActionsgravity support
- rules 0.3
DisableOnAndroidDebugrule
- runner 0.3
- Upgrade from JUnit v4.10 to JUnit v4.12
- Migrated to use Hamcrest v1.3
Bug fixes
- Fixed
DrawerActionsleakingParentListener - Assumption failure is now treated as an ignore test rather than a failing test
- Fixed
MonitoringInstrumentationleaking activity instances throughExecutorService - Fixed for orphan activities being stuck in stopped stage
- Update
Until.scrollFinished()to return true if no scroll events were generated. Guard against potential NPE inUiObject2#setText().
Espresso 2.1, Test Runner/Rules 0.2 and UIAutomator 2.1.0 (2015-04-21, Announcement)
Breaking changes
- Test runner artifact split into two and the name changed from
com.android.support.test:testing-support-lib:0.1tocom.android.support.test:runner:0.2andcom.android.support.test:rules:0.2.
New features
- espresso-intents: A Mockito-like API that enables hermetic inter-activity
testing by allowing test authors to verify and stub outgoing intents
IntentsTestRule: extendsActivityTestRule, initialized and releases Espresso-Intents in functional UI tests
- espresso-core
ViewActions: Added ability to run global assertions prior to running actions. This is useful for other frameworks that build on top of Espresso to validate state of the view hierarchy while existing Espresso test suite is executedViewMatchers.withContentDescription()resIdoverload
- rules
ActivityTestRule: This rule provides functional testing of a single activityUiThreadRuleandUiThreadTestannotations: This rule allows the test method annotated withUiThreadTestto execute on the application's main thread (or UI thread)ServiceTestRule: This rule provides functional testing of a service
- runner
ApplicationLifecycleCallback: Callback for monitoring application lifecycle events- All runner arguments can now be also specified in the Android manifest
file using a
<meta-data>tag
- UIAutomator
UiDevice.dumpWindowHierarchy()can now accept aFileor anOutputStream
Bug fixes
- espresso
- Cursor matcher now returns
falseif the column wasn't found so Hamcrest can proceed to the next cursor NullPointerExceptionwithPreferenceMatcherswithTitleno longer occurs- Unregistering idling resource no longer causes Espresso to think we have busy idling resources
- Updated Support Annotations version used by Espresso Contrib
- Cursor matcher now returns
- runner
AndroidJUnit4now skips tests with failing assumptions
- UIAutomator
- Run watchers to prevent
StaleObjectException
- Run watchers to prevent
Other notable changes
- Add better error message when we can't typeText with a non-Latin string
UIAutomator 2.0 (2015-03-12, Announcement)
UI Automator is now based on Android Instrumentation, and you can build and run
tests using the ./gradlew connectedCheck command.
Espresso Version 2.0, Test Runner 0.1 (Released on: 2014-12-19, Announcement)
Breaking changes
- Espresso has moved to a new namespace, from
com.google.android.apps.common.testing.ui.espressotoandroid.support.test.espresso - Espresso artifacts have been renamed
espresso-1.1.jaris nowespresso-core-release-2.0.jarIdlingResourceinterface has been moved into a separate library:espresso-idling-resource-release-2.0.jarCountingIdlingResourcenow resides inespresso-contrib-release-2.0.jar(as it always should have)
- Optional (a guava dependency) has been removed from the public API in order to
support repackaging the guava dependency and avoid DEX collision (a major
source of development pain). Affected methods include the following:
ViewAssertion.check()HumanReadables.getViewHierarchyErrorMessage()
New features
- Actions
ViewActionsreplaceText()openLink()- Swipe up and down
- espresso-contrib
RecyclerViewActions: Handles interactions withRecyclerViewsPickerActions: Handles interactions withDateandTimepickers
- Matchers
RootMatchersisPlatformPopup()
ViewMatchersisJavascriptEnabled()withSpinnerText()withHint()isSelected()hasLinks()
LayoutMatchers: Matchers for i18n-related layout testingCursorMatchers: A collection of matchers forCursorobjects
- Assertions
PositionAssertions, includingisLeftOf()andisAbove(): Colleciton ofViewAssertionsfor checking relative position of elements on the screenLayoutAssertions: Assertions for i18n-related layout testing
- Test app: Many new sample activities/tests
- Other
Espresso.unregisterIdlingResources()andEspresso.getIdlingResources(): Provides additional flexibility for working withIdlingResourcesViewInteraction.withFailureHandler(): Allows overriding the failure handler fromonView()onData()support forAdapterViewsbacked byCursorAdapters
Bug fixes
ViewMatchers.isDisplayed()matches views that take up the entire screen, but are no longer less than 90% displayed- Performing swipe action call to
DrawerActions.openDrawer()no longer results inIdlingResourceTimeoutException
Other notable changes
- Switched from building with Maven to Gradle
- Moved Espresso dependencies (Guava, Dagger, Hamcrest) out of the way to avoid DEX collisions
- Changed to return success or failure when registering and unregistering idling resources
- Lollipop support: Place
message.recycle()behind an interface to account for version-related changes - Switched target SDK level to 21 – mostly affects the test app
Version 1.1 (Released on: 2014-01-08)
Espresso
- New
swipeLeftandswipeRightViewActions - Multi-window support: An advanced feature that enables picking the target window on which Espresso should run the operation
- Improvements to
TypeTextAction: Allows typing text into a pre-focused view, which makes it easier to append text - Numerous bug fixes
Espresso Contrib Library
- This new library contains features that supplement Espresso, but are not part of the core library
- New
DrawerActionsfor operating onDrawerLayout: Has a dependency on Android Support Library, hence we are keeping it outside of the core Espresso library
Sample Tests
- These tests have been relocated to live in the same package as the test app
- Maven POMs have been fixed to remove duplicate guava deps, so
mvn installshould work now


