0% found this document useful (0 votes)
441 views1 page

Espresso Cheat Sheet 2.1.0

The document summarizes Espresso matchers and actions that can be used to interact with views and intents during Android UI testing. It describes view matchers for finding views based on properties like ID, text, and hierarchy. It also lists actions that can be performed on views like clicks, swipes, and text entry. Intent matchers are described for validating intents based on data, component, and extras. View assertions validate properties and layout of views.

Uploaded by

Cristian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
441 views1 page

Espresso Cheat Sheet 2.1.0

The document summarizes Espresso matchers and actions that can be used to interact with views and intents during Android UI testing. It describes view matchers for finding views based on properties like ID, text, and hierarchy. It also lists actions that can be performed on views like clicks, swipes, and text entry. Intent matchers are described for validating intents based on data, component, and extras. View assertions validate properties and layout of views.

Uploaded by

Cristian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

onView(ViewMatcher) onData(ObjectMatcher)

.perform(ViewAction) .DataOptions
.check(ViewAssertion); .perform(ViewAction)
.check(ViewAssertion);

View Matchers Data Options


HIERARCHY inAdapterView(Matcher)
USER PROPERTIES atPosition(Integer)
withParent(Matcher)
withId(...) withChild(Matcher) onChildView(Matcher)
withText(...) hasDescendant(Matcher)
withTagKey(...) isDescendantOfA(Matcher)
withTagValue(...) hasSibling(Matcher)
hasContentDescription(...) isRoot()
withContentDescription(...)
withHint(...)
withSpinnerText(...)
INPUT
View Actions
hasLinks()
hasEllipsizedText() supportsInputMethods(...) CLICK/PRESS GESTURES
hasMultilineTest() hasIMEAction(...)
click() scrollTo()
doubleClick() swipeLeft()
longClick() swipeRight()
UI PROPERTIES CLASS pressBack() swipeUp()
isDisplayed() isAssignableFrom(...) pressIMEActionButton() swipeDown()
isCompletelyDisplayed() withClassName(...) pressKey([int/EspressoKey])
isEnabled() pressMenuKey()
hasFocus() closeSoftKeyboard() TEXT
isClickable() openLink()
ROOT MATCHERS clearText()
isChecked() typeText(String)
isNotChecked() isFocusable() typeTextIntoFocusedView(String)
withEffectiveVisibility(...) isTouchable() replaceText(String)
isSelected() isDialog()
withDecorView()
isPlatformPopup()
OBJECT MATCHER
allOf(Matchers)
anyOf(Matchers)
is(...)
SEE ALSO
Preference matchers
View Assertions
not(...)
Cursor matchers matches(Matcher)
endsWith(String) POSITION ASSERTIONS
Layout matchers doesNotExist()
startsWith(String) isLeftOf(Matcher)
instanceOf(Class) selectedDescendantsMatch(...)
isRightOf(Matcher)
isLeftAlignedWith(Matcher)
isRightAlignedWith(Matcher)
LAYOUT ASSERTIONS isAbove(Matcher)
noEllipseizedText(Matcher) isBelow(Matcher)
noMultilineButtons() isBottomAlignedWith(Matcher)
noOverlaps([Matcher]) isTopAlignedWith(Matcher)

intended(IntentMatcher); intending(IntentMatcher)
.respondWith(ActivityResult);
Intent Matchers
INTENT URI BUNDLE
hasAction(...) hasHost(...) hasEntry(...)
hasCategories(...) hasParamWithName(...) hasKey(...)
hasData(...) hasPath(...) hasValue(...)
hasComponent(...) hasParamWithValue(...)
hasExtra(...) hasScheme(...)
hasExtras(Matcher) hasSchemeSpecificPart(...)
hasExtraWithKey(...)
hasType(...)
hasPackage()
COMPONENT NAME
toPackage(String)
hasFlag(int) hasClassName(...)
hasFlags(...) hasPackageName(...)
isInternal() hasShortClassName(...)
hasMyPackageName()

v2.1.0, 4/21/2015

You might also like