Home > database >  How to access Apple Id "Sign In" dialog from UI Test
How to access Apple Id "Sign In" dialog from UI Test

Time:08-30

I have one UI tests and want to test that I press "close" button. In simulator there is an alert displayed asking to sign in with your apple id. Please see attached Image in URL

Image

CodePudding user response:

This alert is part of the Springboard so to handle it you can use either:

let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
springboard.alerts["Sign in with your Apple ID").buttons["Close"].tap()

or

let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
springboard.alerts.element(boundBy: 0).buttons["Close"].tap()
  • Related