Auth start
A signed-out user opens AuthView and sees the start screen, where they enter an email, username, or phone number.
Sub-features
full-screenopens AuthView as the whole content of the activity from the home'sSign in full screenbutton.initial-identifieropens AuthView on the phone field, holding the number the app passed asinitialIdentifier.dismisscloses the AuthView that the home'sSign inbutton opens with its close button, shows the home again, and opens AuthView again.
How to get to it (user POV)
- Launch the app signed out and tap
Sign in. - Launch the app signed out and tap
Sign in full screen. The sign-in screen has no close button. - Open the sign-in screen from an app that already knows the phone number. The screen opens with that number in it.
- After
Sign in, tap the close button at the top of the sign-in screen to go back to the home.
Driving it with verify
Preconditions:
The first and third tests need no user. The second seeds one with
host.seedUser({ phone: true, password: true }). The spec runs on the standard settings, so it launches signed out.Full screen. Run
e2e-tests/bin/control-clerk-android run auth-start. The first test launches, tapse2e.auth.signInFullScreen, and expectsclerk.auth.start.identifierandclerk.auth.start.continuewith noclerk.dismissButton. Screenshotauth-full-screen, which shows AuthView as the whole content of the activity.Initial identifier. The second test launches with
authMode: 'signIn'and the user's phone asinitialIdentifier, and tapse2e.auth.signInFullScreen, and the host showsAuthView(initialIdentifier = <that phone>). AuthView then opens on the phone field and shows noclerk.auth.start.identifier. The test expectsclerk.auth.start.phoneNumberto hold the number as Clerk formats it andclerk.auth.start.identifierto be absent, then tapsclerk.auth.start.continueand expectsclerk.auth.signIn.password. Screenshotsauth-initial-identifierandauth-initial-identifier-accepted.Home button and dismiss. The third test launches, expects
Signed outon the home, tapse2e.auth.signIn, and expectsclerk.auth.start.identifierandclerk.auth.start.continue. Screenshotauth-from-home. It then tapsclerk.dismissButtonwithhost.tap(middleOf(...)), waits for the home to showSigned out, and expects noclerk.auth.start.identifier. Screenshotauth-dismissed. It then tapse2e.auth.signInagain and expects the identifier field.Proof.
specs/features/auth-start/auth-start.e2e.tspasses. The run directory holdsvideo.mp4and the five screenshots.
Gotchas
- A missing or malformed publishable key shows the host's error screen,
Something went wrongwith the reason, instead of an empty AuthView.host.launchfails with that reason. - The home and the AuthView behind
Sign inare never on screen together, soSigned outon the home is how the dismiss test knows that AuthView has closed. clerk.dismissButtonis an icon button, and its whole box belongs to its icon. A plain tap fails with "no parent-owned touch point outside its interactive descendants", so the test taps it withhost.tap(middleOf(locator)), andmiddleOfis inspecs/compose.ts.- AuthView remembers identifiers by default. The host turns that off with
persistIdentifiers = false, so the field starts empty on every launch. - The identifier is a launch input,
verifyInitialIdentifier. The host has no screen of its own for it, and only the AuthView behindSign in full screengets it. asShownByClerk(phone)inspecs/phone.tsgives the formatted text the phone field shows,+1 201-555-01xx.