Sfoglia il codice sorgente

Migrate to Detox 12 (#4956)

Guy Carmeli 5 anni fa
parent
commit
942823390a
No account linked to committer's email address

+ 2
- 9
package.json Vedi File

4
   "description": "React Native Navigation - truly native navigation for iOS and Android",
4
   "description": "React Native Navigation - truly native navigation for iOS and Android",
5
   "license": "MIT",
5
   "license": "MIT",
6
   "nativePackage": true,
6
   "nativePackage": true,
7
-  "author": "Daniel Zlotin <zlotindaniel@gmail.com>",
8
-  "contributors": [
9
-    "Tal Kol <talkol@gmail.com>",
10
-    "Guy Carmeli <guyc@wix.com>",
11
-    "Ran Greenberg <rang@wix.com>",
12
-    "Artal Druk <artald@wix.com>"
13
-  ],
14
   "publishConfig": {
7
   "publishConfig": {
15
     "registry": "https://registry.npmjs.org/"
8
     "registry": "https://registry.npmjs.org/"
16
   },
9
   },
67
     "@types/react-native": "0.57.7",
60
     "@types/react-native": "0.57.7",
68
     "@types/react-test-renderer": "16.x.x",
61
     "@types/react-test-renderer": "16.x.x",
69
     "jsc-android": "236355.x.x",
62
     "jsc-android": "236355.x.x",
70
-    "detox": "9.0.6",
63
+    "detox": "12.1.x",
71
     "react-native-ui-lib": "3.x.x",
64
     "react-native-ui-lib": "3.x.x",
72
     "handlebars": "4.x.x",
65
     "handlebars": "4.x.x",
73
     "jest": "23.x.x",
66
     "jest": "23.x.x",
120
   },
113
   },
121
   "detox": {
114
   "detox": {
122
     "test-runner": "jest",
115
     "test-runner": "jest",
123
-    "specs": "e2e",
116
+    "specs": "",
124
     "configurations": {
117
     "configurations": {
125
       "ios.none": {
118
       "ios.none": {
126
         "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app",
119
         "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app",

+ 1
- 4
playground/android/app/build.gradle Vedi File

26
         }
26
         }
27
 
27
 
28
         testBuildType System.getProperty('testBuildType', 'debug')  //this will later be used to control the test apk build type
28
         testBuildType System.getProperty('testBuildType', 'debug')  //this will later be used to control the test apk build type
29
-        missingDimensionStrategy "minReactNative", "minReactNative46"
30
         missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
29
         missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
31
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
30
+        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
32
     }
31
     }
33
     signingConfigs {
32
     signingConfigs {
34
         release {
33
         release {
72
 
71
 
73
     androidTestImplementation(project(':detox'))
72
     androidTestImplementation(project(':detox'))
74
     androidTestImplementation 'junit:junit:4.12'
73
     androidTestImplementation 'junit:junit:4.12'
75
-    androidTestImplementation 'com.android.support.test:runner:1.0.2'
76
-    androidTestImplementation 'com.android.support.test:rules:1.0.2'
77
 }
74
 }

+ 5
- 5
playground/android/app/src/androidTest/java/com/reactnativenavigation/playground/DetoxTest.java Vedi File

1
 package com.reactnativenavigation.playground;
1
 package com.reactnativenavigation.playground;
2
 
2
 
3
-import android.support.test.filters.LargeTest;
4
-import android.support.test.rule.ActivityTestRule;
5
-import android.support.test.runner.AndroidJUnit4;
6
-
7
 import com.wix.detox.Detox;
3
 import com.wix.detox.Detox;
8
 
4
 
9
 import org.junit.Rule;
5
 import org.junit.Rule;
10
 import org.junit.Test;
6
 import org.junit.Test;
11
 import org.junit.runner.RunWith;
7
 import org.junit.runner.RunWith;
12
 
8
 
9
+import androidx.test.ext.junit.runners.AndroidJUnit4;
10
+import androidx.test.filters.LargeTest;
11
+import androidx.test.rule.ActivityTestRule;
12
+
13
 @RunWith(AndroidJUnit4.class)
13
 @RunWith(AndroidJUnit4.class)
14
 @LargeTest
14
 @LargeTest
15
 public class DetoxTest {
15
 public class DetoxTest {
18
     public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
18
     public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
19
 
19
 
20
     @Test
20
     @Test
21
-    public void runDetoxTests() throws InterruptedException {
21
+    public void runDetoxTests() {
22
         Detox.runTests(mActivityRule);
22
         Detox.runTests(mActivityRule);
23
     }
23
     }
24
 }
24
 }

+ 4
- 0
playground/android/build.gradle Vedi File

1
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
1
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
2
 
2
 
3
 buildscript {
3
 buildscript {
4
+    ext.kotlinVersion = '1.3.21'
5
+    ext.detoxKotlinVersion = ext.kotlinVersion
6
+
4
     repositories {
7
     repositories {
5
         google()
8
         google()
6
         mavenLocal()
9
         mavenLocal()
9
     }
12
     }
10
     dependencies {
13
     dependencies {
11
         classpath 'com.android.tools.build:gradle:3.2.1'
14
         classpath 'com.android.tools.build:gradle:3.2.1'
15
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
12
 
16
 
13
         // NOTE: Do not place your application dependencies here; they belong
17
         // NOTE: Do not place your application dependencies here; they belong
14
         // in the individual module build.gradle files
18
         // in the individual module build.gradle files

+ 1
- 1
scripts/test-e2e.js Vedi File

25
     if (!skipBuild) {
25
     if (!skipBuild) {
26
         exec.execSync(`detox build --configuration ${configuration}`);
26
         exec.execSync(`detox build --configuration ${configuration}`);
27
     }
27
     }
28
-    exec.execSync(`detox test --configuration ${configuration} --platform ${platform} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace
28
+    exec.execSync(`detox test --configuration ${configuration} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace
29
 }
29
 }