【发布时间】:2017-02-08 23:13:21
【问题描述】:
我们有一个测试,我们需要swipeUp 才能看到tableView 内的单元格。在swipeUp 之后,我们无法打印出app.tables。如果我们不刷卡,一切都会按预期工作。
- 那么与这里的 Swift 2 相比,Swift 3 发生了什么变化?
- 我们如何解决这个问题?
例子:
func testSomethingInApp() {
let app = XCUIApplication()
app.launch()
app.swipeUp() //after this we cant get app.tables anymore. Befor everything is fine
XCTAssertEqual(app.tables.cells.elementBoundByIndex(5), "something") //something like this
}
【问题讨论】:
-
控制台的错误输出是什么?有调试日志吗?
-
遗憾的是,您在 assambler 代码中没有其他信息。在
swipeUp()之后你甚至不能po app.tables。它将以 assambler 代码结束。 -
您能否确认滑动手势消息应该通过
app或app.tables发送? -
而不是 app.swipe(),您是否尝试过使用 app.table["tour table"].swipeUp 之类的元素或当时使用任何可见元素进行滑动?
-
是的,我试过
app.tables.element(boundBy: 0).swipeUp()导致同样的错误。