自動化測試

使用 Dexon

https://github.com/wix/Detox/tree/master/docs

搭配 Jest

之後會出現四個檔案

  1. detoxrc.json

  2. e2e/config.json

  3. e2e/enviroment.js

  4. firstTest.e2e.js

於 Android 目錄下輸入 ./gradlew assembleDebug

然後去修改 .detoxrc.json 中的 binarypath 與 avdName 類似如下

但目前 React Native 0.63 還是無法執行,會有 timeout 情況 https://stackoverflow.com/questions/61050417/detoxruntimeerror-failed-to-run-application-on-the-device-android

Android 記得去設定 emulator

https://github.com/wix/Detox/blob/master/docs/Introduction.AndroidDevEnv.md

Last updated

Was this helpful?