gpt4 book ai didi

react-native - 在 windows 和 expo 上编写 e2e 测试的最佳方法是什么

转载 作者:行者123 更新时间:2023-12-04 17:36:59 31 4
gpt4 key购买 nike

我正在尝试为我的 react-native 移动应用程序编写端到端测试。但是我不知道应该使用哪个测试框架。我找到了 3 个框架,但我有 2 个问题; Expo 和 Windows...

  1. Detox; 我没有 mac 我不能使用这个框架。
  2. Cavy; 它与普通代码的嵌套过多。我需要像那样导出我的类(class); export default hook(Scene); 在代码末尾。但是我在某些页面上使用 withNavigation() 函数在子组件上使用导航。
  3. Appium; 我不知道它是否适用于 expo。我搜索了它但找不到与 expo 一起使用的方法。对我来说它看起来很复杂。

有谁知道在 Windows 和 expo 上使用 react-native 编写端到端测试的更好解决方案?

最佳答案

虽然我没有使用 Expo,但 Cavy 应该可以使用 Expo。

https://cavy.app/docs/getting-started/running-tests

If you're using Expo, cavy run-ios or cavy run-android will fail to successfully build your app.

Build your app separately and run your tests using:

# To test on iOS
cavy run-ios --skipbuild

# To test on Android
cavy run-android --skipbuild

Copy
Passing in the --skipbuild option means that cavy-cli will assume your app is already running, and will wait for your test results.

关于react-native - 在 windows 和 expo 上编写 e2e 测试的最佳方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56346885/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com