Skip to content

Commit

Permalink
Migrate to Detox 12 (#4956)
Browse files Browse the repository at this point in the history
  • Loading branch information
guyca authored Apr 7, 2019
1 parent ac60d2f commit 9428233
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
"description": "React Native Navigation - truly native navigation for iOS and Android",
"license": "MIT",
"nativePackage": true,
"author": "Daniel Zlotin <[email protected]>",
"contributors": [
"Tal Kol <[email protected]>",
"Guy Carmeli <[email protected]>",
"Ran Greenberg <[email protected]>",
"Artal Druk <[email protected]>"
],
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions playground/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -18,7 +18,7 @@ public class DetoxTest {
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);

@Test
public void runDetoxTests() throws InterruptedException {
public void runDetoxTests() {
Detox.runTests(mActivityRule);
}
}
4 changes: 4 additions & 0 deletions playground/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 9428233

Please sign in to comment.