[英]XCUIElement tap is not working for custom table view cell
我正在嘗試為我的iOS應用程序編寫UI測試。 由於任何原因,我無法點擊自定義表格視圖單元格。 這是我要這樣做的方式:
let app = XCUIApplication()
let staticTextOfFirstCell = app.tables.cells.elementBoundByIndex(0)
.staticTexts.elementBoundByIndex(0)
staticTextOfFirstCell.tap()
staticTextOfFirstCell已設置並且也存在。 但是,我的測試用例仍處於“ Wait for app to idle
狀態。
如果您使用的是UIRefreshControl,請嘗試注釋顯示加載指示符,如果它可以正常工作並繼續進行UI測試,則使用build配置if語句將其包裝起來,如下所示:
#if !TEST
if let refreshControl = refreshControl where !refreshControl.refreshing {
refreshControl.beginRefreshing()
}
#endif
這樣,一旦您運行UI測試,它將不會執行此代碼塊。
請注意,您需要為UI測試添加構建配置。 有報道了雷達的錯誤這里的動畫(我相信同樣的事情去刷新控制)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.