【发布时间】:2021-10-26 06:56:33
【问题描述】:
我正在尝试创建一个 XCUITest,我想在其中验证 iOS 的状态栏是:
- 隐藏;或
- 可见。
但我无法“找到”它...例如:
func testExample() throws {
let app = XCUIApplication()
app.launch()
let statusBar1 = app.descendants(matching: .statusBar)
let statusBar2 = app.statusBars.element(boundBy: 0)
}
po statusBar1 在控制台中什么时候得到一个空结果:
Find: Target Application 'com.domain.TestStatusBar'
↪︎Find: Descendants matching type StatusBar
有什么线索可以找到吗?
谢谢!
【问题讨论】: