|
@@ -1,82 +1,3 @@
|
1
|
|
-describe('top level api', () => {
|
2
|
|
- beforeEach(async () => {
|
3
|
|
- await device.relaunchApp();
|
4
|
|
- });
|
5
|
|
-
|
6
|
|
- it('shows welcome screen', async () => {
|
7
|
|
- await expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
8
|
|
- });
|
9
|
|
-
|
10
|
|
- it('switch to tab based app, passProps and functions', async () => {
|
11
|
|
- await elementByLabel('Switch to tab based app').tap();
|
12
|
|
- await expect(elementByLabel('This is tab 1')).toBeVisible();
|
13
|
|
- await expect(elementByLabel('Hello from a function!')).toBeVisible();
|
14
|
|
- });
|
15
|
|
-
|
16
|
|
- it('switch to tabs with side menus', async () => {
|
17
|
|
- await elementByLabel('Switch to app with side menus').tap();
|
18
|
|
- await elementByLabel('This is a side menu center screen tab 1').swipe('right');
|
19
|
|
- await expect(elementByLabel('This is a left side menu screen')).toBeVisible();
|
20
|
|
- });
|
21
|
|
-
|
22
|
|
- it('screen lifecycle', async () => {
|
23
|
|
- await elementByLabel('Push lifecycle screen').tap();
|
24
|
|
- await expect(elementByLabel('onStart')).toBeVisible();
|
25
|
|
- await elementByLabel('Push to test onStop').tap();
|
26
|
|
- await expect(elementByLabel('Alert')).toBeVisible();
|
27
|
|
- await expect(elementByLabel('onStop')).toBeVisible();
|
28
|
|
- });
|
29
|
|
-
|
30
|
|
- it('unmount is called on pop', async () => {
|
31
|
|
- await elementByLabel('Push lifecycle screen').tap();
|
32
|
|
- await expect(elementByLabel('onStart')).toBeVisible();
|
33
|
|
- await element(by.traits(['button']).and(by.label('Back'))).tap();
|
34
|
|
- await expect(elementByLabel('onStop')).toBeVisible();
|
35
|
|
- await expect(elementByLabel('componentWillUnmount')).toBeVisible();
|
36
|
|
- });
|
37
|
|
-});
|
38
|
|
-
|
39
|
|
-describe('screen stack', () => {
|
40
|
|
- beforeEach(async () => {
|
41
|
|
- await device.relaunchApp();
|
42
|
|
- });
|
43
|
|
-
|
44
|
|
- it('push and pop screen', async () => {
|
45
|
|
- await elementByLabel('Push').tap();
|
46
|
|
- await expect(elementByLabel('Pushed Screen')).toBeVisible();
|
47
|
|
- await elementByLabel('Pop').tap();
|
48
|
|
- await expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
49
|
|
- });
|
50
|
|
-
|
51
|
|
- it('pop screen deep in the stack', async () => {
|
52
|
|
- await elementByLabel('Push').tap();
|
53
|
|
- await expect(elementByLabel('Stack Position: 1')).toBeVisible();
|
54
|
|
- await elementByLabel('Push').tap();
|
55
|
|
- await expect(elementByLabel('Stack Position: 2')).toBeVisible();
|
56
|
|
- await elementByLabel('Pop Previous').tap();
|
57
|
|
- await expect(elementByLabel('Stack Position: 2')).toBeVisible();
|
58
|
|
- await elementByLabel('Pop').tap();
|
59
|
|
- await expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
60
|
|
- });
|
61
|
|
-
|
62
|
|
- it('pop to specific id', async () => {
|
63
|
|
- await elementByLabel('Push').tap();
|
64
|
|
- await elementByLabel('Push').tap();
|
65
|
|
- await elementByLabel('Push').tap();
|
66
|
|
- await expect(elementByLabel('Stack Position: 3')).toBeVisible();
|
67
|
|
- await elementByLabel('Pop To Stack Position 1').tap();
|
68
|
|
- await expect(elementByLabel('Stack Position: 1')).toBeVisible();
|
69
|
|
- });
|
70
|
|
-
|
71
|
|
- it('pop to root', async () => {
|
72
|
|
- await elementByLabel('Push').tap();
|
73
|
|
- await elementByLabel('Push').tap();
|
74
|
|
- await elementByLabel('Push').tap();
|
75
|
|
- await elementByLabel('Pop To Root').tap();
|
76
|
|
- await expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
77
|
|
- });
|
78
|
|
-});
|
79
|
|
-
|
80
|
1
|
describe('modal', () => {
|
81
|
2
|
beforeEach(async () => {
|
82
|
3
|
await device.relaunchApp();
|
|
@@ -168,30 +89,6 @@ describe('modal', () => {
|
168
|
89
|
});
|
169
|
90
|
});
|
170
|
91
|
|
171
|
|
-describe('reload app', async () => {
|
172
|
|
- beforeEach(async () => {
|
173
|
|
- await device.relaunchApp();
|
174
|
|
- });
|
175
|
|
-
|
176
|
|
- it('push a screen to ensure its not there after reload', async () => {
|
177
|
|
- await elementByLabel('Push').tap();
|
178
|
|
- await expect(elementByLabel('Pushed Screen')).toBeVisible();
|
179
|
|
- await device.reloadReactNative();
|
180
|
|
- await expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
181
|
|
- });
|
182
|
|
-});
|
183
|
|
-
|
184
|
|
-describe('screen style - static', () => {
|
185
|
|
- beforeEach(async () => {
|
186
|
|
- await device.relaunchApp();
|
187
|
|
- });
|
188
|
|
-
|
189
|
|
- it('declare a navigationStyle on container component', async () => {
|
190
|
|
- await elementByLabel('Push').tap();
|
191
|
|
- await expect(element(by.label('Static Title').and(by.type('UILabel')))).toBeVisible();
|
192
|
|
- });
|
193
|
|
-});
|
194
|
|
-
|
195
|
92
|
function elementByLabel(label) {
|
196
|
93
|
return element(by.label(label));
|
197
|
94
|
}
|