-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathTest432.e2e.ts
More file actions
74 lines (58 loc) · 2.76 KB
/
Test432.e2e.ts
File metadata and controls
74 lines (58 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { device, expect, element, by } from 'detox';
describe('Test432', () => {
beforeAll(async () => {
await device.reloadReactNative();
});
it('Test432 should exist', async () => {
await waitFor(element(by.id('root-screen-tests-Test432')))
.toBeVisible()
.whileElement(by.id('root-screen-examples-scrollview'))
.scroll(600, 'down', NaN, 0.85);
await expect(element(by.id('root-screen-tests-Test432'))).toBeVisible();
await element(by.id('root-screen-tests-Test432')).tap();
});
it('headerRight element should be fully visible', async () => {
await expect(element(by.id('home-headerRight'))).toBeVisible(100);
});
it('headerRight elements should toggle and stay fully visible', async () => {
await element(by.id('home-button-go-to-details')).tap();
await expect(element(by.id('details-headerRight-red'))).toBeVisible(100);
await element(by.id('details-button-toggle-subviews')).tap();
// On Android, we need to wait for some elements (e.g. at first, this square is only 25% visible)
waitFor(element(by.id('details-headerRight-green'))).toBeVisible(100);
await element(by.id('details-button-toggle-subviews')).tap();
await expect(element(by.id('details-headerRight-red'))).toBeVisible(100);
if (device.getPlatform() === 'ios') {
await element(by.id('BackButton')).tap();
} else {
await device.pressBack();
}
await expect(element(by.id('home-headerRight'))).toBeVisible(100);
});
it('headerLeft and headerRight elements should toggle and stay fully visible', async () => {
await element(by.id('home-button-go-to-info')).tap();
await expect(element(by.id('info-headerRight-green-1'))).toBeVisible(100);
await element(by.id('info-button-toggle-subviews')).tap();
waitFor(element(by.id('info-headerRight-green-1'))).toBeVisible(100);
waitFor(element(by.id('info-headerRight-green-2'))).toBeVisible(100);
waitFor(element(by.id('info-headerLeft-red'))).toBeVisible(100);
await element(by.id('info-button-toggle-subviews')).tap();
waitFor(element(by.id('info-headerRight-green-1'))).toBeVisible(100);
if (device.getPlatform() === 'ios') {
await element(by.id('BackButton')).tap();
} else {
await device.pressBack();
}
await expect(element(by.id('home-headerRight'))).toBeVisible(100);
});
it('headerRight element on modal should be fully visible', async () => {
await element(by.id('home-button-show-settings')).tap();
await expect(element(by.id('settings-headerRight'))).toBeVisible(100);
if (device.getPlatform() === 'ios') {
await element(by.id('settings-text')).swipe('down', 'fast');
} else {
await device.pressBack();
}
await expect(element(by.id('home-headerRight'))).toBeVisible(100);
});
});