Skip to content

Commit

Permalink
Updates to fix issues with the latest iOS simulator finding a text field
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Nov 23, 2023
1 parent 6f0c25c commit e9d9396
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Samples/DirectAuthSignIn/UITests/Pages/SignInScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ class SignInScreen: Screen {
}

func login(username: String? = nil, factor: Factor, value: String? = nil) {
if let username = username,
app.textFields.firstMatch.waitForExistence(timeout: .standard)
{
let field = app.textFields.element(boundBy: 0)
if let username = username {
let field = app.textFields["username_field"]
_ = field.waitForExistence(timeout: .standard)
field.tap()

if let fieldValue = field.value as? String,
!fieldValue.isEmpty
{
usleep(useconds_t(1000)) // Wait for the field to be selected
field.tap(withNumberOfTaps: 3, numberOfTouches: 1)
}

Expand Down

0 comments on commit e9d9396

Please sign in to comment.