0

Iam a beginner in EarlGrey. Before i used them, I used swift. Now, is my problem I have a while loop, I don't know how I can make a while loop in EarlGrey.

I want this while loop written in EarlGrey :

if XCUIApplication().otherElements[XYZ].exists { while !XCUIApplication().buttons[Button].exists { 
XCUIApplication().otherElements[XYZ].swipeLeft() } 
XCTAssertTrue(XCUIApplication().buttons[Button].exists, "Button not exist!") XCUIApplication().buttons[Button].tap() 
}

Thanks a lot!

Saintz
  • 69
  • 7

1 Answers1

0

if existAccessibilityID(AccessibilityIdentifier: "XYZ") { EarlGrey.select(elementWithMatcher: grey_accessibilityID(Button)).usingSearch(grey_swipeFastInDirection(GREYDirection.left), onElementWith: grey_accessibilityID(PageViewController)).perform(grey_tap()) }

Ok, I have found a solution...

Saintz
  • 69
  • 7