Skip to content

Commit

Permalink
Work around new iOS simulator issue with selecting text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenachbaur-okta committed Nov 21, 2023
1 parent 0d07c3f commit 34552e1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Samples/Shared/Common/Testing/Screen+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ extension WebLogin where Self: Screen {
app.webViews.textFields.firstMatch.waitForExistence(timeout: .veryLong)
{
let field = app.webViews.textFields.element(boundBy: 0)

if !isEphemeral,
let fieldValue = field.value as? String,
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)
} else {
field.tap()
}

field.typeText(username)
Expand Down

0 comments on commit 34552e1

Please sign in to comment.