Skip to content

Commit

Permalink
Add a few more sleeps to flaky Espresso tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed Jun 19, 2024
1 parent 8cf288d commit acc6e6d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ public void testSetDeadlineTimeForNewNote() {
onView(withId(R.id.date_picker_button)).perform(click());
onView(withClassName(equalTo(DatePicker.class.getName()))).perform(setDate(2014, 4, 1));
onView(withText(android.R.string.ok)).perform(click());
SystemClock.sleep(100);
onView(withText(R.string.set)).perform(click());
onView(withId(R.id.deadline_button)).check(matches(withText(userDateTime("<2014-04-01 Tue>"))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public void testClickingNote() {
defaultSetUp();

onView(allOf(withText("book-two"), isDisplayed())).perform(click());
SystemClock.sleep(200);
searchForTextCloseKeyboard("b.book-two Note");
onView(withId(R.id.fragment_query_search_view_flipper)).check(matches(isDisplayed()));
onNotesInSearch().check(matches(recyclerViewItemCount(29)));
Expand Down Expand Up @@ -615,6 +616,7 @@ public void testSearchForTagOrTag() {
scenario = ActivityScenario.launch(MainActivity.class);

onView(allOf(withText("notebook"), isDisplayed())).perform(click());
SystemClock.sleep(200);
searchForTextCloseKeyboard("tn.a or tn.b");
onView(withId(R.id.fragment_query_search_view_flipper)).check(matches(isDisplayed()));
onNotesInSearch().check(matches(recyclerViewItemCount(2)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ public static ViewInteraction contextualToolbarOverflowMenu() {
}

public static void searchForTextCloseKeyboard(String str) {
SystemClock.sleep(100);
onView(isRoot()).perform(waitId(R.id.search_view, 5000));
onView(allOf(withId(R.id.search_view), isDisplayed())).perform(click());
onView(isRoot()).perform(waitId(R.id.search_src_text, 5000));
Expand Down

0 comments on commit acc6e6d

Please sign in to comment.