|
@@ -78,7 +78,10 @@ public class ApplicationLifecycleTest {
|
78
|
78
|
rule.launchActivity(null);
|
79
|
79
|
}
|
80
|
80
|
|
81
|
|
- private void acceptPermission() throws Exception {
|
|
81
|
+ private void acceptPermissionIfNeeded() throws Exception {
|
|
82
|
+ if (Settings.canDrawOverlays(getInstrumentation().getContext())) {
|
|
83
|
+ return;
|
|
84
|
+ }
|
82
|
85
|
UiDevice.getInstance(getInstrumentation()).findObject(new UiSelector().text("Playground")).click();
|
83
|
86
|
UiDevice.getInstance(getInstrumentation()).findObject(new UiSelector().text("Permit drawing over other apps")).click();
|
84
|
87
|
UiDevice.getInstance(getInstrumentation()).pressBack();
|
|
@@ -90,7 +93,7 @@ public class ApplicationLifecycleTest {
|
90
|
93
|
public void startApp_HandleOverlayPermissions_LoadsBridge_ThenShowsWelcomeScreen() throws Exception {
|
91
|
94
|
assumeFalse(Settings.canDrawOverlays(getInstrumentation().getContext()));
|
92
|
95
|
launchActivity();
|
93
|
|
- acceptPermission();
|
|
96
|
+ acceptPermissionIfNeeded();
|
94
|
97
|
onView(withText("React Native Navigation!")).check(matches(isDisplayed()));
|
95
|
98
|
}
|
96
|
99
|
|
|
@@ -100,4 +103,8 @@ public class ApplicationLifecycleTest {
|
100
|
103
|
launchActivity();
|
101
|
104
|
onView(withText("React Native Navigation!")).check(matches(isDisplayed()));
|
102
|
105
|
}
|
|
106
|
+
|
|
107
|
+ @Test
|
|
108
|
+ public void () {
|
|
109
|
+ }
|
103
|
110
|
}
|