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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With