Skip to content

Commit 854a506

Browse files
test: sign in buttons are visible on auth picker
1 parent cab823c commit 854a506

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ extension SignInWithFacebookButton: View {
9191
.background(Color.blue)
9292
.cornerRadius(8)
9393
}
94+
.accessibilityIdentifier("sign-in-with-facebook-button")
9495
.alert(isPresented: $showCanceledAlert) {
9596
Alert(
9697
title: Text(authService.string.facebookLoginCancelledLabel),

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Views/SignInWithGoogleButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extension SignInWithGoogleButton: View {
4242
try await authService.signIn(googleProvider)
4343
}
4444
}
45+
.accessibilityIdentifier("sign-in-with-google-button")
4546
}
4647
}
4748

FirebaseSwiftUI/FirebasePhoneAuthSwiftUI/Sources/Views/PhoneAuthButtonView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extension PhoneAuthButtonView: View {
3838
.background(Color.green.opacity(0.8)) // Light green
3939
.cornerRadius(8)
4040
}
41+
.accessibilityIdentifier("sign-in-with-phone-button")
4142
}
4243
}
4344

FirebaseSwiftUI/FirebaseTwitterSwiftUI/Sources/Views/SignInWithTwitterButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ extension SignInWithTwitterButton: View {
4848
.background(Color.black)
4949
.cornerRadius(8)
5050
}
51+
.accessibilityIdentifier("sign-in-with-twitter-button")
5152
}
5253
}

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleUITests/FirebaseSwiftUIExampleUITests.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,40 @@ final class FirebaseSwiftUIExampleUITests: XCTestCase {
5151
}
5252
}
5353

54+
@MainActor
55+
func testSignInButtonsExist() throws {
56+
let app = XCUIApplication()
57+
app.launch()
58+
59+
// Check for Twitter/X sign-in button
60+
let twitterButton = app.buttons["sign-in-with-twitter-button"]
61+
XCTAssertTrue(
62+
twitterButton.waitForExistence(timeout: 5),
63+
"Twitter/X sign-in button should exist"
64+
)
65+
66+
// Check for Google sign-in button
67+
let googleButton = app.buttons["sign-in-with-google-button"]
68+
XCTAssertTrue(
69+
googleButton.waitForExistence(timeout: 5),
70+
"Google sign-in button should exist"
71+
)
72+
73+
// Check for Facebook sign-in button
74+
let facebookButton = app.buttons["sign-in-with-facebook-button"]
75+
XCTAssertTrue(
76+
facebookButton.waitForExistence(timeout: 5),
77+
"Facebook sign-in button should exist"
78+
)
79+
80+
// Check for Phone sign-in button
81+
let phoneButton = app.buttons["sign-in-with-phone-button"]
82+
XCTAssertTrue(
83+
phoneButton.waitForExistence(timeout: 5),
84+
"Phone sign-in button should exist"
85+
)
86+
}
87+
5488
@MainActor
5589
func testSignInDisplaysSignedInView() throws {
5690
let app = XCUIApplication()

0 commit comments

Comments
 (0)