File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
FirebaseAuth/Tests/SampleSwift/AuthenticationExampleUITests Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,35 @@ 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+ app. buttons [ " Send Sign In Link " ] . tap ( )
237+
238+ // Wait for the error message to appear (if there is an error)
239+ let errorAlert = app. alerts. staticTexts [ " Error " ]
240+ let errorExists = errorAlert. waitForExistence ( timeout: 5.0 )
241+
242+ app. swipeDown ( velocity: . fast)
243+
244+ // Assert that there is no error message (success case)
245+ // The email sign in link is sent successfully if no error message appears
246+ XCTAssertFalse ( errorExists, " Error " )
247+
248+ // Go back and check that there is no user that is signed in
249+ app. tabBars. firstMatch. buttons. element ( boundBy: 1 ) . tap ( )
250+ wait ( forElement: app. navigationBars [ " User " ] , timeout: 5.0 )
251+ XCTAssertEqual (
252+ app. cells. count,
253+ 0 ,
254+ " The user shouldn't be signed in and the user view should have no cells. "
255+ )
256+ }
257+
229258 // MARK: - Private Helpers
230259
231260 private func signOut( ) {
You can’t perform that action at this time.
0 commit comments