abl*_*arg 5 xcode-ui-testing uitest xcuitest
假设我有一个包含三个图像的表,它们accessiblityIdentifier设置为“fooImage”。
XCTAssertTrue(table["tableName"].images.count == 3)会起作用,但这很糟糕——如果有人添加了另一种图像类型怎么办?我想要标识符==“fooImage”的所有图像的计数。
XCUIApplication().images["fooImage"].count是一个编译失败Value of type 'XCUIElement' has no member 'count'。
Tit*_*eul 10
在 an 上使用下标XCUIElementQuery会给你一个XCUIElement没有count属性的。你想用count在XCUIElementQuery这样的。
XCUIApplication().images.matching(identifier: "fooImage").count
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2913 次 |
| 最近记录: |