Browse Source

Enablee parallel e2e exec on Android, switch to quick-booting emu (#5686)

d4vidi 5 years ago
parent
commit
b53bbf346f
2 changed files with 6 additions and 3 deletions
  1. 3
    2
      package.json
  2. 3
    1
      scripts/test-e2e.js

+ 3
- 2
package.json View File

35
     "test-unit-android": "node ./scripts/test-unit --android",
35
     "test-unit-android": "node ./scripts/test-unit --android",
36
     "pretest-e2e-android": "npm run build",
36
     "pretest-e2e-android": "npm run build",
37
     "test-e2e-android": "node ./scripts/test-e2e --android",
37
     "test-e2e-android": "node ./scripts/test-e2e --android",
38
+    "test-e2e-android-multi": "npm run test-e2e-android -- --multi",
38
     "test-e2e-android-locked": "node ./scripts/test-e2e-android-locked",
39
     "test-e2e-android-locked": "node ./scripts/test-e2e-android-locked",
39
     "pretest-e2e-ios": "npm run build",
40
     "pretest-e2e-ios": "npm run build",
40
     "test-e2e-ios": "node ./scripts/test-e2e --ios",
41
     "test-e2e-ios": "node ./scripts/test-e2e --ios",
150
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",
151
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",
151
         "build": "cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug",
152
         "build": "cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug",
152
         "type": "android.emulator",
153
         "type": "android.emulator",
153
-        "name": "Pixel_2_API_26"
154
+        "name": "Nexus_5X_API_26"
154
       },
155
       },
155
       "android.emu.release": {
156
       "android.emu.release": {
156
         "binaryPath": "playground/android/app/build/outputs/apk/release/app-release.apk",
157
         "binaryPath": "playground/android/app/build/outputs/apk/release/app-release.apk",
157
         "build": "cd playground/android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release",
158
         "build": "cd playground/android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release",
158
         "type": "android.emulator",
159
         "type": "android.emulator",
159
-        "name": "Pixel_2_API_26"
160
+        "name": "Nexus_5X_API_26"
160
       },
161
       },
161
       "android.emu.debug.locked": {
162
       "android.emu.debug.locked": {
162
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",
163
         "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",

+ 3
- 1
scripts/test-e2e.js View File

6
 const skipBuild = _.includes(process.argv, '--skipBuild');
6
 const skipBuild = _.includes(process.argv, '--skipBuild');
7
 const headless = _.includes(process.argv, '--headless');
7
 const headless = _.includes(process.argv, '--headless');
8
 const multi = _.includes(process.argv, '--multi');
8
 const multi = _.includes(process.argv, '--multi');
9
+const verbose = _.includes(process.argv, '--verbose');
9
 
10
 
10
 run();
11
 run();
11
 
12
 
15
     const configuration = `${prefix}.${suffix}`;
16
     const configuration = `${prefix}.${suffix}`;
16
     const headless$ = android ? headless ? `--headless` : `` : ``;
17
     const headless$ = android ? headless ? `--headless` : `` : ``;
17
     const workers = multi ? 3 : 1;
18
     const workers = multi ? 3 : 1;
19
+    const loglevel = verbose ? '--loglevel verbose' : '';
18
 
20
 
19
     if (!android) {
21
     if (!android) {
20
         exec.execSync('npm run build');
22
         exec.execSync('npm run build');
23
     if (!skipBuild) {
25
     if (!skipBuild) {
24
         exec.execSync(`detox build --configuration ${configuration}`);
26
         exec.execSync(`detox build --configuration ${configuration}`);
25
     }
27
     }
26
-    exec.execSync(`detox test --configuration ${configuration} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace
28
+    exec.execSync(`detox test --configuration ${configuration} ${headless$} -w ${workers} ${loglevel}`); //-f "ScreenStyle.test.js" --loglevel trace
27
 }
29
 }