Parcourir la source

trying to run android emulator

Daniel Zlotin il y a 7 ans
Parent
révision
ca13ad1885
1 fichiers modifiés avec 17 ajouts et 9 suppressions
  1. 17
    9
      playground/scripts/e2e.android.js

+ 17
- 9
playground/scripts/e2e.android.js Voir le fichier

@@ -2,20 +2,28 @@ const _ = require('lodash');
2 2
 const shellUtils = require('shell-utils');
3 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 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 24
   } finally {
13 25
     shellUtils.exec.execSync(`echo 'travis_fold:end:android-espresso'`);
14 26
   }
15 27
 }
16 28
 
17
-function run() {
18
-  e2e();
19
-}
20
-
21 29
 run();