Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 469
feat(clerk-js): Update OTP to use a single transparent field#6551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
92b73f20dfa16042870adcd2fb1bc9f05c336294b5130e2dca08cb42094f25197a3354580fa6cf112c3e9e57414800b72eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@clerk/clerk-js': minor | ||
| --- | ||
| Rework the OTP input to use a single transparent input (via `input-otp`) to improve password manager compatibility and iOS/Android SMS-based autofill. Removes individual digit fields; a single invisible input drives the six visual slots. | ||
| If you're using `@clerk/testing`, please ensure that you're using the latest version. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/testing': minor | ||
| --- | ||
| Update `enterOtpCode` to support new OTP input. Please ensure you're testing against the latest versions of each @clerk package. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -13,10 +13,11 @@ export const common: PlaywrightTestConfig = { | ||
| fullyParallel: true, | ||
| forbidOnly: !!process.env.CI, | ||
| retries: process.env.CI ? 5 : 0, | ||
| timeout: 90_000, | ||
| maxFailures: process.env.CI ? 5 : undefined, | ||
| workers: process.env.CI ? '50%' : '70%', | ||
| use: { | ||
| actionTimeout: 10_000, | ||
| navigationTimeout: 30_000, | ||
| ||
| ignoreHTTPSErrors: true, | ||
| trace: 'retain-on-failure', | ||
| bypassCSP: true, // We probably need to limit this to specific tests | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -103,7 +103,10 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('component | ||
| await u.page.goToRelative(component.path, { waitUntil: 'commit' }); | ||
| await expect(u.page.getByText(component.fallback)).toBeVisible(); | ||
| await signOut({ app, page, context }); | ||
| // eslint-disable-next-line playwright/no-conditional-in-test | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to run if it's never signed in, per a similar if statement. | ||
| if (component.protected) { | ||
| await signOut({ app, page, context }); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -75,9 +75,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | ||
| await u.page.getByRole('button', { name: /use another method/i }).click(); | ||
| await u.po.signIn.getAltMethodsEmailCodeButton().click(); | ||
| await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
| await page.waitForTimeout(2000); | ||
| // TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
| await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
| await page.keyboard.type('424242', { delay: 100 }); | ||
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These particular actions don't apply to our generic OTP component and, as such, are handled differently... and aren't common thus shouldn't go in | ||
| await u.po.signIn.continue(); | ||
| await u.page.waitForAppUrl('/'); | ||
| @@ -110,8 +109,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | ||
| await u.page.getByRole('button', { name: /^use phone/i }).click(); | ||
| await u.po.signIn.getIdentifierInput().fill(fakeUserWithoutPassword.phoneNumber); | ||
| await u.po.signIn.continue(); | ||
| await u.po.signIn.fillTestOtpCode('Enter phone verification code'); | ||
| await page.waitForTimeout(2000); | ||
| await page.getByRole('textbox', { name: 'Enter phone verification code' }).click(); | ||
| await page.keyboard.type('424242', { delay: 100 }); | ||
| await u.po.signIn.continue(); | ||
| await u.po.expect.toBeSignedIn(); | ||
| @@ -146,9 +145,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | ||
| await u.po.signIn.continue(); | ||
| await u.page.getByRole('button', { name: /^forgot password/i }).click(); | ||
| await u.po.signIn.getResetPassword().click(); | ||
| await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
| await page.waitForTimeout(2000); | ||
| // TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
| await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
| await page.keyboard.type('424242', { delay: 100 }); | ||
| await u.po.signIn.continue(); | ||
| await u.po.signIn.setPassword(`${fakeUserWithPasword.password}_reset`); | ||
| @@ -187,9 +185,8 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withEmailCodes] })('Next.js S | ||
| await u.page.getByRole('button', { name: /use another method/i }).click(); | ||
| await u.po.signIn.getAltMethodsEmailCodeButton().click(); | ||
| await u.po.signIn.fillTestOtpCode('Enter email verification code'); | ||
| await page.waitForTimeout(2000); | ||
| // TODO: In original test the input has autoSubmit and this step is not needed. Not used right now because it didn't work. | ||
| await page.getByRole('textbox', { name: 'Enter email verification code' }).click(); | ||
| await page.keyboard.type('424242', { delay: 100 }); | ||
| await u.po.signIn.continue(); | ||
| await u.po.expect.toBeSignedIn(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -107,7 +107,8 @@ export const testSignUp = async ({ app, page, context }: TestParams) => { | ||
| // Sign up with email and password | ||
| await u.po.signUp.signUpWithEmailAndPassword({ email: tempUser.email, password: tempUser.password }); | ||
| await u.po.signUp.enterOtpCode('424242'); | ||
| await u.po.signUp.enterTestOtpCode(); | ||
tmilewski marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| // Navigate back to localhost | ||
| await u.page.waitForAppUrl('/'); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.