【问题标题】:How to do press and release in UI Tests?如何在 UI 测试中进行新闻发布?
【发布时间】:2018-05-22 23:28:07
【问题描述】:

我有一个 UITest,只要调用 fastlane 来获取我的应用程序屏幕截图,它就会运行。我有一段代码如下:

app.children(matching: .window)
        .element(boundBy: 0).children(matching: .other)
        .element.children(matching: .other)
        .element(boundBy: 1).children(matching: .other)
        .element(boundBy: 3).press(forDuration: 1.8)

    snapshot("EffectsScreenshot")

但是,这不会产生我想要的效果。相反,我想按下元素,拍摄快照,然后从屏幕上释放压力。目前有什么方法可以在 UI 测试中实现这一点?

【问题讨论】:

  • 那么,我猜你有一些代码可以在你从屏幕上松开手指时做一些事情?可以分享一下吗?

标签: swift xctest xcode-ui-testing


【解决方案1】:

不幸的是,目前没有办法在持续时间内使用 press 并执行操作在该持续时间内

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-21
    • 2017-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多