Browse Source

fixed js tests

Daniel Zlotin 6 years ago
parent
commit
022ca1ec79
3 changed files with 10 additions and 8 deletions
  1. 4
    2
      e2e/AndroidUtils.js
  2. 5
    5
      e2e/ApplicationLifecycleTest.test.js
  3. 1
    1
      e2e/StaticLifecycleEvents.test.js

+ 4
- 2
e2e/AndroidUtils.js View File

19
   openActivity: () => {
19
   openActivity: () => {
20
     exec.execSync('adb shell am start -n com.reactnativenavigation.playground/.MainActivity');
20
     exec.execSync('adb shell am start -n com.reactnativenavigation.playground/.MainActivity');
21
   },
21
   },
22
-  executeShellCommand: (command) => exec.execSync(`adb shell ${command}`)
23
-}
22
+  executeShellCommand: (command) => {
23
+    exec.execSync(`adb shell ${command}`);
24
+  }
25
+};

+ 5
- 5
e2e/ApplicationLifecycleTest.test.js View File

43
   it(':android: device orientation does not destroy activity', async () => {
43
   it(':android: device orientation does not destroy activity', async () => {
44
     await elementById(testIDs.PUSH_BUTTON).tap();
44
     await elementById(testIDs.PUSH_BUTTON).tap();
45
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
45
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
46
-    
46
+
47
     await device.setOrientation('landscape');
47
     await device.setOrientation('landscape');
48
 
48
 
49
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
49
     await expect(elementByLabel('Pushed Screen')).toBeVisible();
60
     await expect(elementByLabel('Pushed Screen')).toBeNotVisible();
60
     await expect(elementByLabel('Pushed Screen')).toBeNotVisible();
61
     await expect(elementByLabel('React Native Navigation!')).toBeVisible();
61
     await expect(elementByLabel('React Native Navigation!')).toBeVisible();
62
   });
62
   });
63
-  
63
+
64
   xit(':android: pressing menu opens dev menu', async () => {
64
   xit(':android: pressing menu opens dev menu', async () => {
65
     if (!IS_RELEASE) {
65
     if (!IS_RELEASE) {
66
       Android.pressMenu();
66
       Android.pressMenu();
101
       await expect(elementByLabel('Pushed Screen')).toBeVisible();
101
       await expect(elementByLabel('Pushed Screen')).toBeVisible();
102
 
102
 
103
       Android.executeShellCommand('am broadcast -a com.reactnativenavigation.broadcast.RELOAD');
103
       Android.executeShellCommand('am broadcast -a com.reactnativenavigation.broadcast.RELOAD');
104
-      
104
+
105
       await sleep(1000);
105
       await sleep(1000);
106
       await expect(elementByLabel('React Native Navigation!')).toBeVisible();
106
       await expect(elementByLabel('React Native Navigation!')).toBeVisible();
107
     }
107
     }
108
   });
108
   });
109
-  
109
+
110
   async function togglePhonePermission() {
110
   async function togglePhonePermission() {
111
     await sleep(700);
111
     await sleep(700);
112
     Android.revokePermission();
112
     Android.revokePermission();
114
     Android.grantPermission();
114
     Android.grantPermission();
115
     await sleep(1000);
115
     await sleep(1000);
116
   }
116
   }
117
-});
117
+});

+ 1
- 1
e2e/StaticLifecycleEvents.test.js View File

15
     await expect(elementByLabel('didAppear | navigation.playground.PushedScreen')).toBeVisible();
15
     await expect(elementByLabel('didAppear | navigation.playground.PushedScreen')).toBeVisible();
16
     await expect(elementByLabel('didDisappear | navigation.playground.WelcomeScreen')).toBeVisible();
16
     await expect(elementByLabel('didDisappear | navigation.playground.WelcomeScreen')).toBeVisible();
17
   });
17
   });
18
-});
18
+});