|
1 | 1 | import { device, expect, element, by } from 'detox'; |
| 2 | +import { describeIfiOS } from '../e2e-utils'; |
2 | 3 |
|
3 | | -describe('Test528', () => { |
| 4 | +// Detox currently supports orientation only on iOS |
| 5 | +describeIfiOS('Test528', () => { |
4 | 6 | beforeAll(async () => { |
5 | 7 | await device.reloadReactNative(); |
6 | 8 | }); |
7 | 9 |
|
8 | | - it('Test528 should exist', async () => { |
9 | | - await waitFor(element(by.id('root-screen-tests-Test528'))) |
10 | | - .toBeVisible() |
11 | | - .whileElement(by.id('root-screen-examples-scrollview')) |
12 | | - .scroll(600, 'down', NaN, 0.85); |
13 | | - |
14 | | - await expect(element(by.id('root-screen-tests-Test528'))).toBeVisible(); |
15 | | - await element(by.id('root-screen-tests-Test528')).tap(); |
| 10 | + it('headerRight button should be visible after orientation change', async () => { |
| 11 | + await expect(element(by.text('Custom Button'))).toBeVisible(100); |
| 12 | + await device.setOrientation('landscape'); |
| 13 | + await expect(element(by.text('Custom Button'))).toBeVisible(100); |
| 14 | + await device.setOrientation('portrait'); |
| 15 | + await expect(element(by.text('Custom Button'))).toBeVisible(100); |
16 | 16 | }); |
17 | 17 |
|
18 | | - // Detox currently supports orientation only on iOS |
19 | | - if (device.getPlatform() === 'ios') { |
20 | | - it('headerRight button should be visible after orientation change', async () => { |
21 | | - await expect(element(by.text('Custom Button'))).toBeVisible(100); |
22 | | - await device.setOrientation('landscape'); |
23 | | - await expect(element(by.text('Custom Button'))).toBeVisible(100); |
24 | | - await device.setOrientation('portrait'); |
25 | | - await expect(element(by.text('Custom Button'))).toBeVisible(100); |
26 | | - }); |
27 | | - |
28 | | - it('headerRight button should be visible after coming back from horizontal screen', async () => { |
29 | | - await element(by.text('Go to Screen 2')).tap(); |
30 | | - await device.setOrientation('landscape'); |
31 | | - await element(by.id('BackButton')).tap(); |
32 | | - await expect(element(by.text('Custom Button'))).toBeVisible(100); |
33 | | - await device.setOrientation('portrait'); |
34 | | - await expect(element(by.text('Custom Button'))).toBeVisible(100); |
35 | | - }); |
36 | | - } |
| 18 | + it('headerRight button should be visible after coming back from horizontal screen', async () => { |
| 19 | + await element(by.text('Go to Screen 2')).tap(); |
| 20 | + await device.setOrientation('landscape'); |
| 21 | + await element(by.id('BackButton')).tap(); |
| 22 | + await expect(element(by.text('Custom Button'))).toBeVisible(100); |
| 23 | + await device.setOrientation('portrait'); |
| 24 | + await expect(element(by.text('Custom Button'))).toBeVisible(100); |
| 25 | + }); |
37 | 26 | }); |
0 commit comments