From 1315eea9be695f8126ffc43c1d0e389a70e1bcd1 Mon Sep 17 00:00:00 2001 From: Birkir Gudjonsson Date: Fri, 8 Mar 2019 12:43:06 -0500 Subject: [PATCH] all good to go --- android/app/build.gradle | 3 +- e2e/CounterScreen.test.js | 22 +++++++++---- package.json | 2 +- patches/detox+10.0.12.patch | 34 ++++++++++++++++++++ patches/react-native-navigation+2.13.1.patch | 17 ++++++++++ yarn.lock | 8 ++--- 6 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 patches/detox+10.0.12.patch create mode 100644 patches/react-native-navigation+2.13.1.patch diff --git a/android/app/build.gradle b/android/app/build.gradle index dabec81..ebc4098 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -112,7 +112,6 @@ android { dependencies { implementation "com.facebook.react:react-native:+" - implementation 'com.android.support:design:27.1.1' implementation fileTree(dir: "libs", include: ["*.jar"]) @@ -125,6 +124,8 @@ dependencies { transitive = false } + implementation 'com.android.support:design:27.1.1' + androidTestImplementation project(path: ":detox") androidTestImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' diff --git a/e2e/CounterScreen.test.js b/e2e/CounterScreen.test.js index 4bb7544..78d8c09 100644 --- a/e2e/CounterScreen.test.js +++ b/e2e/CounterScreen.test.js @@ -1,3 +1,11 @@ +function formatLabel(label) { + const platform = device.getPlatform(); + if (platform === 'android') { + return label.toLocaleUpperCase(); + } + return label; +} + describe('CounterScreen', () => { beforeAll(async () => { await device.relaunchApp(); @@ -5,16 +13,16 @@ describe('CounterScreen', () => { it('should show counter screen', async () => { await expect(element(by.id('HOME_SCREEN'))).toBeVisible(); - await element(by.label('Counter Screen')).tap(); + await element(by.text(formatLabel('Counter Screen'))).tap(); await expect(element(by.id('COUNTER_SCREEN'))).toBeVisible(); }); it('should increment counter', async () => { - await expect(element(by.label('Counter: 0'))).toBeVisible(); - await element(by.label('Increment')).tap(); - await expect(element(by.label('Counter: 1'))).toBeVisible(); - await element(by.label('Decrement')).tap(); - await element(by.label('Decrement')).tap(); - await expect(element(by.label('Counter: -1'))).toBeVisible(); + await expect(element(by.text('Counter: 0'))).toBeVisible(); + await element(by.text(formatLabel('Increment'))).tap(); + await expect(element(by.text('Counter: 1'))).toBeVisible(); + await element(by.text(formatLabel('Decrement'))).tap(); + await element(by.text(formatLabel('Decrement'))).tap(); + await expect(element(by.text('Counter: -1'))).toBeVisible(); }); }); diff --git a/package.json b/package.json index ce0693e..8921a1e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "@react-native-community/async-storage": "1.1.0", - "jsc-android": "236355.1.1", + "jsc-android": "241213.0.0", "lodash": "4.17.11", "mobx": "5.9.0", "mobx-devtools-mst": "0.9.18", diff --git a/patches/detox+10.0.12.patch b/patches/detox+10.0.12.patch new file mode 100644 index 0000000..c08aec8 --- /dev/null +++ b/patches/detox+10.0.12.patch @@ -0,0 +1,34 @@ +diff --git a/node_modules/detox/android/detox/build.gradle b/node_modules/detox/android/detox/build.gradle +index 53ad2fa..350b065 100644 +--- a/node_modules/detox/android/detox/build.gradle ++++ b/node_modules/detox/android/detox/build.gradle +@@ -22,10 +22,6 @@ android { + + productFlavors { + flavorDimensions "minReactNative" +- minReactNative44 { +- dimension "minReactNative" +- +- } + minReactNative46 { + dimension "minReactNative" + } +@@ -69,9 +65,6 @@ android { + dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$_kotlinVersion" + +- minReactNative44Implementation 'com.squareup.okhttp3:okhttp:3.4.1' +- minReactNative44Implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1' +- + minReactNative46Implementation 'com.squareup.okhttp3:okhttp:3.6.0' + minReactNative46Implementation 'com.squareup.okio:okio:1.13.0' + +@@ -82,7 +75,7 @@ dependencies { + implementation 'com.android.support.test:rules:1.0.2' + + // noinspection GradleDynamicVersion +- compileOnly "com.facebook.react:react-native:+" ++ api "com.facebook.react:react-native:+" + + implementation 'org.apache.commons:commons-lang3:3.4' + implementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3' diff --git a/patches/react-native-navigation+2.13.1.patch b/patches/react-native-navigation+2.13.1.patch new file mode 100644 index 0000000..3ae5a01 --- /dev/null +++ b/patches/react-native-navigation+2.13.1.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/react-native-navigation/lib/android/app/build.gradle b/node_modules/react-native-navigation/lib/android/app/build.gradle +index 2e6c70a..39de2ce 100644 +--- a/node_modules/react-native-navigation/lib/android/app/build.gradle ++++ b/node_modules/react-native-navigation/lib/android/app/build.gradle +@@ -83,9 +83,9 @@ allprojects { p -> + + dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') +- implementation 'com.android.support:design:26.1.0' +- implementation 'com.android.support:appcompat-v7:26.1.0' +- implementation 'com.android.support:support-v4:26.1.0' ++ implementation 'com.android.support:design:27.1.1' ++ implementation 'com.android.support:appcompat-v7:27.1.1' ++ implementation 'com.android.support:support-v4:27.1.1' + + implementation 'com.github.wix-playground:ahbottomnavigation:2.4.9' + implementation 'com.github.wix-playground:reflow-animator:1.0.4' diff --git a/yarn.lock b/yarn.lock index b145e1e..f9e0493 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5800,10 +5800,10 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -jsc-android@236355.1.1: - version "236355.1.1" - resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-236355.1.1.tgz#43e153b722e3c60dd0595be4e7430baf65e67c9c" - integrity sha512-2py4f0McZIl/oH6AzPj1Ebutc58fyeLvwq6gyVYp1RsWr4qeLNHAPfW3kmfeVMz44oUBJMQ0lECZg9n4KBhHbQ== +jsc-android@241213.0.0: + version "241213.0.0" + resolved "https://registry.yarnpkg.com/jsc-android/-/jsc-android-241213.0.0.tgz#e41dd68ca48ecf6cb8cd75d3ed14a79cde259a26" + integrity sha512-rqc+FUOfXT1XNFI59J+7ByCvdKqw+0QCLm7fOJifbCxRV+UYjkFUMDHMfvEMSLaJhKMlhOwNAy8k9gyT+o60dg== jsdom@^11.5.1: version "11.11.0"