|
@@ -4,6 +4,7 @@ import android.content.Intent;
|
4
|
4
|
import android.net.Uri;
|
5
|
5
|
import android.provider.Settings;
|
6
|
6
|
import android.support.test.uiautomator.By;
|
|
7
|
+import android.view.KeyEvent;
|
7
|
8
|
|
8
|
9
|
import org.junit.FixMethodOrder;
|
9
|
10
|
import org.junit.Test;
|
|
@@ -37,6 +38,8 @@ public class ApplicationLifecycleTest extends BaseTest {
|
37
|
38
|
@Test
|
38
|
39
|
public void _3_relaunchAfterClose() throws Exception {
|
39
|
40
|
launchTheApp();
|
|
41
|
+ assertMainShown();
|
|
42
|
+
|
40
|
43
|
elementByText("PUSH").click();
|
41
|
44
|
assertExists(By.text("Pushed Screen"));
|
42
|
45
|
|
|
@@ -49,6 +52,7 @@ public class ApplicationLifecycleTest extends BaseTest {
|
49
|
52
|
@Test
|
50
|
53
|
public void _4_deviceOrientationDoesNotDestroyActivity() throws Exception {
|
51
|
54
|
launchTheApp();
|
|
55
|
+ assertMainShown();
|
52
|
56
|
elementByText("PUSH").click();
|
53
|
57
|
assertExists(By.text("Pushed Screen"));
|
54
|
58
|
|
|
@@ -61,6 +65,7 @@ public class ApplicationLifecycleTest extends BaseTest {
|
61
|
65
|
@Test
|
62
|
66
|
public void _5_relaunchAfterActivityKilledBySystem() throws Exception {
|
63
|
67
|
launchTheApp();
|
|
68
|
+ assertMainShown();
|
64
|
69
|
elementByText("PUSH").click();
|
65
|
70
|
assertExists(By.text("Pushed Screen"));
|
66
|
71
|
|
|
@@ -71,6 +76,17 @@ public class ApplicationLifecycleTest extends BaseTest {
|
71
|
76
|
assertMainShown();
|
72
|
77
|
}
|
73
|
78
|
|
|
79
|
+ @Test
|
|
80
|
+ public void _6_reloadReactNativeApp() throws Exception {
|
|
81
|
+ launchTheApp();
|
|
82
|
+ assertMainShown();
|
|
83
|
+ elementByText("PUSH").click();
|
|
84
|
+ assertExists(By.text("Pushed Screen"));
|
|
85
|
+ device().pressKeyCode(KeyEvent.KEYCODE_R);
|
|
86
|
+ device().pressKeyCode(KeyEvent.KEYCODE_R);
|
|
87
|
+ assertMainShown();
|
|
88
|
+ }
|
|
89
|
+
|
74
|
90
|
private void killAppSaveInstanceState_ByTogglingPermissions() throws Exception {
|
75
|
91
|
device().pressHome();
|
76
|
92
|
|