Skip to content

Commit

Permalink
lower the delay, to speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CampelloManuel committed Sep 12, 2024
1 parent b5460b4 commit 0eaa6f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@
public class EspressoHelper {

/**
* Wait for 500ms to work around timing issues on slow emulators. Every time
* this function is called was to solve issues with flaky tests on github runners.
* Keep it: sometime tests need it, sometimes they don't, but you can't know.
* Ideally, it should go after every call to {@link ViewInteraction#perform}
* Wait for 350ms to work around timing issues on slow emulators. It's called to solve issues
* with flaky tests on github runners. Sometime tests need it, sometimes they don't,
* but you can't know. It should go after every call to {@link ViewInteraction#perform}
*/
public static void waitUi() {
InstrumentationRegistry.getInstrumentation().waitForIdleSync();
SystemClock.sleep(500);
SystemClock.sleep(400);
}

/**
Expand Down Expand Up @@ -86,6 +85,9 @@ public static void createTaskList(String taskListName) {
EspressoHelper.hideShowCaseViewIfShown();

onView(withId(R.id.drawer_menu_createlist)).check(matches(isDisplayed()));
// sometimes the automator will hold the button too long. This will show the tooltip,
// and the test will fail because the button did not get the click to show the dialog.
// It's a matter of luck: retry the test and it will work
onView(withId(R.id.drawer_menu_createlist)).perform(click());
waitUi(); // the popup may need time to load

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<string name="enable_sync">Enable synchronization</string>
<string name="enable_sync_desc">Enables synchronization features and allows to choose a sync source. Backups are not affected</string>
<string name="changelog_online">Changelog (online)</string>
<string name="canceled_note_locked">Canceled: the note is locked</string>
<string name="canceled_note_locked">Cancelled: the note is locked</string>
<string name="order_notes_by">Order notes by:</string>
<string name="show_elements_as">Show items as:</string>
<string name="version">Version: %s</string>
Expand Down

0 comments on commit 0eaa6f9

Please sign in to comment.