in authentication/AuthenticationExampleUITests/AuthenticationExampleUITests.swift [186:228]
func DRAFT_testGoogleSignInAndLinkAccount() {
let interruptionMonitor = addUIInterruptionMonitor(withDescription: "Sign in with Google") {
(alert) -> Bool in
alert.buttons["Continue"].tap()
return true
}
app.staticTexts["Google"].tap()
app.tap() // Triggers the UIInterruptionMonitor
let testEmail = ""
let testPassword = ""
let firstTimeLogin = app.webViews.containing(.textField, identifier: "Email or phone")
.element.exists
if firstTimeLogin {
app.webViews.textFields.firstMatch.tap()
app.webViews.textFields.firstMatch.typeText(testEmail)
app.buttons["Done"].tap() // Dismiss keyboard
app.buttons["Next"].tap() // Transition to Google sign in password page
app.webViews.secureTextFields.firstMatch.tap()
app.webViews.secureTextFields.firstMatch.typeText(testPassword)
app.buttons["Done"].tap() // Dismiss keyboard
app.buttons["Next"].tap() // Complete sign in
} else {
app.webViews.staticTexts[testEmail].tap()
}
wait(forElement: app.navigationBars["User"], timeout: 5.0)
XCTAssertTrue(app.navigationBars["User"].exists)
XCTAssertTrue(app.staticTexts[testEmail].exists)
// Cleanup
removeUIInterruptionMonitor(interruptionMonitor)
}