-
-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathTest528.e2e.ts
More file actions
36 lines (31 loc) · 1.43 KB
/
Test528.e2e.ts
File metadata and controls
36 lines (31 loc) · 1.43 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
import { device, expect, element, by } from 'detox';
import { describeIfiOS } from '../e2e-utils';
// Detox currently supports orientation only on iOS
describeIfiOS('Test528', () => {
beforeAll(async () => {
await device.reloadReactNative();
});
it('Test528 should exist', async () => {
await waitFor(element(by.id('root-screen-tests-Test528')))
.toBeVisible()
.whileElement(by.id('root-screen-examples-scrollview'))
.scroll(600, 'down', NaN, 0.85);
await expect(element(by.id('root-screen-tests-Test528'))).toBeVisible();
await element(by.id('root-screen-tests-Test528')).tap();
});
it('headerRight button should be visible after orientation change', async () => {
await expect(element(by.text('Custom Button'))).toBeVisible(100);
await device.setOrientation('landscape');
await expect(element(by.text('Custom Button'))).toBeVisible(100);
await device.setOrientation('portrait');
await expect(element(by.text('Custom Button'))).toBeVisible(100);
});
it('headerRight button should be visible after coming back from horizontal screen', async () => {
await element(by.text('Go to Screen 2')).tap();
await device.setOrientation('landscape');
await element(by.id('BackButton')).tap();
await expect(element(by.text('Custom Button'))).toBeVisible(100);
await device.setOrientation('portrait');
await expect(element(by.text('Custom Button'))).toBeVisible(100);
});
});