即使僅運行默認testExample類(無代碼),我的XCode UI測試仍無法使用bot運行。相反,我收到一個錯誤:XCode UITest無法運行,出現意外的退出錯誤(僅限Bot)
Testing failed: Test target UIBotTest encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted) ** TEST FAILED **
機器人之外,我的測試運行和傳球,沒有這樣的故障出現。 一個解決方案,我想實現是利用系統警報處理程序在應用程序的第一次啓動,以處理通知允許警報如下:
XCUIApplication *app = [[XCUIApplication alloc]init];
[self addUIInterruptionMonitorWithDescription:@"Notification Handler" handler:^BOOL(XCUIElement * _Nonnull interruptingElement) {
if ([interruptingElement.buttons[@"OK"] exists])
{
[interruptingElement.buttons[@"OK"] tap];
[app tap];
return true;
}
return false;
}];
我想在我的設置和testExample功能中實現這一點,並再次運行罰款在模擬器和物理設備上,但在具有相同錯誤的機器人上失敗。
任何想法?