Browse Source

android e2e works

Daniel Zlotin 8 years ago
parent
commit
00071c99c0
3 changed files with 12 additions and 34 deletions
  1. 0
    3
      package.json
  2. 0
    30
      playground/scripts/e2e.android.js
  3. 12
    1
      scripts/test.android.js

+ 0
- 3
package.json View File

@@ -29,9 +29,6 @@
29 29
     "xcode": "open playground/ios/playground.xcodeproj",
30 30
     "install-android": "cd playground/android && ./gradlew installDebug",
31 31
     "uninstall-android": "cd playground/android && ./gradlew uninstallAll",
32
-    "xcodeunit": "node ./scripts/unit.ios.js",
33
-    "e2e-android": "node ./scripts/e2e.android.js",
34
-    "e2e-ios": "node ./scripts/e2e.ios.js",
35 32
     "start": "adb reverse tcp:8081 tcp:8081; watchman watch-del-all; node ./node_modules/react-native/local-cli/cli.js start --root=./playground",
36 33
     "test-js": "eslint lib/src integration scripts playground/src playground/e2e playground/scripts && BABEL_ENV=test jest --coverage",
37 34
     "test-android": "node ./scripts/test.android.js",

+ 0
- 30
playground/scripts/e2e.android.js View File

@@ -1,30 +0,0 @@
1
-const _ = require('lodash');
2
-const shellUtils = require('shell-utils');
3
-const fs = require('fs');
4
-
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
-}
11
-
12
-function e2e() {
13
-  shellUtils.exec.execSync(`yarn run uninstall-android`);
14
-  shellUtils.exec.execSync(`yarn run android`);
15
-  shellUtils.exec.execSync(`cd ../AndroidE2E/ && ./gradlew connectedDebugAndroidTest`);
16
-}
17
-
18
-function run() {
19
-  if (process.env.CI) {
20
-    return;
21
-  }
22
-  shellUtils.exec.execSync(`echo 'travis_fold:start:android-e2e'`);
23
-  try {
24
-    e2e();
25
-  } finally {
26
-    shellUtils.exec.execSync(`echo 'travis_fold:end:android-e2e'`);
27
-  }
28
-}
29
-
30
-run();

+ 12
- 1
scripts/test.android.js View File

@@ -1,5 +1,16 @@
1 1
 const exec = require('shell-utils').exec;
2 2
 
3
+function e2e() {
4
+  try {
5
+    exec.execSync(`echo 'travis_fold:start:android-e2e'`);
6
+    exec.execSync(`yarn run uninstall-android`);
7
+    exec.execSync(`yarn run install-android`);
8
+    exec.execSync(`cd AndroidE2E && ./gradlew connectedDebugAndroidTest`);
9
+  } finally {
10
+    exec.execSync(`echo 'travis_fold:end:android-e2e'`);
11
+  }
12
+}
13
+
3 14
 function run() {
4 15
   if (process.env.CI) {
5 16
     exec.execSync(`./scripts/installAndroidSDK.sh`);
@@ -8,7 +19,7 @@ function run() {
8 19
   exec.execSync(`cd lib/android && ./gradlew clean testDebugUnitTest`);
9 20
 
10 21
   if (!process.env.CI) {
11
-    // exec.execSync(`cd playground && yarn run e2e-android`);
22
+    e2e();
12 23
   }
13 24
 }
14 25