Chi*_*uck 1 objective-c ios xcode-ui-testing
在XCUIElement.h类文件显示
- (void)scrollByDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY;和
- (XCUICoordinate *)coordinateWithNormalizedOffset:(CGVector)normalizedOffset;功能。但这些不能在 iOS 设备上使用。XCUIElement.h提供- (void)swipeDown滑动tableview。因为向下滑动的距离不够,所以像MJRefresh这样的pull-to-refresh框架无法响应。
那么如何自定义位置或使用存在功能来编辑向下滑动的距离?
您可以下拉到坐标 API 以执行下拉刷新。
let firstCell = app.staticTexts["Cell One"]
let start = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 0))
let finish = firstCell.coordinateWithNormalizedOffset(CGVectorMake(0, 6))
start.pressForDuration(0, thenDragToCoordinate: finish)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1423 次 |
| 最近记录: |