From 0eaa6f9e5e90f57ecb227bb5746e403390888192 Mon Sep 17 00:00:00 2001
From: Campello Manuel <9112949+CampelloManuel@users.noreply.github.com>
Date: Thu, 12 Sep 2024 18:33:30 +0200
Subject: [PATCH] lower the delay, to speed up tests
---
.../notepad/espresso_tests/EspressoHelper.java | 12 +++++++-----
app/src/main/res/values/strings.xml | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/app/src/androidTest/java/com/nononsenseapps/notepad/espresso_tests/EspressoHelper.java b/app/src/androidTest/java/com/nononsenseapps/notepad/espresso_tests/EspressoHelper.java
index 55c355fa..ead7ff95 100644
--- a/app/src/androidTest/java/com/nononsenseapps/notepad/espresso_tests/EspressoHelper.java
+++ b/app/src/androidTest/java/com/nononsenseapps/notepad/espresso_tests/EspressoHelper.java
@@ -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);
}
/**
@@ -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
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 564248a4..1dc83b5f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -134,7 +134,7 @@
Enable synchronization
Enables synchronization features and allows to choose a sync source. Backups are not affected
Changelog (online)
- Canceled: the note is locked
+ Cancelled: the note is locked
Order notes by:
Show items as:
Version: %s