Browse Source

trying to fix travis builds

Daniel Zlotin 8 years ago
parent
commit
6c5b4e26d1

+ 11
- 3
playground/e2e/app.test.js View File

3
     global.simulator.relaunchApp(done);
3
     global.simulator.relaunchApp(done);
4
   });
4
   });
5
 
5
 
6
-  it('shows welcome screen', (done) => {
7
-    expect(element(by.label('React Native Navigation!'))).toBeVisible();
8
-    done();
6
+  it('shows welcome screen', () => {
7
+    expect(elementByLabel('React Native Navigation!')).toBeVisible();
8
+  });
9
+
10
+  xit('switch to tab based app', () => {
11
+    elementByLabel('Switch to tab based app').tap();
12
+    expect(elementByLabel('This is a tab screen')).toBeVisible();
9
   });
13
   });
10
 });
14
 });
15
+
16
+function elementByLabel(label) {
17
+  return element(by.label(label));
18
+}

+ 3
- 3
playground/scripts/e2e.ios.js View File

10
   shellUtils.exec.execSync(`echo 'travis_fold:start:xcodebuild'`);
10
   shellUtils.exec.execSync(`echo 'travis_fold:start:xcodebuild'`);
11
   const cmd = `RCT_NO_LAUNCH_PACKAGER=true
11
   const cmd = `RCT_NO_LAUNCH_PACKAGER=true
12
           cd ios && xcodebuild
12
           cd ios && xcodebuild
13
-            -scheme ${scheme} 
14
-            ${release ? 'clean build' : 'build'} 
13
+            -scheme ${scheme}
14
+            ${release ? 'clean build' : 'build'}
15
             -project playground.xcodeproj
15
             -project playground.xcodeproj
16
             -sdk iphonesimulator
16
             -sdk iphonesimulator
17
             -derivedDataPath ./DerivedData/playground`;
17
             -derivedDataPath ./DerivedData/playground`;
42
     shellUtils.exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
42
     shellUtils.exec.execSync(`detoxAppBuildPath="${detoxAppBuildPath}"
43
                               BABEL_ENV=test
43
                               BABEL_ENV=test
44
                               ./node_modules/mocha/bin/mocha e2e
44
                               ./node_modules/mocha/bin/mocha e2e
45
-                                --timeout 240000
45
+                                --timeout ${10 * 60 * 1000}
46
                                 --recursive
46
                                 --recursive
47
                                 --compilers js:babel-register`);
47
                                 --compilers js:babel-register`);
48
   } finally {
48
   } finally {

+ 26
- 0
playground/src/containers/SimpleTabScreen.js View File

1
+import React, {Component} from 'react';
2
+import {View, Text} from 'react-native';
3
+
4
+export default class SimpleTabScreen extends Component {
5
+  render() {
6
+    return (
7
+      <View style={styles.root}>
8
+        <Text style={styles.h1}>{`This is a tab screen`}</Text>
9
+      </View>
10
+    );
11
+  }
12
+}
13
+
14
+const styles = {
15
+  root: {
16
+    flexGrow: 1,
17
+    justifyContent: 'center',
18
+    alignItems: 'center',
19
+    backgroundColor: '#f5fcff'
20
+  },
21
+  h1: {
22
+    fontSize: 24,
23
+    textAlign: 'center',
24
+    margin: 10
25
+  }
26
+};

+ 2
- 0
playground/src/containers/index.js View File

1
 import Navigation from 'react-native-navigation';
1
 import Navigation from 'react-native-navigation';
2
 
2
 
3
 import WelcomeScreen from './WelcomeScreen';
3
 import WelcomeScreen from './WelcomeScreen';
4
+import SimpleTabScreen from './SimpleTabScreen';
4
 
5
 
5
 export function registerContainers() {
6
 export function registerContainers() {
6
   Navigation.registerContainer(`com.example.WelcomeScreen`, () => WelcomeScreen);
7
   Navigation.registerContainer(`com.example.WelcomeScreen`, () => WelcomeScreen);
8
+  Navigation.registerContainer(`com.example.SimpleTabScreen`, () => SimpleTabScreen);
7
 }
9
 }