I am testing my app with XCTest in XCode.
Does someone has example how to test UIElement size? Height of cell in tableView, or height of label in tableView cell. Any example will be appreciated.
I am testing my app with XCTest in XCode.
Does someone has example how to test UIElement size? Height of cell in tableView, or height of label in tableView cell. Any example will be appreciated.
Use the XCUIElementAttributes
protocol on XCUIElement
to access the frame. This returns a standard CGRect
which you can query for size and origin.
let height = app.buttons.element.frame.size.height
let width = app.buttons.element.frame.size.width
let x = app.buttons.element.frame.origin.x
let y = app.buttons.element.frame.origin.y
© 2022 - 2024 — McMap. All rights reserved.