本文介绍了如何端到端测试 React Native 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 React NATIVE 应用程序,我想以端到端的方式进行测试.首先,你知道赛普拉斯能不能做到?我真的不确定,但有疑问我还是问.其次,我看到 Detox 可以做到,但我有一个 Windows 环境,而且 Detox 似乎只有 Mac 或 Linux 支持.您对我的问题有什么解决方案吗?

I have a react NATIVE app I would like to test in a end-to-end way. First, do you know if Cypress can do it ? I'm really not sure of it but in doubt I ask anyway. Second, I've seen Detox can do it but I have a Windows environment and it seems Detox is only supported by Mac or Linux. Do you have any solutions for my problem ?

提前致谢.

推荐答案

Detox For windows 你必须在 package.json因为它是为 mac 环境准备的,让它在 windows 上为你工作,例如 android:https://github.com/jmr85/react-native-detox/blob/master/package.json

Detox For windows you have to change the gradlew command in the "build" key in package.jsonbecause it is prepared for mac environment to make it work for you on windows for example for android:https://github.com/jmr85/react-native-detox/blob/master/package.json

"android.emu.debug": {
    "binaryPath": "android / app / build / outputs / apk / debug / app-debug.apk",
    "build": "cd android && gradlew assembleDebug assembleAndroidTest -DtestBuildType = debug && cd ..",
    "type": "android.emulator",
    "name": "Nexus_9_API_28"
},
"android.emu.release": {
    "binaryPath": "android / app / build / outputs / apk / release / app-release.apk",
    "build": "cd android && gradlew assembleRelease assembleAndroidTest -DtestBuildType = release && cd ..",
    "type": "android.emulator",
    "name": "Nexus_9_API_28"
}

另一个使用 Mocha、Webdriver.io 客户端和 Appium 服务器的工具......类似于 Selenium

Another tool using Mocha, Webdriver.io client and Appium server ... is similar to Selenium

这篇关于如何端到端测试 React Native 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 11:57