Преглед на файлове

trying to fix travis builds

Daniel Zlotin преди 8 години
родител
ревизия
6c5b4e26d1
променени са 4 файла, в които са добавени 42 реда и са изтрити 6 реда
  1. 11
    3
      playground/e2e/app.test.js
  2. 3
    3
      playground/scripts/e2e.ios.js
  3. 26
    0
      playground/src/containers/SimpleTabScreen.js
  4. 2
    0
      playground/src/containers/index.js

+ 11
- 3
playground/e2e/app.test.js Целия файл

@@ -3,8 +3,16 @@ describe('app', () => {
3 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 Целия файл

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

+ 26
- 0
playground/src/containers/SimpleTabScreen.js Целия файл

@@ -0,0 +1,26 @@
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 Целия файл

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