|
@@ -2,11 +2,9 @@ package com.reactnativenavigation.e2e.androide2e;
|
2
|
2
|
|
3
|
3
|
import android.annotation.TargetApi;
|
4
|
4
|
import android.content.Intent;
|
5
|
|
-import android.provider.Settings;
|
6
|
5
|
import android.support.test.filters.SdkSuppress;
|
7
|
6
|
import android.support.test.runner.AndroidJUnit4;
|
8
|
7
|
import android.support.test.uiautomator.UiDevice;
|
9
|
|
-import android.support.test.uiautomator.UiSelector;
|
10
|
8
|
|
11
|
9
|
import org.junit.Test;
|
12
|
10
|
import org.junit.runner.RunWith;
|
|
@@ -21,25 +19,24 @@ public class ApplicationLifecycleTest {
|
21
|
19
|
@Test
|
22
|
20
|
public void showSplash_AcceptsOverlayPermissions_ShowsWelcomeScreen() throws Exception {
|
23
|
21
|
launchTheApp();
|
24
|
|
- Thread.sleep(2000);
|
25
|
22
|
// assertThat(rule.getActivity().getContentView()).isNotNull().isInstanceOf(NavigationSplashView.class);
|
26
|
23
|
// acceptOverlayPermissionIfNeeded();
|
27
|
24
|
// assertMainShown();
|
28
|
25
|
}
|
29
|
26
|
|
30
|
|
- private void acceptOverlayPermissionIfNeeded() throws Exception {
|
31
|
|
- if (Settings.canDrawOverlays(getInstrumentation().getTargetContext())) {
|
32
|
|
- return;
|
33
|
|
- }
|
34
|
|
- uiDevice().waitForIdle();
|
35
|
|
- uiDevice().findObject(new UiSelector().text("Playground")).click();
|
36
|
|
- uiDevice().findObject(new UiSelector().text("Permit drawing over other apps")).click();
|
37
|
|
- uiDevice().pressBack();
|
38
|
|
- uiDevice().pressBack();
|
39
|
|
- }
|
|
27
|
+// private void acceptOverlayPermissionIfNeeded() throws Exception {
|
|
28
|
+// if (Settings.canDrawOverlays(getInstrumentation().getTargetContext())) {
|
|
29
|
+// return;
|
|
30
|
+// }
|
|
31
|
+// uiDevice().waitForIdle();
|
|
32
|
+// uiDevice().findObject(new UiSelector().text("Playground")).click();
|
|
33
|
+// uiDevice().findObject(new UiSelector().text("Permit drawing over other apps")).click();
|
|
34
|
+// uiDevice().pressBack();
|
|
35
|
+// uiDevice().pressBack();
|
|
36
|
+// }
|
|
37
|
+// uiDevice().findObject(new UiSelector().description("Apps")).clickAndWaitForNewWindow();
|
40
|
38
|
|
41
|
39
|
private void launchTheApp() throws Exception {
|
42
|
|
-// uiDevice().findObject(new UiSelector().description("Apps")).clickAndWaitForNewWindow();
|
43
|
40
|
uiDevice().wakeUp();
|
44
|
41
|
uiDevice().pressHome();
|
45
|
42
|
uiDevice().waitForIdle();
|