美文网首页
3.1 Interaction APIs

3.1 Interaction APIs

作者: 冰皮月饼真好吃 | 来源:发表于2018-01-03 14:32 被阅读0次

1 Selecting an element to interact with,

2 Performing an action on it, and/or

3 Making an assertion to verify state and behavior.

EarlGrey Matchers:

grey_accessibilityID() / grey_accessibilityTrait() / grey_accessibilityLabel()

grey_sufficientlyVisible()

grey_allOf(), grey_anyOf(), grey_not()                    

Custom Matchers

To create custom matchers, use the block-based GREYElementMatcherBlock class.

Selecting Off-Screen UI Elements

In certain situations the UI element may be hidden off-screen, and may require certain interactions to bring it onto the screen.use the [usingSearchAction:onElementWithMatcher:] method to provide a search action for such elements[[[EarlGrey selectElementWithMatcher:aButtonMatcher]

    usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, 50)

onElementWithMatcher:aScrollViewMatcher]

    performAction:grey_tap()];

[[[EarlGrey selectElementWithMatcher:aCellMatcher]

    usingSearchAction:grey_scrollInDirection(kGREYDirectionUp, 50)

onElementWithMatcher:aTableViewMatcher]

    performAction:grey_tap()];

相关文章

网友评论

      本文标题:3.1 Interaction APIs

      本文链接:https://www.haomeiwen.com/subject/ubphnxtx.html