|
@@ -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
|
|
26
|
23
|
|
27
|
24
|
|
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
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
40
|
38
|
|
41
|
39
|
private void launchTheApp() throws Exception {
|
42
|
|
-
|
43
|
40
|
uiDevice().wakeUp();
|
44
|
41
|
uiDevice().pressHome();
|
45
|
42
|
uiDevice().waitForIdle();
|