Browse Source

Added WebView to example app

Jamon Holmgren 6 years ago
parent
commit
435e0f3e29
2 changed files with 7 additions and 5 deletions
  1. 7
    5
      WebTest/App.js
  2. 0
    0
      WebTest/e2e/webTest.spec.js

+ 7
- 5
WebTest/App.js View File

7
 
7
 
8
 import React, { Component } from 'react';
8
 import React, { Component } from 'react';
9
 import { Platform, StyleSheet, Text, View } from 'react-native';
9
 import { Platform, StyleSheet, Text, View } from 'react-native';
10
+import { WebView } from 'react-native-webview'
10
 
11
 
11
 const instructions = Platform.select({
12
 const instructions = Platform.select({
12
   ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
13
   ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
20
     return (
21
     return (
21
       <View testID="welcome" style={styles.container}>
22
       <View testID="welcome" style={styles.container}>
22
         <Text style={styles.welcome}>Welcome to React Native!</Text>
23
         <Text style={styles.welcome}>Welcome to React Native!</Text>
23
-        <Text style={styles.instructions}>To get started, edit App.js</Text>
24
-        <Text style={styles.instructions}>{instructions}</Text>
24
+        <WebView
25
+          testID="testWebView"
26
+          style={styles.webview}
27
+          src={{ uri: "https://www.facebook.com/Engineering/" }}
28
+        />
25
       </View>
29
       </View>
26
     );
30
     );
27
   }
31
   }
39
     textAlign: 'center',
43
     textAlign: 'center',
40
     margin: 10,
44
     margin: 10,
41
   },
45
   },
42
-  instructions: {
43
-    textAlign: 'center',
44
-    color: '#333333',
46
+  webview: {
45
     marginBottom: 5,
47
     marginBottom: 5,
46
   },
48
   },
47
 });
49
 });

WebTest/e2e/firstTest.spec.js → WebTest/e2e/webTest.spec.js View File