Przeglądaj źródła

Basic Detox tests working

Jamon Holmgren 6 lat temu
rodzic
commit
77229885e2
6 zmienionych plików z 29 dodań i 13828 usunięć
  1. 4
    0
      WebTest/.gitignore
  2. 4
    6
      WebTest/App.js
  3. 8
    8
      WebTest/e2e/firstTest.spec.js
  4. 0
    8486
      WebTest/package-lock.json
  5. 13
    1
      WebTest/package.json
  6. 0
    5327
      WebTest/yarn.lock

+ 4
- 0
WebTest/.gitignore Wyświetl plik

@@ -54,3 +54,7 @@ buck-out/
54 54
 
55 55
 # Bundle artifact
56 56
 *.jsbundle
57
+
58
+# Don't save lockfiles for this test project
59
+package-lock.json
60
+yarn.lock

+ 4
- 6
WebTest/App.js Wyświetl plik

@@ -3,11 +3,10 @@
3 3
  * https://github.com/facebook/react-native
4 4
  *
5 5
  * @format
6
- * @flow
7 6
  */
8 7
 
9
-import React, {Component} from 'react';
10
-import {Platform, StyleSheet, Text, View} from 'react-native';
8
+import React, { Component } from 'react';
9
+import { Platform, StyleSheet, Text, View } from 'react-native';
11 10
 
12 11
 const instructions = Platform.select({
13 12
   ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
@@ -16,11 +15,10 @@ const instructions = Platform.select({
16 15
     'Shake or press menu button for dev menu',
17 16
 });
18 17
 
19
-type Props = {};
20
-export default class App extends Component<Props> {
18
+export default class App extends Component {
21 19
   render() {
22 20
     return (
23
-      <View style={styles.container}>
21
+      <View testID="welcome" style={styles.container}>
24 22
         <Text style={styles.welcome}>Welcome to React Native!</Text>
25 23
         <Text style={styles.instructions}>To get started, edit App.js</Text>
26 24
         <Text style={styles.instructions}>{instructions}</Text>

+ 8
- 8
WebTest/e2e/firstTest.spec.js Wyświetl plik

@@ -7,13 +7,13 @@ describe('Example', () => {
7 7
     await expect(element(by.id('welcome'))).toBeVisible();
8 8
   });
9 9
 
10
-  it('should show hello screen after tap', async () => {
11
-    await element(by.id('hello_button')).tap();
12
-    await expect(element(by.text('Hello!!!'))).toBeVisible();
13
-  });
10
+  // it('should show hello screen after tap', async () => {
11
+  //   await element(by.id('hello_button')).tap();
12
+  //   await expect(element(by.text('Hello!!!'))).toBeVisible();
13
+  // });
14 14
 
15
-  it('should show world screen after tap', async () => {
16
-    await element(by.id('world_button')).tap();
17
-    await expect(element(by.text('World!!!'))).toBeVisible();
18
-  });
15
+  // it('should show world screen after tap', async () => {
16
+  //   await element(by.id('world_button')).tap();
17
+  //   await expect(element(by.text('World!!!'))).toBeVisible();
18
+  // });
19 19
 })

+ 0
- 8486
WebTest/package-lock.json
Plik diff jest za duży
Wyświetl plik


+ 13
- 1
WebTest/package.json Wyświetl plik

@@ -7,12 +7,16 @@
7 7
     "test": "jest"
8 8
   },
9 9
   "dependencies": {
10
+    "ir-webview": "../",
10 11
     "react": "16.4.1",
11 12
     "react-native": "0.56.0"
12 13
   },
13 14
   "devDependencies": {
15
+    "@babel/core": "^7.0.0-beta",
16
+    "babel-core": "^7.0.0-beta",
17
+    "babel-preset-react-native": "5.0.2",
14 18
     "babel-jest": "23.4.2",
15
-    "babel-preset-react-native": "^5",
19
+    "detox": "^8.1.4",
16 20
     "jest": "23.5.0",
17 21
     "react-test-renderer": "16.4.1"
18 22
   },
@@ -20,6 +24,14 @@
20 24
     "preset": "react-native"
21 25
   },
22 26
   "detox": {
27
+    "configurations": {
28
+      "ios.sim.debug": {
29
+        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/WebTest.app",
30
+        "build": "xcodebuild -project ios/WebTest.xcodeproj -scheme WebTest -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
31
+        "type": "ios.simulator",
32
+        "name": "iPhone 6"
33
+      }
34
+    },
23 35
     "test-runner": "jest"
24 36
   }
25 37
 }

+ 0
- 5327
WebTest/yarn.lock
Plik diff jest za duży
Wyświetl plik