Skip to content

Commit 6e6fbd8

Browse files
committed
test to verify email link sent successfully
1 parent f7c6f90 commit 6e6fbd8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests/AuthenticationExampleUITests.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,27 @@ class AuthenticationExampleUITests: XCTestCase {
226226
removeUIInterruptionMonitor(interruptionMonitor)
227227
}
228228

229+
func testEmailLinkSentSuccessfully(){
230+
app.staticTexts["Email Link/Passwordless"].tap()
231+
232+
let testEmail = "[email protected]"
233+
app.textFields["Enter Authentication Email"].tap()
234+
app.textFields["Enter Authentication Email"].typeText(testEmail)
235+
app.buttons["return"].tap() // Dismiss keyboard
236+
237+
app.buttons["Send Sign In Link"].tap()
238+
239+
//Wait for the error message to appear (if there is an error)
240+
let errorAlert = app.alerts.staticTexts["Error"]
241+
let errorExists = errorAlert.waitForExistence(timeout: 5.0)
242+
243+
app.swipeDown(velocity: .fast)
244+
245+
//Assert that there is no error message (success case)
246+
XCTAssertFalse(errorExists, "Expected no error message, but one appeared.")
247+
//At this point, the link is assumed to have been sent successfully since no error appeared
248+
}
249+
229250
// MARK: - Private Helpers
230251

231252
private func signOut() {

0 commit comments

Comments
 (0)