Kaynağa Gözat

Add headless option to e2e android

Shalom Yerushalmy 6 yıl önce
ebeveyn
işleme
4aabc4665e
1 değiştirilmiş dosya ile 11 ekleme ve 9 silme
  1. 11
    9
      scripts/test-e2e.js

+ 11
- 9
scripts/test-e2e.js Dosyayı Görüntüle

@@ -4,18 +4,20 @@ const exec = require('shell-utils').exec;
4 4
 const android = _.includes(process.argv, '--android');
5 5
 const release = _.includes(process.argv, '--release');
6 6
 const skipBuild = _.includes(process.argv, '--skipBuild');
7
+const headless = _.includes(process.argv, '--headless');
7 8
 
8 9
 run();
9 10
 
10 11
 function run() {
11
-  const platform = android ? `android` : `ios`;
12
-  const prefix = android ? `android.emu` : `ios.sim`;
13
-  const suffix = release ? `release` : `debug`;
14
-  const configuration = `${prefix}.${suffix}`;
15
-  const cleanup = process.env.JENKINS_CI ? `--cleanup` : ``;
12
+    const platform = android ? `android` : `ios`;
13
+    const prefix = android ? `android.emu` : `ios.sim`;
14
+    const suffix = release ? `release` : `debug`;
15
+    const configuration = `${prefix}.${suffix}`;
16
+    const cleanup = process.env.CI ? `--cleanup` : ``;
17
+    const headless$ = android ? headless ? `--headless` : `` : ``;
16 18
 
17
-  if (!skipBuild) {
18
-    exec.execSync(`detox build --configuration ${configuration}`);
19
-  }
20
-  exec.execSync(`detox test --configuration ${configuration} --platform ${platform} ${cleanup}`);
19
+    if (!skipBuild) {
20
+        exec.execSync(`detox build --configuration ${configuration}`);
21
+    }
22
+    exec.execSync(`detox test --configuration ${configuration} --platform ${platform} ${cleanup} ${headless$}`);
21 23
 }