|
@@ -8,39 +8,52 @@ describe('orientation', () => {
|
8
|
8
|
await device.relaunchApp();
|
9
|
9
|
});
|
10
|
10
|
|
11
|
|
- it('orientation should not change from landscape', async () => {
|
12
|
|
- await elementByLabel('Orientation').tap();
|
|
11
|
+ afterEach(async () => {
|
13
|
12
|
await device.setOrientation('landscape');
|
14
|
|
- await elementByLabel('Push landscape only screen').tap();
|
15
|
13
|
await device.setOrientation('portrait');
|
16
|
|
- await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');
|
17
|
14
|
});
|
18
|
15
|
|
19
|
|
- it('orientation should not change from portrait', async () => {
|
|
16
|
+ it('default allows all', async () => {
|
20
|
17
|
await elementByLabel('Orientation').tap();
|
21
|
|
- await device.setOrientation('portrait');
|
22
|
|
- await elementByLabel('Push portrait only screen').tap();
|
|
18
|
+ await elementByLabel('default').tap();
|
|
19
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
23
|
20
|
await device.setOrientation('landscape');
|
|
21
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');
|
|
22
|
+ await device.setOrientation('portrait');
|
24
|
23
|
await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
|
24
|
+ await elementByLabel('Dismiss').tap();
|
25
|
25
|
});
|
26
|
26
|
|
27
|
|
- it('orientation should change to portrait and landscape', async () => {
|
|
27
|
+ it('landscape and portrait array', async () => {
|
28
|
28
|
await elementByLabel('Orientation').tap();
|
29
|
|
- await device.setOrientation('portrait');
|
30
|
|
- await elementByLabel('Push landscape and portrait').tap();
|
|
29
|
+ await elementByLabel('landscape and portrait').tap();
|
|
30
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
31
|
31
|
await device.setOrientation('landscape');
|
32
|
32
|
await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');
|
33
|
33
|
await device.setOrientation('portrait');
|
34
|
34
|
await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
|
35
|
+ await elementByLabel('Dismiss').tap();
|
35
|
36
|
});
|
36
|
37
|
|
37
|
|
- it('orientation default should change to portrait and landscape', async () => {
|
|
38
|
+ it('portrait only', async () => {
|
38
|
39
|
await elementByLabel('Orientation').tap();
|
|
40
|
+ await elementByLabel('portrait only').tap();
|
|
41
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
|
42
|
+ await device.setOrientation('landscape');
|
|
43
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
39
|
44
|
await device.setOrientation('portrait');
|
40
|
|
- await elementByLabel('Push default').tap();
|
|
45
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
|
46
|
+ await elementByLabel('Dismiss').tap();
|
|
47
|
+ });
|
|
48
|
+
|
|
49
|
+ it('landscape only', async () => {
|
|
50
|
+ await elementByLabel('Orientation').tap();
|
|
51
|
+ await elementByLabel('landscape only').tap();
|
|
52
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
41
|
53
|
await device.setOrientation('landscape');
|
42
|
54
|
await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');
|
43
|
55
|
await device.setOrientation('portrait');
|
44
|
|
- await expect(element(by.id('currentOrientation'))).toHaveText('Portrait');
|
|
56
|
+ await expect(element(by.id('currentOrientation'))).toHaveText('Landscape');
|
|
57
|
+ await elementByLabel('Dismiss').tap();
|
45
|
58
|
});
|
46
|
59
|
});
|