diff --git a/android/app/src/androidTest/java/org/whoneedhelp/mobile/AndroidClientInstrumentedTest.java b/android/app/src/androidTest/java/org/whoneedhelp/mobile/AndroidClientInstrumentedTest.java index 831225d..31ad4d0 100644 --- a/android/app/src/androidTest/java/org/whoneedhelp/mobile/AndroidClientInstrumentedTest.java +++ b/android/app/src/androidTest/java/org/whoneedhelp/mobile/AndroidClientInstrumentedTest.java @@ -315,6 +315,13 @@ public final class AndroidClientInstrumentedTest { cancel.click(); waitForServiceState(false); + onWebView() + .withElement(findElement(Locator.ID, "marker")) + .check(webMatches(getText(), containsString("tracking-cancelled"))); + assertFalse( + "Cancelling live-location disclosure was reported as a technical error", + device.hasObject(By.text("tracking-error")) + ); } } @@ -537,12 +544,19 @@ public final class AndroidClientInstrumentedTest { } private ActivityScenario launch(String path) { - Intent intent = new Intent( - Intent.ACTION_VIEW, - Uri.parse(BuildConfig.BASE_URL + path), - context, - MainActivity.class - ); + String targetUrl = BuildConfig.BASE_URL + path; + Intent intent = new Intent(context, MainActivity.class); + + if (AppLinkRoutePolicy.allows(targetUrl)) { + intent.setAction(Intent.ACTION_VIEW); + intent.setData(Uri.parse(targetUrl)); + } else { + // Instrumentation-only fixture routes are intentionally outside the + // production App Link allowlist. Debug builds expose a same-origin + // initial URL extra specifically for these isolated test pages. + intent.putExtra("initial_url", targetUrl); + } + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return ActivityScenario.launch(intent); } diff --git a/android/app/src/androidTest/java/org/whoneedhelp/mobile/FixtureHttpServer.java b/android/app/src/androidTest/java/org/whoneedhelp/mobile/FixtureHttpServer.java index b47598c..7b49ab8 100644 --- a/android/app/src/androidTest/java/org/whoneedhelp/mobile/FixtureHttpServer.java +++ b/android/app/src/androidTest/java/org/whoneedhelp/mobile/FixtureHttpServer.java @@ -259,6 +259,12 @@ final class FixtureHttpServer implements Closeable { + "" + "Who Need Help Android fixture" + "

loaded:" + escapedPath + "

" + + "" + " +
+ +
+

{gettext("Waiting for location permission…")}

+

+ {gettext( + "Complete the location permission prompt. If you cancel, no location will be shared." + )} +

+
+
+
+ <.icon name="hero-map-pin" class="mt-0.5 size-5 shrink-0" /> +
+

{gettext("Live location is being shared")}

+

+ {gettext( + "Only your matched participant can see your current position. Stop sharing to remove the stored coordinates." + )} +

+
+