Xcode UI 测试 Swipe Up() 自 iOS 10.3 起无法正常工作

Xcodes UITesting SwipeUp() not working since iOS 10.3

自从升级到 iOS 10.3 后,我注意到 swipeUp() 函数只滑动了 table 视图非常小的量。过去 1 次 swipeUp() 调用就足够了,现在我有 10 次调用来做同样的事情。

有人解决这个问题吗?

因此看起来使用 XCUIElement 的 press(forDuration: thenDragTo:) 方法是一个很好的方法。

例如滚动表格视图

XCUIApplication().tables.cells.element(boundBy:2).press(forDuration: 1, thenDragTo: XCUIApplication().staticTexts["My Page Header Text"])