I wanna check whether there is a tableViewCell.detailTextLabel
with a given string in my UITest. The problem is when I search for app.tables.cells.children(matching: .staticText)
it will only look for labels that are tableViewCell.textLabel
.
Any ideas on how to query for the detailTextLabel
?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Web Test recorder does not allow me to record a te
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
It sounds like your detail text label isn't accessible.
To see everything that's available to your tests in the view hierarchy, print the debug description of the following query, which may help you to understand whether the element is appearing, what its type is, and what its identifier or label is:
Make sure that the containing view (the cell?) is not accessible, and that the detail text label is accessible, and give it an identifier:
You can try a more generic query to determine if the text exists at all. If you are trying to assert that a cell contains "123 Main St.", for example, you can use the following:
Granted, if that text appears in the
textLabel
the test will still pass.