I am trying to verify that a ListView does not contain a specific item. Here is the code I'm using:
onData(allOf(is(instanceOf(Contact.class)), is(withContactItemName(is("TestName"))))) .check(doesNotExist());
When the name exists, I get the error message correctly due to check(doesNotExist()) . When the name does not exist, I get the following error, because allOf(...) does not match anything:
Caused by: java.lang.RuntimeException: No data found matching: (is an instance of layer.sdk.contacts.Contact and is with contact item name: is "TestName")
How can I get functions like onData(...).check(doesNotExist()) ?
EDIT:
I have a terrible hack to get the functionality that I would like to use using try / catch and checking the getCause () event. I would like to replace this with a good technique.
source share