Browse Source

trying to run android emulator

Daniel Zlotin 7 years ago
parent
commit
ca13ad1885
1 changed files with 17 additions and 9 deletions
  1. 17
    9
      playground/scripts/e2e.android.js

+ 17
- 9
playground/scripts/e2e.android.js View File

2
 const shellUtils = require('shell-utils');
2
 const shellUtils = require('shell-utils');
3
 const fs = require('fs');
3
 const fs = require('fs');
4
 
4
 
5
-const release = _.includes(process.argv, 'release');
5
+// function runEmulator() {
6
+//   shellUtils.exec.execSync(`echo no | android create avd --force -n test -t android-25 --abi armeabi-v7a`);
7
+//   shellUtils.exec.execSync(`emulator -avd test -no-skin -no-audio -no-window &`);
8
+//   shellUtils.exec.execSync(`android-wait-for-emulator`);
9
+//   shellUtils.exec.execSync(`adb shell input keyevent 82 &`);
10
+// }
6
 
11
 
7
-function e2e() { //eslint-disable-line
12
+function e2e() {
13
+  shellUtils.exec.execSync(`cd android && ./gradlew uninstallAll`);
14
+  shellUtils.exec.execSync(`cd android && ./gradlew connectedDebugAndroidTest`);
15
+}
16
+
17
+function run() {
18
+  shellUtils.exec.execSync(`echo 'travis_fold:start:android-espresso'`);
8
   try {
19
   try {
9
-    shellUtils.exec.execSync(`echo 'travis_fold:start:android-espresso'`);
10
-    shellUtils.exec.execSync(`cd android && ./gradlew uninstallAll`);
11
-    shellUtils.exec.execSync(`cd android && ./gradlew connectedDebugAndroidTest`);
20
+    // if (process.env.CI) {
21
+    // runEmulator();
22
+    // }
23
+    e2e();
12
   } finally {
24
   } finally {
13
     shellUtils.exec.execSync(`echo 'travis_fold:end:android-espresso'`);
25
     shellUtils.exec.execSync(`echo 'travis_fold:end:android-espresso'`);
14
   }
26
   }
15
 }
27
 }
16
 
28
 
17
-function run() {
18
-  e2e();
19
-}
20
-
21
 run();
29
 run();