Skip to content

test(e2e): Add passkey flows using Playwright virtual authenticator - #9329

Open
wobsoriano wants to merge 4 commits into
mainfrom
rob/e2e-passkeys
Open

test(e2e): Add passkey flows using Playwright virtual authenticator#9329
wobsoriano wants to merge 4 commits into
mainfrom
rob/e2e-passkeys

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

Playwright 1.61 added a supported WebAuthn virtual authenticator (browserContext.credentials) (ref), which makes passkey flows testable end to end for the first time. This adds an integration suite covering the passkey lifecycle against real FAPI ceremonies. Registration through <UserProfile />, then sign-in three ways:

  • conditional UI autofill
  • identifier-first factor-one card
  • discoverable "Use passkey instead" flow

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ecc809a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 4, 2026 7:28pm
swingset Ready Ready Preview Aug 4, 2026 7:28pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9329

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9329

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9329

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9329

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9329

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9329

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9329

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9329

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9329

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9329

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9329

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9329

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9329

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9329

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9329

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9329

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9329

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9329

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9329

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9329

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9329

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9329

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9329

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9329

commit: ecc809a

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e94d19ae-c4e6-4e88-a2ea-f93937f178d5

📥 Commits

Reviewing files that changed from the base of the PR and between 163c6e5 and ecc809a.

📒 Files selected for processing (1)
  • integration/presets/envs.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
  • clerk/cli (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration/presets/envs.ts

📝 Walkthrough

Walkthrough

Adds a withPasskeys integration environment preset and upgrades Playwright. Adds serial end-to-end tests for passkey registration, conditional autofill, identifier-first sign-in, and seeded passkey sign-in. The tests use a virtual authenticator, fake user setup, credential storage, and cleanup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the added passkey end-to-end tests and Playwright virtual authenticator support.
Description check ✅ Passed The description directly explains the passkey integration suite and the covered registration and sign-in flows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Linked repositories: Couldn't analyze clerk/clerk-android - clone failed: Clone operation failed: Cloning into '/home/jailuser/git'...
From https://github.com/clerk/clerk-android

Errors logged to '/home/jailuser/git/.git/lfs/logs/20260804T193014.533602458.log'.
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: config/bin/detekt-cli: smudge filter lfs failed
Downloading config/bin/detekt-cli (71 MB)
Error downloading object: config/bin/detekt-cli (2655f48): Smudge error: Error downloading config/bin/detekt-cli (2655f48c7c303a5f9bf920a33229408b8571bb1d29e4e57cf7be3e151bceecb1): LFS: Client error: https://github-cloud.githubusercontent.com/alambic/media/877189286/26/55/2655f48c7c303a5f9bf920a33229408b8571bb1d29e4e57cf7be3e151bceecb1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5BA2674WPWWEFGQ5%2F20260804%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260804T193133Z&X-Amz-Expires=3600&X-Amz-Signature=8317244f80b02c0c5ccf135f32aba602439212d4b13b7d03f63873228eea6708&X-Amz-SignedHeaders=host&actor_id=136622811&key_id=0&repo_id=980409545&token=1

Errors logged to '/home/jailuser/git/.git/lfs/logs/20260804T193133.831671296.log'.
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: config/bin/detekt-cli: smudge filter lfs failed


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integration/presets/envs.ts`:
- Around line 252-255: Update the withPasskeys preset and withInstanceKeys flow
so CLERK_API_URL is set to STAGING_API_URL only when staging keys are selected
(E2E_STAGING === '1'); preserve the non-staging API URL when withInstanceKeys
returns non-staging keys.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 77fd6bdf-e74e-4b89-bad4-662562d0b382

📥 Commits

Reviewing files that changed from the base of the PR and between 438f2e5 and 163c6e5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • .changeset/passkey-e2e-suite.md
  • integration/presets/envs.ts
  • integration/tests/passkeys.test.ts
  • package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)
  • clerk/cli (auto-detected)

Comment thread integration/presets/envs.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant