`twofingertap()和`tap(withnumberoftaps:1 numberefouches:2)```twofingerTap()```'twofingerTap()```'''''''在快速行动上运行它时,什么是什么?

发布于 2025-02-08 06:56:57 字数 1035 浏览 3 评论 0原文

我一直在iOS上使用UI测试,并在Swift上使用Xcuitest。在一次测试中,我需要同时用两个手指在屏幕上点击。我使用 twofingertap(twofingertap()当我从Xcode运行时,测试通过。但是,通过命令行运行,它会失败。然后,一个同事建议将其更改为:2) ,并且在两种方式上运行时起作用。我不知道为什么这种行为与应该做同样的事情的行为不同。有人知道吗?

第一次尝试:

appundertest.twofingertap()

第二次尝试:

appundertest.tap(withnumberoftaps:1,numberefouches:2)

fastlane命令:

捆绑exec fastlane扫描-scheme“ myApp” - 设备“ iPhone 13” - -force_quit_simulator -prelaunch_simulator -Reset_simulator

I have been working with UI test on iOS, and using XCUITest on swift. In one test I need to tap with two fingers on the screen at the same time. I used twoFingerTap() . The test passes when I run it from Xcode. But running by command line with fastlane it fails. Then, a coworker suggested to change it to tap(withNumberOfTaps:1 numberOfTouches:2), and it works when running on both ways. I have no idea why this different behavior from actions that should be doing the same thing. Somebody knows?

First attempt:

appUnderTest.twoFingerTap()

Second attempt:

appUnderTest.tap(withNumberOfTaps: 1, numberOfTouches: 2)

Fastlane Command:

bundle exec fastlane scan --scheme "MyApp" --device "iPhone 13" --force_quit_simulator --prelaunch_simulator --reset_simulator

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揽月 2025-02-15 06:56:57

twofingertap()不点击两次,它同时用两个手指敲击,我真的不理解它在本地的工作方式。为了实现所需的目标,您需要使用doubletap()。除非您实际上想进行两指的点击,否则在这种情况下,您的问题未正确说明。

twoFingerTap() does not tap twice, it simulates tapping with two fingers at the same time, I don't really understand how it works locally. To achieve what you want you need to use doubleTap(). Unless you meant that you actually want to do two-finger tap, in this case your question is not stated properly.

漆黑的白昼 2025-02-15 06:56:57

这两种方法应等效(在Xcode中,或者像Fastlane一样通过命令行运行模拟器时)。我建议向苹果提交错误。

These two methods should be equivalent (either in Xcode, or when running the simulator via the command line as Fastlane does). I'd suggest filing a bug with Apple.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文