ios - XCUI 测试将手指放在屏幕上

标签 ios xcode-ui-testing ui-testing

是否有可能使用XCUI测试或任何框架,UI测试将“手指”放在屏幕上,然后按住它,同时更改其坐标几次,然后松开。

最佳答案

你想要pressForDuration:thenDragToElement:在 XCUIElement 上。

let app = XCUIApplication
let button = app.buttons["myButton"]
let text = app.staticTexts["myText"]
button.pressForDuration(2, thenDragToElement: text)

此方法可用于任何 XCUIElement,而不仅仅是按钮和文本。

关于ios - XCUI 测试将手指放在屏幕上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38655888/

相关文章:

换行后 iOS 7.1 UITextView 仍未滚动到光标/插入符号

ios - 具有本地化 UI 的 Xcode 7 UITests

ios - 如何访问 XCUIApplication 中设置的 launchEnvironment 和 launchArguments,在 XCode 中运行 UI 测试?

xcode - 使用 Xcode 7 UITest 测试元素是否可见

ios - 关于插入和删除单元格的 UITableView 动画问题

objective-c - UIWebview javascript泄漏?

swift - XC测试 : how can we inject a class at runtime

ios - 如何测试启动 View Controller XCTest

UI测试的XCode 7代码覆盖率结果

ios - pod 框架内的 Google map