Uh oh!
There was an error while loading. Please reload this page.
feat(auth): add stable resource ids for auth input fields - #2449
Conversation
Warning Gemini encountered an error creating the review. You can try again by commenting |
dbaac07 to
f896825Comparecbb6d8c to
c61b117Comparedemolaf
commented
Aug 19, 2026
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces stable Compose test tags (FirebaseAuthTestTags) across all authentication screens and exposes them as Android resource IDs using a new exposeTestTagsAsResourceIds modifier. This allows automated testing tools like Firebase Test Lab's Robo test and Google Play Console's pre-launch reports to reliably interact with the UI. It also enhances the VerificationCodeInputField to support group-level text input semantics and adds positional content descriptions for accessibility. The reviewer pointed out that adding a new abstract method to the public AuthUIStringProvider interface is a breaking change for external implementers and suggested providing a default implementation to maintain backward compatibility.
Uh oh!
There was an error while loading. Please reload this page.
06a6fe9 to
697f1d9Compared442657 to
0d340bfCompare0d340bf to
a76156cCompareUh oh!
There was an error while loading. Please reload this page.
Fixes#2050.
Firebase Test Lab Robo tests and Play pre-launch reports could not target the auth screens' credential fields — 10.x's Compose rewrite deleted the 8.x resource IDs (
@id/email,@id/password) they replaced, so a crawler found a field and typed nothing into it, tripping "trouble signing in" and flooding the test account with password-reset emails.Adds
FirebaseAuthTestTags, a public registry of ~62 stable test tags across every credential field, submit button, and secondary action on the auth screens, and setstestTagsAsResourceIdat every semantics owner (screens, dialogs, bottom sheets) so the tags resolve as Android resource idsBy.res()/Robo directives can address. Verified against a real Firebase Test Lab Robo run — the tagged sign-in fields resolved asandroid.widget.EditText, Robo typed the directive values into both, and submitted. Full writeup and the resource id reference table are inauth/README.md's new Automated Testing section.FirebaseAuthTestTags.kt: new registry, nested by screen (SignIn,SignUp,VerificationCode,MfaEnrollment, etc.); enforced by a reflective test (naming/uniqueness) and a source scan (every tag call must reference the registry, every dialog/sheet/scaffold must expose its tags)VerificationCodeInputField.kt: the six-digit code input's container now accepts a whole code in oneACTION_SET_TEXT, so one Robo directive types the entire code; digit boxes get distinct, localized descriptions instead of one shared string (newAuthUIStringProvider.verificationCodeDigitDescription— breaking for direct implementors, not for this repo's own delegating ones)AuthProviderButton.kt,FirebaseAuthScreen.kt,PhoneAuthScreen.kt,SignInUI.kt,SignInEmailLinkUI.kt: fixed four places where a caller'smodifierwas applied twice or dropped entirely instead of once, found while wiring tags through them.AuthProviderButtonis now always full-width; wrap-content is no longer supported.CountrySelector.kt: new publicmodifierparam so its tag lands on the actual clickable nodeAuthTextField.kt: newvisibilityToggleModifierparam so a screen can tag the password-visibility toggle independently of the fieldAdded tests for every new tag, the resource-id exposure itself (reads the real
AccessibilityNodeInfo, not just the Compose tag), and the four modifier fixes — several fail against the pre-fix code.Preview
test-lab-result-final.mp4