iOS测试知识

XCUIElement:一个应用程序中的用户界面元素

2016-12-09  本文已影响300人  Mr_ZhangJun

Element State

@property(readonly) BOOL exists;

@property(readonly, getter=isHittable) BOOL hittable;

@property(readonly, copy) NSString *debugDescription;

———————————————————————————————————————
Querying Descendant Element

- (XCUIElementQuery *)childrenMatchingType:(XCUIElementType)type;

- (XCUIElementQuery *)descendantsMatchingType:(XCUIElementType)type;

———————————————————————————————————————
Typing Text

- (void)typeText:(NSString *)text;

———————————————————————————————————————
Performing Gestures

- (void)tap;

- (void)doubleTap;

- (void)twoFingerTap;

- (void)pressForDuration:(NSTimeInterval)duration;

- (void)pressForDuration:(NSTimeInterval)duration thenDragToElement:(XCUIElement *)otherElement;

- (void)swipeLeft;;

- (void)swipeRight;

- (void)swipeUp;;

- (void) swipeDown;

- (void)pinchWithScale:(CGFloat)scale velocity:(CGFloat)velocity;;

- (void)rotate:(CGFloat)rotation withVelocity:(CGFloat)velocity;;

———————————————————————————————————————
Interacting with Sliders —— 这些方法提供自动化的相互作用与UISlider和NSSlider的功能

@property(readonly) CGFloat normalizedSliderPosition;

- (void)adjustToNormalizedSliderPosition:(CGFloat)normalizedSliderPosition;

———————————————————————————————————————
Interacting with Pickers —— 该方法的自动化控制和uidatepicker UIPickerView轮选择提供的功能

- (void)adjustToPickerWheelValue:(NSString *)pickerWheelValue;

———————————————————————————————————————
Calculating Coordinates —— 创建和返回一个新的坐标与归一化偏移

- (XCUICoordinate *)coordinateWithNormalizedOffset:(CGVector)normalizedOffset;

———————————————————————————————————————

上一篇 下一篇

猜你喜欢

热点阅读