Skip to content

Instantly share code, notes, and snippets.

@BramYeh
Created July 12, 2020 06:54
Show Gist options
  • Save BramYeh/ff2cb027799b63606422450ae2fcd8fe to your computer and use it in GitHub Desktop.
Save BramYeh/ff2cb027799b63606422450ae2fcd8fe to your computer and use it in GitHub Desktop.
ItemPage extends basic Page
class ItemPage : Page() {
override fun verify(): Page {
Espresso.onView(withId(R.id.productitem_product_name))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
return this
}
fun withTitle(keyword: String): ItemPage {
Espresso.onView(withId(R.id.productitem_product_name))
.check(matches(ViewMatchers.withText(keyword)))
return this
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment