Issue
Say I have two tests.
Each of them interacts with a spinner:
- The first one clicks on it and fails.
- The second one launches and also clicks a spinner(willing to open it) and now it is closed and onData() fails.
Tests must be independent.
What @Before method can i write to make sure spinner is closed on test start?
Solution
Ugly yet works for me...
@Before
public void setUp() {
closeSpinner();
}
private void closeSpinner() {
try {
onData(is(instanceOf(String.class)))
.atPosition(0)
.perform(click());
} catch (Exception e) {
//was closed
}
}
Answered By - Ivan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.