Skip to content

Commit

Permalink
Move list assertions to the assertions section (#407)
Browse files Browse the repository at this point in the history
They were in the interactions one
  • Loading branch information
EsteveAguilera authored May 28, 2021
1 parent 5aafc1d commit d2fe208
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ clearText(R.id.edittext)
clickListItem(R.id.list, 4);
clickListItemChild(R.id.list, 3, R.id.row_button);
scrollListToPosition(R.id.list, 4);
assertListItemCount(R.id.list, 5)
assertListNotEmpty(R.id.list)
assertDisplayedAtPosition(R.id.list, 0, "text");
assertDisplayedAtPosition(R.id.list, 0, R.id.text_field, "text");
assertDisplayedAtPosition(R.id.list, 0, R.string.hello_world);
assertDisplayedAtPosition(R.id.list, 0, R.id.text_field, R.string.hello_world);
assertCustomAssertionAtPosition(R.id.list, 0, customViewAssertion);

clickSpinnerItem(R.id.spinner, 1);
```
Expand Down Expand Up @@ -167,6 +160,13 @@ assertDisplayed(R.string.hello_world);
assertDisplayed(R.id.button);
assertDisplayed(R.id.button, "Hello world")
assertDisplayed(R.id.button, R.string.hello_world)

// on ListViews and RecyclerViews by position
assertDisplayedAtPosition(R.id.list, 0, "text");
assertDisplayedAtPosition(R.id.list, 0, R.id.text_field, "text");
assertDisplayedAtPosition(R.id.list, 0, R.string.hello_world);
assertDisplayedAtPosition(R.id.list, 0, R.id.text_field, R.string.hello_world);

// you can also pass custom matchers
assertDisplayed(withTagValue(is("tagName")))

Expand Down Expand Up @@ -258,6 +258,16 @@ assertContentDescription(R.id.anyView, R.string.content_description);
assertContentDescription(R.id.anyView, "Some text");
```

#### Is this List empty? How many items does it have?
````java
// Works with both ListView and RecyclerView
assertListNotEmpty(R.id.list)
assertListItemCount(R.id.list, 5)

// You can also pass custom assertions
assertCustomAssertionAtPosition(R.id.list, 0, customViewAssertion);
````

#### What's the state of the Drawer?
```java
assertDrawerIsOpen();
Expand Down

0 comments on commit d2fe208

Please sign in to comment.