|
|
|
|
44
|
elementByLabel('Pop').tap();
|
44
|
elementByLabel('Pop').tap();
|
45
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
45
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
46
|
});
|
46
|
});
|
47
|
-
|
|
|
|
|
47
|
+
|
48
|
it('pop screen deep in the stack', () => {
|
48
|
it('pop screen deep in the stack', () => {
|
49
|
elementByLabel('Push').tap();
|
49
|
elementByLabel('Push').tap();
|
50
|
expect(elementByLabel('Stack Position: 1')).toBeVisible();
|
50
|
expect(elementByLabel('Stack Position: 1')).toBeVisible();
|
|
|
|
|
57
|
});
|
57
|
});
|
58
|
});
|
58
|
});
|
59
|
|
59
|
|
60
|
-
|
|
|
61
|
describe('modal', () => {
|
60
|
describe('modal', () => {
|
62
|
beforeEach((done) => {
|
61
|
beforeEach((done) => {
|
63
|
global.simulator.relaunchApp(done);
|
62
|
global.simulator.relaunchApp(done);
|
64
|
});
|
63
|
});
|
65
|
-
|
|
|
|
|
64
|
+
|
66
|
it('show modal', () => {
|
65
|
it('show modal', () => {
|
67
|
elementByLabel('Show Modal').tap();
|
66
|
elementByLabel('Show Modal').tap();
|
68
|
expect(elementByLabel('Modal Screen')).toBeVisible();
|
67
|
expect(elementByLabel('Modal Screen')).toBeVisible();
|
69
|
});
|
68
|
});
|
70
|
-
|
|
|
|
|
69
|
+
|
71
|
it('dismiss modal', () => {
|
70
|
it('dismiss modal', () => {
|
72
|
elementByLabel('Show Modal').tap();
|
71
|
elementByLabel('Show Modal').tap();
|
73
|
expect(elementByLabel('Modal Screen')).toBeVisible();
|
72
|
expect(elementByLabel('Modal Screen')).toBeVisible();
|
74
|
elementByLabel('Dismiss Modal').tap();
|
73
|
elementByLabel('Dismiss Modal').tap();
|
75
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
74
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
76
|
});
|
75
|
});
|
77
|
-
|
|
|
|
|
76
|
+
|
78
|
it('show multiple modals', () => {
|
77
|
it('show multiple modals', () => {
|
79
|
elementByLabel('Show Modal').tap();
|
78
|
elementByLabel('Show Modal').tap();
|
80
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
79
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
|
|
|
|
85
|
elementByLabel('Dismiss Modal').tap();
|
84
|
elementByLabel('Dismiss Modal').tap();
|
86
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
85
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
87
|
});
|
86
|
});
|
88
|
-
|
|
|
|
|
87
|
+
|
89
|
it('dismiss unknown screen id', () => {
|
88
|
it('dismiss unknown screen id', () => {
|
90
|
elementByLabel('Show Modal').tap();
|
89
|
elementByLabel('Show Modal').tap();
|
91
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
90
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
|
|
|
|
94
|
elementByLabel('Dismiss Modal').tap();
|
93
|
elementByLabel('Dismiss Modal').tap();
|
95
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
94
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
96
|
});
|
95
|
});
|
97
|
-
|
|
|
|
|
96
|
+
|
98
|
it('dismiss modal by id which is not the top most', () => {
|
97
|
it('dismiss modal by id which is not the top most', () => {
|
99
|
elementByLabel('Show Modal').tap();
|
98
|
elementByLabel('Show Modal').tap();
|
100
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
99
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
|
|
|
|
105
|
elementByLabel('Dismiss Modal').tap();
|
104
|
elementByLabel('Dismiss Modal').tap();
|
106
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
105
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
107
|
});
|
106
|
});
|
108
|
-
|
|
|
|
|
107
|
+
|
109
|
it('dismiss all previous modals by id when they are below top presented modal', () => {
|
108
|
it('dismiss all previous modals by id when they are below top presented modal', () => {
|
110
|
elementByLabel('Show Modal').tap();
|
109
|
elementByLabel('Show Modal').tap();
|
111
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
110
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
|
|
|
|
113
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
112
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
114
|
elementByLabel('Show Modal').tap();
|
113
|
elementByLabel('Show Modal').tap();
|
115
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
114
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
116
|
-
|
|
|
|
|
115
|
+
|
117
|
elementByLabel('Dismiss ALL Previous Modals').tap();
|
116
|
elementByLabel('Dismiss ALL Previous Modals').tap();
|
118
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
117
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
119
|
-
|
|
|
|
|
118
|
+
|
120
|
elementByLabel('Dismiss Modal').tap();
|
119
|
elementByLabel('Dismiss Modal').tap();
|
121
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
120
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
122
|
});
|
121
|
});
|
123
|
-
|
|
|
|
|
122
|
+
|
124
|
it('dismiss some modal by id deep in the stack', () => {
|
123
|
it('dismiss some modal by id deep in the stack', () => {
|
125
|
elementByLabel('Show Modal').tap();
|
124
|
elementByLabel('Show Modal').tap();
|
126
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
125
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
|
|
|
|
128
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
127
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
129
|
elementByLabel('Show Modal').tap();
|
128
|
elementByLabel('Show Modal').tap();
|
130
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
129
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
131
|
-
|
|
|
|
|
130
|
+
|
132
|
elementByLabel('Dismiss First In Stack').tap();
|
131
|
elementByLabel('Dismiss First In Stack').tap();
|
133
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
132
|
expect(elementByLabel('Modal Stack Position: 3')).toBeVisible();
|
134
|
-
|
|
|
|
|
133
|
+
|
135
|
elementByLabel('Dismiss Modal').tap();
|
134
|
elementByLabel('Dismiss Modal').tap();
|
136
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
135
|
expect(elementByLabel('Modal Stack Position: 2')).toBeVisible();
|
137
|
-
|
|
|
|
|
136
|
+
|
138
|
elementByLabel('Dismiss Modal').tap();
|
137
|
elementByLabel('Dismiss Modal').tap();
|
139
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
138
|
expect(elementByLabel('React Native Navigation!')).toBeVisible();
|
140
|
});
|
139
|
});
|
141
|
-
|
|
|
|
|
140
|
+
|
142
|
it('dismissAllModals', () => {
|
141
|
it('dismissAllModals', () => {
|
143
|
elementByLabel('Show Modal').tap();
|
142
|
elementByLabel('Show Modal').tap();
|
144
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|
143
|
expect(elementByLabel('Modal Stack Position: 1')).toBeVisible();
|