Skip to content

Commit 275b521

Browse files
authored
Fix Email EditText's ViewMatcher (#166)
1 parent 6847cea commit 275b521

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

example/tests/src/android/androidTest/InvokeInstabugUITest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
import static androidx.test.espresso.Espresso.onView;
44
import static androidx.test.espresso.action.ViewActions.click;
55
import static androidx.test.espresso.action.ViewActions.replaceText;
6+
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
67
import static androidx.test.espresso.matcher.ViewMatchers.withResourceName;
78
import static androidx.test.espresso.matcher.ViewMatchers.withText;
89

10+
import static org.hamcrest.Matchers.allOf;
11+
912
import androidx.test.ext.junit.rules.ActivityScenarioRule;
1013
import androidx.test.ext.junit.runners.AndroidJUnit4;
1114

@@ -23,10 +26,17 @@ public class InvokeInstabugUITest {
2326
@Test
2427
public void ensureInstabugInvocation() throws InterruptedException {
2528
Thread.sleep(5000);
26-
onView(withResourceName("instabug_floating_button")).perform(click());
2729

30+
onView(withResourceName("instabug_floating_button")).perform(click());
2831
onView(withText("Report a bug")).perform(click());
29-
onView(withResourceName("instabug_edit_text_email")).perform(replaceText("inst@bug.com"));
32+
33+
onView(
34+
allOf(
35+
withResourceName("ib_edit_text"),
36+
withParent(withResourceName("instabug_edit_text_email"))
37+
)
38+
).perform(replaceText("inst@bug.com"));
39+
3040
onView(withResourceName("instabug_bugreporting_send")).perform(click());
3141
onView(withResourceName("instabug_success_dialog_container")).perform(click());
3242
}

0 commit comments

Comments
 (0)