1

我希望能够从 XCUITest 中解决这个问题,以便说出类似的话

XCUIApplication(bundleIdentifier: "bundle Id").alerts.matching(Foo)

我已经知道了addUIInterruptionMonitor(withDescription: description),但似乎我们可能需要等待警报出现。

4

1 回答 1

1

它是 Springboard 应用程序,因此它的 Bundle ID 是com.apple.springboard.

当您运行测试时,您的日志中有它。这是我的测试日志的摘录:

t =    31.89s Tap "Location service" Switch
t =    31.89s     Wait for com.mytestapp to idle
t =    31.95s     Find the "Location service" Switch
t =    32.01s         Wait for com.apple.springboard to idle
t =    32.05s     Synthesize event
t =    32.16s     Wait for com.mytestapp to idle
于 2018-04-02T06:13:43.193 回答