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

Cursor matcher should return false if the column wasn't found so Hamcrest can proceed to the next cursor. #110

Open
GoogleCodeExporter opened this issue Apr 15, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hello, 

I wasn't sure if we were still using this tracker. 
Should we start logging issues in the android tracker instead?

Steps to reproduce:
1. Create a list view with multiple fragments each backed by it's own cursor 
adapter.

The data in the listview might look something like this:

 <[Data: Row 0: {columnA:"valueA", columnB:"valueB"} (class: Cursor) token: 0, 
    Data: Row 1: {columnC:"valueC", columnD:"valueD" } (class: Cursor) token:1...]>

3. Write Espresso test for this listview using new CursorMatchers:

 onData(CursorMatchers.withRowString("columnC", "valueC")).perform(click());

Expected:
Matcher finds my column and Espresso clicks on the item;

Actual:
Matcher throws "Couldn't find column" on the first cursor and doesn't proceed 
to the second cursor that has my column.


The issue is on the line 87 of CursorMatchers class that should return false if 
the result is COLUMN_NOT_FOUND instead of throwing an exception. 

If the column isn't found across ALL cursors in the listview it will be handled 
 by the no data found exception.

What version of the product are you using? On what operating system?

Espresso 2.0



Original issue reported on code.google.com by [email protected] on 21 Dec 2014 at 1:04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant