Browse Source

pop screen deep in stack

Daniel Zlotin 7 years ago
parent
commit
e6c81b626d

+ 31
- 0
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/ScreenStackTest.java View File

@@ -0,0 +1,31 @@
1
+package com.reactnativenavigation.e2e.androide2e;
2
+
3
+import android.support.test.uiautomator.By;
4
+
5
+import org.junit.Ignore;
6
+import org.junit.Test;
7
+
8
+public class ScreenStackTest extends BaseTest {
9
+
10
+	@Test
11
+	public void pushAndPopScreen() throws Exception {
12
+		launchTheApp();
13
+		assertMainShown();
14
+		elementByText("PUSH").click();
15
+		assertExists(By.text("Pushed Screen"));
16
+		elementByText("POP").click();
17
+		assertMainShown();
18
+	}
19
+
20
+	@Test
21
+	@Ignore
22
+	public void popScreenDeepInTheStack() throws Exception {
23
+		launchTheApp();
24
+		assertMainShown();
25
+		elementByText("PUSH").click();
26
+		assertExists(By.text("Pushed Screen"));
27
+		assertExists(By.text("Stack Position: 1"));
28
+		elementByText("PUSH").click();
29
+		assertExists(By.text("Stack Position: 2"));
30
+	}
31
+}

+ 1
- 6
e2e/app.test.js View File

@@ -41,12 +41,7 @@ describe('screen stack', () => {
41 41
     await device.relaunchApp();
42 42
   });
43 43
 
44
-  it('push screen', async () => {
45
-    await elementByLabel('Push').tap();
46
-    await expect(elementByLabel('Pushed Screen')).toBeVisible();
47
-  });
48
-
49
-  it('pop screen', async () => {
44
+  it('push and pop screen', async () => {
50 45
     await elementByLabel('Push').tap();
51 46
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
52 47
     await elementByLabel('Pop').tap();