Browse Source

Add headless option to e2e android

Shalom Yerushalmy 6 years ago
parent
commit
4aabc4665e
1 changed files with 11 additions and 9 deletions
  1. 11
    9
      scripts/test-e2e.js

+ 11
- 9
scripts/test-e2e.js View File

4
 const android = _.includes(process.argv, '--android');
4
 const android = _.includes(process.argv, '--android');
5
 const release = _.includes(process.argv, '--release');
5
 const release = _.includes(process.argv, '--release');
6
 const skipBuild = _.includes(process.argv, '--skipBuild');
6
 const skipBuild = _.includes(process.argv, '--skipBuild');
7
+const headless = _.includes(process.argv, '--headless');
7
 
8
 
8
 run();
9
 run();
9
 
10
 
10
 function run() {
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
 }