Skip to content

Instantly share code, notes, and snippets.

@35d
Last active April 25, 2019 01:33
Show Gist options
  • Save 35d/dbdf269594f69a3cb2646e8b90a84705 to your computer and use it in GitHub Desktop.
Save 35d/dbdf269594f69a3cb2646e8b90a84705 to your computer and use it in GitHub Desktop.
Detox で e2e テストを実行するときのメモ

Detox で e2e テストを実行するときのメモ

Android ビルドとテスト実行

あらかじめエミュレータを立ち上げておく必要がある。

detox build -c android.emu.debug
detox test -c android.emu.debug

iOS ビルドとテスト実行

こちらもあらかじめ iOS シミュレータを立ち上げておく必要がある。ビルドコマンドで .xcodeproj から起動する場合は以下のサンプルの例で良いが、 .xcworkspace から起動する場合は -workspace に変更する。

detox build -c ios.sim.debug
detox test -c ios.sim.debug
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
"build": "xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 7"
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "Nexus_6_API_27"
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"name": "Nexus_6_API_27"
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment