`twofingertap()和`tap(withnumberoftaps:1 numberefouches:2)```twofingerTap()```'twofingerTap()```'''''''在快速行动上运行它时,什么是什么?
我一直在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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 usedoubleTap()
. Unless you meant that you actually want to do two-finger tap, in this case your question is not stated properly.这两种方法应等效(在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.