I am trying to test whether the UITableView
has at least first cell available or not.
func testFirstCellIsAvailable() throws {
let app = XCUIApplication()
app.launch()
let tablesQuery = app.tables
XCTAssertNotNil(tablesQuery.cells.staticTexts["John"], "First Cell should be John")
}
This is one of the simplest way to find the TableView is loaded or not.
However , I see XCUIElementQuery
has tableRows
and tableColumns
, when I check the value it's always zero. So the question is when do we use tableRows
and tableColumns
For the above example value of app.tableRows.count
and app.tableColumns.count
is 0.
tableColumns
and tableRows
are usually seen in 2D tables, while "flat" UITableView consist of cells
. For example, you can see such elements if you create a table in macOS Notes application and inspect XCUIApplication