Skip to content

Commit

Permalink
e2e: add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mnzaki committed Aug 21, 2019
1 parent 774f170 commit 50811db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions e2e/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
6 changes: 5 additions & 1 deletion e2e/utils.ts
Original file line number Diff line number Diff line change
@@ -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 <Text> 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_')
Expand Down

0 comments on commit 50811db

Please sign in to comment.