Kaynağa Gözat

ignored android modal e2e

Daniel Zlotin 8 yıl önce
ebeveyn
işleme
5613738cb5

+ 84
- 9
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/ModalsTest.java Dosyayı Görüntüle

5
 import org.junit.Ignore;
5
 import org.junit.Ignore;
6
 import org.junit.Test;
6
 import org.junit.Test;
7
 
7
 
8
-import static org.junit.Assert.fail;
9
-
10
 public class ModalsTest extends BaseTest {
8
 public class ModalsTest extends BaseTest {
11
 	@Ignore
9
 	@Ignore
12
 	@Test
10
 	@Test
20
 	@Ignore
18
 	@Ignore
21
 	@Test
19
 	@Test
22
 	public void dismissModal() throws Exception {
20
 	public void dismissModal() throws Exception {
23
-		fail("to implement");
21
+		launchTheApp();
22
+		assertMainShown();
23
+		elementByText("SHOW MODAL").click();
24
+		assertExists(By.text("Modal Screen"));
25
+
26
+		elementByText("DISMISS MODAL").click();
27
+		assertMainShown();
28
+
24
 	}
29
 	}
25
 
30
 
26
 	@Ignore
31
 	@Ignore
27
 	@Test
32
 	@Test
28
 	public void showMultipleModals() throws Exception {
33
 	public void showMultipleModals() throws Exception {
29
-		fail("to implement");
34
+		launchTheApp();
35
+		assertMainShown();
36
+		elementByText("SHOW MODAL").click();
37
+		assertExists(By.text("Modal Stack Position: 1"));
38
+
39
+		elementByText("SHOW MODAL").click();
40
+		assertExists(By.text("Modal Stack Position: 2"));
41
+
42
+		elementByText("DISMISS MODAL").click();
43
+		assertExists(By.text("Modal Stack Position: 1"));
44
+
45
+		elementByText("DISMISS MODAL").click();
46
+		assertMainShown();
30
 	}
47
 	}
31
 
48
 
32
 	@Ignore
49
 	@Ignore
33
 	@Test
50
 	@Test
34
 	public void dismissUnknownContainerId() throws Exception {
51
 	public void dismissUnknownContainerId() throws Exception {
35
-		fail("to implement");
52
+		launchTheApp();
53
+		assertMainShown();
54
+		elementByText("SHOW MODAL").click();
55
+		assertExists(By.text("Modal Stack Position: 1"));
56
+
57
+		elementByText("DISMISS UNKNOWN MODAL").click();
58
+		assertExists(By.text("Modal Stack Position: 1"));
59
+
60
+		elementByText("DISMISS MODAL").click();
61
+		assertMainShown();
36
 	}
62
 	}
37
 
63
 
38
 	@Ignore
64
 	@Ignore
39
 	@Test
65
 	@Test
40
 	public void dismissModalByContainerIdWhenNotOnTop() throws Exception {
66
 	public void dismissModalByContainerIdWhenNotOnTop() throws Exception {
41
-		fail("to implement");
67
+		launchTheApp();
68
+		assertMainShown();
69
+		elementByText("SHOW MODAL").click();
70
+		assertExists(By.text("Modal Stack Position: 1"));
71
+
72
+		elementByText("SHOW MODAL").click();
73
+		assertExists(By.text("Modal Stack Position: 2"));
74
+
75
+		elementByText("DISMISS PREVIOUS MODAL").click();
76
+		assertExists(By.text("Modal Stack Position: 2"));
77
+
78
+		elementByText("DISMISS MODAL").click();
79
+		assertMainShown();
42
 	}
80
 	}
43
 
81
 
44
 	@Ignore
82
 	@Ignore
45
 	@Test
83
 	@Test
46
 	public void dismissAllPreviousModalsByIdWhenTheyAreBelowTopPresented() throws Exception {
84
 	public void dismissAllPreviousModalsByIdWhenTheyAreBelowTopPresented() throws Exception {
47
-		fail("to implement");
85
+		launchTheApp();
86
+		assertMainShown();
87
+		elementByText("SHOW MODAL").click();
88
+		assertExists(By.text("Modal Stack Position: 1"));
89
+		elementByText("SHOW MODAL").click();
90
+		assertExists(By.text("Modal Stack Position: 2"));
91
+		elementByText("SHOW MODAL").click();
92
+		assertExists(By.text("Modal Stack Position: 3"));
93
+
94
+		elementByText("DISMISS ALL PREVIOUS MODALS").click();
95
+		assertExists(By.text("Modal Stack Position: 3"));
96
+
97
+		elementByText("DISMISS MODAL").click();
98
+		assertMainShown();
48
 	}
99
 	}
49
 
100
 
50
 	@Ignore
101
 	@Ignore
51
 	@Test
102
 	@Test
52
 	public void dismissSomeModalByIdDeepInTheStack() throws Exception {
103
 	public void dismissSomeModalByIdDeepInTheStack() throws Exception {
53
-		fail("to implement");
104
+		launchTheApp();
105
+		assertMainShown();
106
+		elementByText("SHOW MODAL").click();
107
+		assertExists(By.text("Modal Stack Position: 1"));
108
+		elementByText("SHOW MODAL").click();
109
+		assertExists(By.text("Modal Stack Position: 2"));
110
+		elementByText("SHOW MODAL").click();
111
+		assertExists(By.text("Modal Stack Position: 3"));
112
+
113
+		elementByText("DISMISS FIRST IN THE STACK").click();
114
+		assertExists(By.text("Modal Stack Position: 3"));
115
+
116
+		elementByText("DISMISS MODAL").click();
117
+		assertExists(By.text("Modal Stack Position: 2"));
118
+
119
+		elementByText("DISMISS MODAL").click();
120
+		assertMainShown();
54
 	}
121
 	}
55
 
122
 
56
 	@Ignore
123
 	@Ignore
57
 	@Test
124
 	@Test
58
 	public void dismissAllModals() throws Exception {
125
 	public void dismissAllModals() throws Exception {
59
-		fail("to implement");
126
+		launchTheApp();
127
+		assertMainShown();
128
+		elementByText("SHOW MODAL").click();
129
+		assertExists(By.text("Modal Stack Position: 1"));
130
+		elementByText("SHOW MODAL").click();
131
+		assertExists(By.text("Modal Stack Position: 2"));
132
+
133
+		elementByText("DISMISS ALL MODALS").click();
134
+		assertMainShown();
60
 	}
135
 	}
61
 }
136
 }