@@ -188,14 +188,15 @@ class AuthenticationExampleUITests: XCTestCase {
188188 let testEmail = " [email protected] " 189189 app. textFields [ " Email " ] . tap ( )
190190 app. typeText ( testEmail)
191- // app.buttons["return"].tap() // dismiss keyboard
192191 let testPassword = " sampleauthios "
193192 app. textFields [ " Password " ] . tap ( )
194193 app. typeText ( testPassword)
195- // app.buttons["return"].tap() // dismiss keyboard
196194 app. buttons [ " Login " ] . tap ( )
197195 // enroll multifactor with phone
198- app. tabBars. buttons [ " Authentication " ] . tap ( )
196+ let authenticationButton = app. tabBars. buttons [ " Authentication " ]
197+ let exists = authenticationButton. waitForExistence ( timeout: 5 )
198+ XCTAssertTrue ( exists, " Authentication button did not appear in time. " )
199+ authenticationButton. tap ( )
199200 app. tables. cells. staticTexts [ " Phone Enroll " ] . tap ( )
200201 let testSecondFactorPhone = " +11234567890 "
201202 app. typeText ( testSecondFactorPhone)
@@ -226,11 +227,9 @@ class AuthenticationExampleUITests: XCTestCase {
226227 let testEmail = " [email protected] " 227228 app. textFields [ " Email " ] . tap ( )
228229 app. typeText ( testEmail)
229- app. buttons [ " return " ] . tap ( ) // dismiss keyboard
230230 let testPassword = " sampleios123 "
231231 app. textFields [ " Password " ] . tap ( )
232232 app. typeText ( testPassword)
233- app. buttons [ " return " ] . tap ( ) // dismiss keyboard
234233 app. buttons [ " Login " ] . tap ( )
235234 // login with second factor
236235 XCTAssertTrue ( app. staticTexts [ " Choose a second factor to continue. " ]
0 commit comments