summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2023-11-22 14:46:59 +0100
committercyBerta <cyberta@riseup.net>2023-11-23 09:51:29 +0100
commitd80e8606039f498f34fb4e7e4f8184c68b541e6f (patch)
treec84922156235d2a6c37804c25730c17d80ce8b6d
parent9da7c99730c09e9b9164dec2f8cfbd2e4c337a69 (diff)
only click on the VPN start button after a successful provider setup if we actually want to test the following activities
-rw-r--r--app/src/androidTest/java/utils/ProviderSetupUtils.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/androidTest/java/utils/ProviderSetupUtils.java b/app/src/androidTest/java/utils/ProviderSetupUtils.java
index 10e0b950..9b76ffbd 100644
--- a/app/src/androidTest/java/utils/ProviderSetupUtils.java
+++ b/app/src/androidTest/java/utils/ProviderSetupUtils.java
@@ -70,6 +70,7 @@ public class ProviderSetupUtils {
showPermissionDialog = true;
tryResolve(onView(withText(R.string.upcoming_connection_request_description)), matches(isDisplayed()), useCircumvention ? 180 : 20);
System.out.println("next: next permission request");
+ if (takeConfigurationScreenshots) Screengrab.screenshot("vpn_permission_rationale");
onView(withText(R.string.next)).perform(click());
UiObject okButton = device.findObject(new UiSelector().packageName("com.android.vpndialogs").resourceId("android:id/button1"));
okButton.waitForExists(30000);
@@ -80,8 +81,12 @@ public class ProviderSetupUtils {
// ------- START VPN --------------
System.out.println("next: perform click on VPN button");
ViewInteraction interaction = tryResolve(onView(withTagValue(Matchers.is("button_setup_circle_custom"))), matches(isDisplayed()), useCircumvention && !showPermissionDialog ? 180 : 20);
- Screengrab.screenshot("all_set_start_vpn");
- interaction.perform(click());
+ if (takeConfigurationScreenshots) {
+ Screengrab.screenshot("all_set_start_vpn");
+ } else {
+ // we only want to start the VPN in case we're not running the ProviderSetupTest
+ interaction.perform(click());
+ }
} catch (NoMatchingViewException e) {
// it might be that the provider was already configured, so we print the stack
// trace here and try to continue