Skip to content

End-to-End UI Tests in Authentication Example for Passkey #15212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: passkey-app-implementation-sv
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,37 @@ class AuthenticationExampleUITests: XCTestCase {
)
}

func testPasskeyList() {
signOut()
let testEmail = "[email protected]"
let testPassword = "sample.ios.auth"
let testPasskeyName = "sampleiosauth"
app.staticTexts["Email & Password Login"].tap()
app.textFields["Email"].tap()
app.textFields["Email"].typeText(testEmail)
app.textFields["Password"].tap()
app.textFields["Password"].typeText(testPassword)
app.buttons["Login"].tap()
wait(forElement: app.navigationBars["User"], timeout: 5.0)
XCTAssertTrue(app.navigationBars["User"].exists)
XCTAssertTrue(
app.staticTexts[testEmail].exists,
"The user should be signed in and the email field should display their email."
)
let userTable = app.tables.firstMatch
XCTAssertTrue(userTable.waitForExistence(timeout: 5.0), "User detail list should exist")
let passkeyLabel = userTable.staticTexts[testPasskeyName]
if !passkeyLabel.exists {
for _ in 0 ..< 5 where !passkeyLabel.exists {
userTable.swipeUp()
}
}
XCTAssertTrue(
passkeyLabel.waitForExistence(timeout: 5.0),
"Passkey named '\(testPasskeyName)' should be visible in the Passkeys section."
)
}

// MARK: - Private Helpers

private func signOut() {
Expand Down
Loading