Sign up
A new user enters a test email or a test phone number, gives what the instance still requires, enters the code for each address, and lands signed in.
Sub-features
completereaches the password step for a new test email, sets the run password, types424242on the code screen, and lands signed in.complete-from-homedoes the same in the AuthView that the home'sSign inbutton opens, and that AuthView closes itself.phonestarts with a phone number, gives the email and the password that the standard settings require, verifies the email and then the phone with424242, and lands signed in.
How to get to it (user POV)
- Open AuthView in sign-up mode, type an email, tap Continue, type a password, tap Continue, then type the code.
- For a phone sign-up, tap
Use phone numberon the start screen, type the number, and tap Continue. Type an email, tap Continue, type a password, tap Continue, then type the emailed code and the SMS code.
Driving it with verify
Preconditions:
Each test gets an email from
host.newEmail()and launches withauthMode: 'signUp', then tapse2e.auth.signInFullScreen. The second test ofcomplete.e2e.tstapse2e.auth.signIninstead.e2e-tests/bin/control-clerk-android downdeletes the user the form creates.The standard settings take a phone number at sign-up and verify it by SMS code, and they still require an email and a password.
phone.e2e.tsgets a number that no user holds fromhost.newPhone().Password step. Run
e2e-tests/bin/control-clerk-android run sign-up/complete. It fillsclerk.auth.start.identifier, tapsclerk.auth.start.continue, and expectsclerk.auth.signUp.passwordandclerk.auth.signUp.continue. Screenshotsignup-password.Request code. It then fills
clerk.auth.signUp.passwordwithrunPassword(host.runId), tapsclerk.auth.signUp.continue, and expectsclerk.auth.signUp.code. Screenshotsignup-code.Complete. After the code screen it fills
CLERK_TEST_CODEand waits for the home to showSigned in asthe new email with a user ID. Screenshotsigned-up.Complete in the AuthView the home opens. The second test of
complete.e2e.tstapse2e.auth.signInand does the same steps in the AuthView with a close button. The home closes that AuthView only inonAuthComplete, inonDismiss, or on back. The test neither closes it nor presses back, soSigned in asthe new email on the home proves thatonAuthCompleteran. Screenshotsigned-up-from-home.Sign up with a phone number. Run
e2e-tests/bin/control-clerk-android run sign-up/phone. It tapsclerk.auth.start.identifierSwitcher, fillsclerk.auth.start.phoneNumberwith the ten digits of the number, and tapsclerk.auth.start.continue. It fillsclerk.auth.signUp.emailAddresswith the email andclerk.auth.signUp.passwordwith the run password, and tapsclerk.auth.signUp.continueafter each. It expectsCheck your emailwith the email on the code screen, and fillsclerk.auth.signUp.codewithCLERK_TEST_CODE. Screenshotsignup-phone-email-code. It expectsCheck your phonewith the number as Clerk formats it, fills the code again, and waits for the home to showSigned in asthe email with a user ID. Screenshotssignup-phone-codeandsigned-up-with-phone.Proof. Both specs pass.
run.jsonlists the email underidentitieswith the id of the user the form created.
States a spec cannot reach
| State | Where the app decides | What it takes |
|---|---|---|
| The email link step | auth/AuthRouting.kt, when signUp.isEmailLinkVerificationSupported is true |
The email link, which the standard instance turns off. A spec turns it on with host.useSettings({ config: { 'auth_email.verification_strategies': ['email_code', 'email_link'] } }), as references/instances.md lists. No committed spec does |
Gotchas
- Android asks for the password before the code.
- A phone sign-up collects everything before it verifies anything: the email, then the password. It then verifies the email before the phone.
- Both code screens use
clerk.auth.signUp.code. Their titles tell them apart,Check your emailandCheck your phone, and neither title has a test tag, so those checks use text. - The steps that collect a field, such as the password, the code steps, and the complete-profile step, show
Sign upin their top bar, above the step's own title, and that top bar title has no test tag. The email link step, which the standard instance does not reach, has noSign upin its top bar. Tell the steps apart by their fields or their own titles, not bySign up. - The phone code screen shows the number formatted,
+1 201-555-01xx.asShownByClerk(phone)inspecs/phone.tsgives that text. - The password field withholds its value from the screen tree.
host.filltypes the password once and cannot confirm that it landed, so assert on what the form does next.