XCUICoordinate Class Reference
Inherits from | NSObject |
---|---|
Conforms to | NSCopying |
Declared in | XCUICoordinate.h |
Overview
A coordinate represents a location on screen, relative to some element. Coordinates are dynamic, just like the elements to which they refer, and may compute different screen locations at different times, or be invalid if the referenced element does not exist.
– init
Coordinates are never instantiated directly. Instead, they are created by elements or by other coordinates.
- (instancetype)init
Declared In
XCUICoordinate.h
referencedElement
The element that the coordinate is based on, either directly or via the coordinate from which it was derived.
@property (readonly) XCUIElement *referencedElement
Declared In
XCUICoordinate.h
screenPoint
The dynamically computed value of the coordinate’s location on screen. Note that this value is dependent on the current frame of the referenced element; if the element’s frame changes, so will the value returned by this property. If the referenced element does exist when this is called, it will fail the test; check the referenced element’s exists property if the element may not be present.
@property (readonly) CGPoint screenPoint
Declared In
XCUICoordinate.h
– coordinateWithOffset:
Creates a new coordinate with an absolute offset in points from the original coordinate.
- (XCUICoordinate *)coordinateWithOffset:(CGVector)offsetVector
Declared In
XCUICoordinate.h
– pressForDuration:thenDragToCoordinate:
- (void)pressForDuration:(NSTimeInterval)duration thenDragToCoordinate:(XCUICoordinate *)otherCoordinate
– clickForDuration:thenDragToCoordinate:
- (void)clickForDuration:(NSTimeInterval)duration thenDragToCoordinate:(XCUICoordinate *)otherCoordinate