|
@@ -5,13 +5,15 @@ const release = _.includes(process.argv, 'release');
|
5
|
5
|
|
6
|
6
|
function buildProjForDetox() {
|
7
|
7
|
const scheme = release ? `playground_release` : `playground`;
|
|
8
|
+ const conf = release ? `Release` : `Debug`;
|
8
|
9
|
|
9
|
10
|
const cmd = `RCT_NO_LAUNCH_PACKAGER=true
|
10
|
11
|
cd ./playground/ios && xcodebuild
|
|
12
|
+ build
|
11
|
13
|
-scheme ${scheme}
|
12
|
|
- ${release ? 'clean build' : 'build'}
|
13
|
14
|
-project playground.xcodeproj
|
14
|
15
|
-sdk iphonesimulator
|
|
16
|
+ -configuration ${conf}
|
15
|
17
|
-derivedDataPath ./DerivedData/playground`;
|
16
|
18
|
|
17
|
19
|
if (exec.which(`xcpretty`)) {
|
|
@@ -21,19 +23,27 @@ function buildProjForDetox() {
|
21
|
23
|
}
|
22
|
24
|
}
|
23
|
25
|
|
24
|
|
-function e2e() { //eslint-disable-line
|
25
|
|
- try {
|
26
|
|
- exec.execSyncSilent(`watchman watch-del-all || true`);
|
27
|
|
- const detoxAppBuildPath = `playground/ios/DerivedData/playground/Build/Products/${release ? 'Release' : 'Debug'}-iphonesimulator/playground.app`;
|
|
26
|
+function runDetoxUsingMocha() {
|
|
27
|
+ const detoxAppBuildPath = `playground/ios/DerivedData/playground/Build/Products/${release ? 'Release' : 'Debug'}-iphonesimulator/playground.app`;
|
28
|
28
|
|
29
|
|
- exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
|
|
29
|
+ exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
|
30
|
30
|
BABEL_ENV=test
|
31
|
31
|
./node_modules/mocha/bin/mocha e2e
|
32
|
32
|
--timeout ${2 * 60 * 1000}
|
33
|
33
|
--recursive
|
34
|
34
|
--bail`);
|
|
35
|
+}
|
|
36
|
+
|
|
37
|
+function e2e() { //eslint-disable-line
|
|
38
|
+ try {
|
|
39
|
+ if (process.env.CI) {
|
|
40
|
+ exec.exec(`yarn run start`);
|
|
41
|
+ exec.execSync(`sleep 5`);
|
|
42
|
+ }
|
|
43
|
+ runDetoxUsingMocha();
|
35
|
44
|
} finally {
|
36
|
45
|
if (process.env.CI) {
|
|
46
|
+ exec.kill(`react-native/local-cli/cli.js start`);
|
37
|
47
|
exec.kill(`Simulator`);
|
38
|
48
|
exec.kill(`CoreSimulator`);
|
39
|
49
|
exec.execSync(`sleep 5`);
|