【发布时间】:2017-05-15 16:55:37
【问题描述】:
下面是我记录的 XCTest
let app = XCUIApplication()
let tablesQuery = app.tables
tablesQuery.staticTexts["Video"].tap()
tablesQuery.staticTexts["\tWindowed"].tap()
app.buttons["Launch"].tap()
app.buttons["Popout Video"].tap()
app.children(matching: .window).element(boundBy: 0).children(matching: .other).element(boundBy: 1).tap()
当我尝试运行测试时,最后一部分是:
app.children(matching: .window).element(boundBy: 0).children(matching: .other).element(boundBy: 1).tap()
不可访问。它不会抛出任何错误,但最后一行代码没有被执行。
我已尝试通过参考以下 stackoverflow 问题来解决该问题: Xcode UI Tests can't find views that are added programatically
https://developer.apple.com/reference/uikit/uiview
但所有这些似乎都不能解决问题。任何帮助将不胜感激。
【问题讨论】:
-
我不知道答案,但是如果您查看报告日志,它会告诉您有关失败原因的详细信息。它甚至可能包括一个屏幕截图,显示当时的界面。
标签: ios xcode swift3 xctest ui-testing