From 942823390a8d628b0e94a8d1c35301ece0bb0971 Mon Sep 17 00:00:00 2001 From: Guy Carmeli Date: Sun, 7 Apr 2019 16:10:15 +0300 Subject: [PATCH] Migrate to Detox 12 (#4956) --- package.json | 11 ++--------- playground/android/app/build.gradle | 5 +---- .../reactnativenavigation/playground/DetoxTest.java | 10 +++++----- playground/android/build.gradle | 4 ++++ scripts/test-e2e.js | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 3214c6c975b..26c26e5b64d 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,6 @@ "description": "React Native Navigation - truly native navigation for iOS and Android", "license": "MIT", "nativePackage": true, - "author": "Daniel Zlotin ", - "contributors": [ - "Tal Kol ", - "Guy Carmeli ", - "Ran Greenberg ", - "Artal Druk " - ], "publishConfig": { "registry": "https://registry.npmjs.org/" }, @@ -67,7 +60,7 @@ "@types/react-native": "0.57.7", "@types/react-test-renderer": "16.x.x", "jsc-android": "236355.x.x", - "detox": "9.0.6", + "detox": "12.1.x", "react-native-ui-lib": "3.x.x", "handlebars": "4.x.x", "jest": "23.x.x", @@ -120,7 +113,7 @@ }, "detox": { "test-runner": "jest", - "specs": "e2e", + "specs": "", "configurations": { "ios.none": { "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app", diff --git a/playground/android/app/build.gradle b/playground/android/app/build.gradle index 8e7863517f4..0074321140f 100644 --- a/playground/android/app/build.gradle +++ b/playground/android/app/build.gradle @@ -26,9 +26,8 @@ android { } testBuildType System.getProperty('testBuildType', 'debug') //this will later be used to control the test apk build type - missingDimensionStrategy "minReactNative", "minReactNative46" missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } signingConfigs { release { @@ -72,6 +71,4 @@ dependencies { androidTestImplementation(project(':detox')) androidTestImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test:rules:1.0.2' } diff --git a/playground/android/app/src/androidTest/java/com/reactnativenavigation/playground/DetoxTest.java b/playground/android/app/src/androidTest/java/com/reactnativenavigation/playground/DetoxTest.java index 5af67d14f7d..f7841459c9b 100755 --- a/playground/android/app/src/androidTest/java/com/reactnativenavigation/playground/DetoxTest.java +++ b/playground/android/app/src/androidTest/java/com/reactnativenavigation/playground/DetoxTest.java @@ -1,15 +1,15 @@ package com.reactnativenavigation.playground; -import android.support.test.filters.LargeTest; -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; - import com.wix.detox.Detox; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.filters.LargeTest; +import androidx.test.rule.ActivityTestRule; + @RunWith(AndroidJUnit4.class) @LargeTest public class DetoxTest { @@ -18,7 +18,7 @@ public class DetoxTest { public ActivityTestRule mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); @Test - public void runDetoxTests() throws InterruptedException { + public void runDetoxTests() { Detox.runTests(mActivityRule); } } diff --git a/playground/android/build.gradle b/playground/android/build.gradle index caac2a5a9fe..6c7ad7ba9da 100644 --- a/playground/android/build.gradle +++ b/playground/android/build.gradle @@ -1,6 +1,9 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlinVersion = '1.3.21' + ext.detoxKotlinVersion = ext.kotlinVersion + repositories { google() mavenLocal() @@ -9,6 +12,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/scripts/test-e2e.js b/scripts/test-e2e.js index 457a5d6a1dd..088f86d78ce 100644 --- a/scripts/test-e2e.js +++ b/scripts/test-e2e.js @@ -25,5 +25,5 @@ function run() { if (!skipBuild) { exec.execSync(`detox build --configuration ${configuration}`); } - exec.execSync(`detox test --configuration ${configuration} --platform ${platform} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace + exec.execSync(`detox test --configuration ${configuration} ${headless$} ${!android ? `-w ${workers}` : ``}`); //-f "ScreenStyle.test.js" --loglevel trace }