|
@@ -1,13 +1,52 @@
|
1
|
1
|
package com.reactnativenavigation.e2e.androide2e;
|
2
|
2
|
|
3
|
|
-import org.junit.Test;
|
|
3
|
+import android.support.test.uiautomator.By;
|
4
|
4
|
|
5
|
|
-import static org.assertj.core.api.Java6Assertions.assertThat;
|
|
5
|
+import org.junit.Ignore;
|
|
6
|
+import org.junit.Test;
|
6
|
7
|
|
7
|
8
|
public class TopLevelApiTest extends BaseTest {
|
8
|
9
|
|
9
|
10
|
@Test
|
10
|
11
|
public void switchToTabBasedApp() throws Exception {
|
11
|
|
- assertThat(1 + 1).isPositive();
|
|
12
|
+ launchTheApp();
|
|
13
|
+ assertMainShown();
|
|
14
|
+ elementByText("SWITCH TO TAB BASED APP").click();
|
|
15
|
+ assertExists(By.text("This is tab 1"));
|
|
16
|
+ assertExists(By.text("Hello from a function!"));
|
12
|
17
|
}
|
|
18
|
+
|
|
19
|
+ @Test
|
|
20
|
+ public void switchToTabsWithSideMenu() throws Exception {
|
|
21
|
+ launchTheApp();
|
|
22
|
+ assertMainShown();
|
|
23
|
+ elementByText("SWITCH TO APP WITH SIDE MENUS").click();
|
|
24
|
+ assertExists(By.textStartsWith("This is a side menu center screen tab 1"));
|
|
25
|
+ swipeRight();
|
|
26
|
+ assertExists(By.text("This is a left side menu screen"));
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ @Test
|
|
30
|
+ @Ignore
|
|
31
|
+ public void screenLifecycle() throws Exception {
|
|
32
|
+ launchTheApp();
|
|
33
|
+ assertMainShown();
|
|
34
|
+ elementByText("PUSH LIFECYCLE SCREEN").click();
|
|
35
|
+ elementByText("onStart!");
|
|
36
|
+ elementByText("Push to test onStop").click();
|
|
37
|
+ elementByText("Alert");
|
|
38
|
+ elementByText("onStop").click();
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ @Test
|
|
42
|
+ @Ignore
|
|
43
|
+ public void unmountIsCalledOnPop() throws Exception {
|
|
44
|
+ launchTheApp();
|
|
45
|
+ assertMainShown();
|
|
46
|
+ elementByText("Push lifecycle screen").click();
|
|
47
|
+ elementByText("onStart!");
|
|
48
|
+ elementByText("BACK").click();
|
|
49
|
+ elementByText("onStop");
|
|
50
|
+ elementByText("componentWillUnmount");
|
|
51
|
+ }
|
13
|
52
|
}
|