diff --git a/android/build.gradle b/android/build.gradle index 8c939395c4..7001456ab9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,10 +3,12 @@ buildscript { ext { buildToolsVersion = "28.0.3" + // detox requires at least version 18 minSdkVersion = 18 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" + // detox instrumentation app uses kotlin kotlinVersion = "1.3.0" } repositories { @@ -15,6 +17,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.3.1' + // detox instrumentation app uses kotlin classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong diff --git a/e2e/init.js b/e2e/init.js index f2b5c99868..f15c61cfc0 100644 --- a/e2e/init.js +++ b/e2e/init.js @@ -10,16 +10,21 @@ const adb = new ADB() jest.setTimeout(120000) jasmine.getEnv().addReporter(adapter) -// This takes care of generating status logs on a per-spec basis. By default, jest only reports at file-level. -// This is strictly optional. +// This takes care of generating status logs on a per-spec basis. By default, +// jest only reports at file-level. This is strictly optional. jasmine.getEnv().addReporter(specReporter) beforeAll(async () => { const configs = detoxConfig.configurations + + // TODO figure out iOS configs const newConfigs = detoxConfig.configurations = { 'ios.sim.debug': configs['ios.sim.debug'] } + // detox device configurations are generated dynamically here after querying + // ADB for android devices and emulator, instead of hardcoding in package.json + try { const devices = await adb.devices() devices.forEach(device => { diff --git a/e2e/utils.ts b/e2e/utils.ts index 8671fb1fbc..4f6181dfa4 100644 --- a/e2e/utils.ts +++ b/e2e/utils.ts @@ -1,6 +1,10 @@ import { expect } from 'detox' -// courtsey of https://github.com/wix/detox/issues/445#issuecomment-514801808 +/** + * @async + * @desc Given a testID of a element, returns the visible text in it + * courtsey of https://github.com/wix/detox/issues/445#issuecomment-514801808 + */ export const readVisibleText = async (testID: string) => { try { await expect(element(by.id(testID))).toHaveText('_you_cant_possible_have_this_text_')