From 8e382f6e73d8a03f2bee548b16ff79b18ab93ea3 Mon Sep 17 00:00:00 2001 From: Srushti Vaidya Date: Fri, 8 Nov 2024 14:08:21 +0530 Subject: [PATCH] fix checks --- .../AuthenticationExampleUITests.swift | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests/AuthenticationExampleUITests.swift b/FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests/AuthenticationExampleUITests.swift index 12b2cceea32..d7c893d20c8 100644 --- a/FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests/AuthenticationExampleUITests.swift +++ b/FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests/AuthenticationExampleUITests.swift @@ -225,7 +225,7 @@ class AuthenticationExampleUITests: XCTestCase { // Cleanup removeUIInterruptionMonitor(interruptionMonitor) } - + func testEmailLinkSentSuccessfully() { app.staticTexts["Email Link/Passwordless"].tap() @@ -254,6 +254,7 @@ class AuthenticationExampleUITests: XCTestCase { "The user shouldn't be signed in and the user view should have no cells." ) } + func testResetPasswordLinkCustomDomain() { // assuming action type is in-app + continue URL everytime the app launches @@ -308,6 +309,22 @@ class AuthenticationExampleUITests: XCTestCase { ) } + // MARK: - Private Helpers + + private func signOut() { + if app.tabBars.firstMatch.buttons.element(boundBy: 1).exists { + app.tabBars.firstMatch.buttons.element(boundBy: 1).tap() + } + wait(forElement: app.navigationBars["User"], timeout: 5.0) + if app.staticTexts["Sign Out"].exists { + app.staticTexts["Sign Out"].tap() + } + if app.tabBars.firstMatch.buttons.element(boundBy: 0).exists { + app.tabBars.firstMatch.buttons.element(boundBy: 0).tap() + } + } +} + extension XCTestCase { func wait(forElement element: XCUIElement, timeout: TimeInterval) { let predicate = NSPredicate(format: "exists == 1")