问题
i have collection list of items cell , i wants to make UI test (XCUItest). But unable to find the element collection view cell and its elements inside it .
UIViewController
---> UICollectionView
----> UICollectionViewCell
-----> The element that I would like to get.
func testProductListingPageLoad() {
let collection = app.collectionViews["ProductList"]
let element = collection.cells["ProductListItemCell0"].firstMatch
XCTAssert(collection.exists) // it is successful
XCTAssert(element.exists) // Fails at this line
}
来源:https://stackoverflow.com/questions/60361289/xcuitest-fail-to-find-uicollectionview-cell-and-cell-items