Skip to content

Commit 06207f4

Browse files
authored
fix: Fixing the WebAuthn integration tests (#3933)
1 parent 69d0159 commit 06207f4

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.github/workflows/integ_test_auth.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: true
2323
default: true
2424
type: boolean
25+
webauthn-ios:
26+
description: '🔐 WebAuthn iOS'
27+
required: true
28+
default: true
29+
type: boolean
2530
workflow_call:
2631

2732
permissions:
@@ -59,8 +64,8 @@ jobs:
5964
timeout-minutes: 30
6065
secrets: inherit
6166

62-
# Disabling the integration test because the job is not able to connect to the local server
63-
# auth-webauthn-integration-test-iOS:
64-
# name: Auth WebAuthn Integration Tests (iOS)
65-
# uses: ./.github/workflows/integ_test_auth_webauthn.yml
66-
# secrets: inherit
67+
auth-webauthn-integration-test-iOS:
68+
if: ${{ inputs.webauthn-ios != 'false' }}
69+
name: Auth WebAuthn Integration Tests (iOS)
70+
uses: ./.github/workflows/integ_test_auth_webauthn.yml
71+
secrets: inherit

AmplifyPlugins/Auth/Tests/AuthWebAuthnApp/AuthWebAuthnAppUITests/AuthWebAuthnAppUITests.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ final class AuthWebAuthnAppUITests: XCTestCase {
1919
private var deleteButton: XCUIElement!
2020
private var deleteUserButton: XCUIElement!
2121
private var springboard: XCUIApplication!
22-
private var continueButton: XCUIElement!
22+
private var continueButton: XCUIElement! {
23+
springboard.otherElements["ASAuthorizationControllerContinueButton"]
24+
}
2325

2426
private lazy var deviceIdentifier: String = {
2527
let paths = Bundle.main.bundleURL.pathComponents
@@ -57,7 +59,6 @@ final class AuthWebAuthnAppUITests: XCTestCase {
5759
signInButton = nil
5860
deleteButton = nil
5961
deleteUserButton = nil
60-
continueButton = nil
6162
springboard = nil
6263
try await uninstallApp()
6364
}
@@ -233,9 +234,6 @@ final class AuthWebAuthnAppUITests: XCTestCase {
233234
signOutButton = app.buttons["SignOut"]
234235

235236
springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
236-
// The Continue button only appears when a FaceID operation is triggered,
237-
// so we're also not checking for its existance
238-
continueButton = springboard.otherElements["ASAuthorizationControllerContinueButton"]
239237
}
240238

241239
@MainActor

AmplifyPlugins/Auth/Tests/AuthWebAuthnApp/AuthWebAuthnAppUITests/LocalServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
enum LocalServer {
11-
static let endpoint = "http://127.0.0.1:9293"
11+
static let endpoint = "http://127.0.0.1:9294"
1212

1313
case boot(String)
1414
case enroll(String)

AmplifyPlugins/Auth/Tests/AuthWebAuthnApp/LocalServer/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ app.post('/match', async (req, res) => {
7272
}
7373
})
7474

75-
app.listen(9293, () => {
75+
app.listen(9294, () => {
7676
console.log("Simulator server started!")
7777
})

0 commit comments

Comments
 (0)