Browse Source

Migrate to Detox 12 (#4956)

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

+ 2
- 9
package.json View File

@@ -4,13 +4,6 @@
4 4
   "description": "React Native Navigation - truly native navigation for iOS and Android",
5 5
   "license": "MIT",
6 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 7
   "publishConfig": {
15 8
     "registry": "https://registry.npmjs.org/"
16 9
   },
@@ -67,7 +60,7 @@
67 60
     "@types/react-native": "0.57.7",
68 61
     "@types/react-test-renderer": "16.x.x",
69 62
     "jsc-android": "236355.x.x",
70
-    "detox": "9.0.6",
63
+    "detox": "12.1.x",
71 64
     "react-native-ui-lib": "3.x.x",
72 65
     "handlebars": "4.x.x",
73 66
     "jest": "23.x.x",
@@ -120,7 +113,7 @@
120 113
   },
121 114
   "detox": {
122 115
     "test-runner": "jest",
123
-    "specs": "e2e",
116
+    "specs": "",
124 117
     "configurations": {
125 118
       "ios.none": {
126 119
         "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app",

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

@@ -26,9 +26,8 @@ android {
26 26
         }
27 27
 
28 28
         testBuildType System.getProperty('testBuildType', 'debug')  //this will later be used to control the test apk build type
29
-        missingDimensionStrategy "minReactNative", "minReactNative46"
30 29
         missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
31
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
30
+        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
32 31
     }
33 32
     signingConfigs {
34 33
         release {
@@ -72,6 +71,4 @@ dependencies {
72 71
 
73 72
     androidTestImplementation(project(':detox'))
74 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 View File

@@ -1,15 +1,15 @@
1 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 3
 import com.wix.detox.Detox;
8 4
 
9 5
 import org.junit.Rule;
10 6
 import org.junit.Test;
11 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 13
 @RunWith(AndroidJUnit4.class)
14 14
 @LargeTest
15 15
 public class DetoxTest {
@@ -18,7 +18,7 @@ public class DetoxTest {
18 18
     public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
19 19
 
20 20
     @Test
21
-    public void runDetoxTests() throws InterruptedException {
21
+    public void runDetoxTests() {
22 22
         Detox.runTests(mActivityRule);
23 23
     }
24 24
 }

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

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

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

@@ -25,5 +25,5 @@ function run() {
25 25
     if (!skipBuild) {
26 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
 }