From be186e4eda72f14eb3b8f6fab76fbeda9d9fb175 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 3 Jul 2026 13:23:32 +0200 Subject: fix and extend instrumentation tests used for automatted screenshots --- app/src/androidTest/java/utils/CustomInteractions.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/src/androidTest/java/utils/CustomInteractions.java') diff --git a/app/src/androidTest/java/utils/CustomInteractions.java b/app/src/androidTest/java/utils/CustomInteractions.java index 4890c20c..35f8b48f 100644 --- a/app/src/androidTest/java/utils/CustomInteractions.java +++ b/app/src/androidTest/java/utils/CustomInteractions.java @@ -18,7 +18,11 @@ public class CustomInteractions { return tryResolve(viewInteraction, assertion, 10); } - public static @Nullable ViewInteraction tryResolve(ViewInteraction viewInteraction, ViewAssertion assertion, int maxTries) { + public static @Nullable ViewInteraction tryResolve(ViewInteraction viewInteraction, ViewAssertion assertion, int maxTries) { + return tryResolve(viewInteraction, assertion, maxTries, ""); + } + + public static @Nullable ViewInteraction tryResolve(ViewInteraction viewInteraction, ViewAssertion assertion, int maxTries, String message) { ViewInteraction resolvedViewInteraction = null; int attempt = 0; boolean hasFound = false; @@ -30,7 +34,7 @@ public class CustomInteractions { } hasFound = true; } catch (NoMatchingViewException exception) { - System.out.println("NoMatchingViewException - attempt: " + attempt + ". " + exception.getLocalizedMessage()); + System.out.println("NoMatchingViewException " + message +" - attempt: " + attempt + ". " + exception.getLocalizedMessage()); attempt++; if (attempt == maxTries) { throw exception; -- cgit v1.2.3