Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move list assertions to a more appropriate place #407

Merged
merged 6 commits into from
May 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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