You just updated Barista dependency from 1.x to 2.0 and everything is in red? We did some breaking changes to improve our public API, and that's why we increased our major version.
But fear not, here are a list of breaking changes and how to solve them:
We changed our Action classes to Interaction, to avoid confusion with Espresso ViewAction. (#132)
We moved most classes to different packages for better code organisation. You will find your missing imports in one of these public packages:
com.schibsted.spain.barista.assertion
com.schibsted.spain.barista.interaction
com.schibsted.spain.barista.rule
click()
methods have been renamed toclickOn()
. (#100)writeToEditText()
method has been renamed towriteTo()
. (#140)writeToAutoCompleteTextView()
method has been renamed towriteToAutoComplete()
. (#140)clickCheckBoxItem()
methods have been deleted. UseclickOn()
instead. (#140)ListView
andRecyclerView
actions have been merged intoListInteractions
with these common methods (#146):clickListItem(listId, position)
clickListItemChild(listId, position, childId)
scrollListToPosition(listId, position)
ListView
andRecyclerView
methods are the same. No need to use different method depending on the implementation. (#146)ListView
orRecyclerView
id is optional when only one instance ofListView
orRecyclerView
is displayed in the hierarchy. (#146)- Drawer id on drawer interactions and assertions is optional when only one DrawerLayout is present in the hierarchy. (#161)
- Drawer interactions and assertions allow using non-default gravity with
openDrawerWithGravity()
,closeDrawerWithGravity()
,assertDrawerIsOpenWithGravity()
andassertDrawerIsClosedWithGravity()
. (#161) SwipeRefreshLayout
id is now optional inrefresh()
method when only oneSwipeRefreshLayout
is present in the hierarchy. (#150)- Added
assertFocused()
andassertNotFocused()
methods. (#157) - Added
assertDisplayed(id, text)
to check some text in a specific view. (#150) - Added
FlakyTestRule
which enables the functionalities fromFlakyActivityTestRule
without forcing the inheritance dependency. (#160)
- Espresso's FailureHandler is not invoked anymore while Barista attempts to do its magic. It will only receive errors that actually make your test fail. This means you can use a custom FailureHandler for things like taking screenshots upon failures. (#134)
- We also improved some error messages when things go wrong, so you don't need to decipher what they mean. If you find any message that doesn't make much sense, open an issue!