E2E: one-time global auth before test start#7272
Open
phyllis-sy-wu wants to merge 5 commits intomainfrom
Open
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
76afe7f to
5f5c9e9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a Playwright globalSetup flow to authenticate the Shopify CLI and browser once per test run, then reuse the resulting CLI session files and browser storageState across worker-scoped fixtures.
Changes:
- Added
setup/global-auth.tsglobal setup to perform one-time CLI OAuth login and persist browser storage state. - Updated worker fixtures to reuse global session artifacts (copy XDG auth dirs + load
storageState) instead of re-authenticating. - Added a
globalLog()helper for pre-worker logging gated behindDEBUG=1.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/e2e/setup/global-auth.ts | New global setup that performs one-time login and writes reusable session artifacts. |
| packages/e2e/setup/auth.ts | Reuses global CLI session by copying XDG dirs; retains fallback per-worker login. |
| packages/e2e/setup/browser.ts | Loads Playwright storageState from global setup when available. |
| packages/e2e/setup/env.ts | Adds globalLog() for debug logging during global setup. |
| packages/e2e/playwright.config.ts | Registers the new Playwright globalSetup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
E2E tests currently authenticate the CLI and browser per worker on every test run. This PR centralizes authentication into a single
globalSetupstep that runs once before tests start.This lays the foundation for:
admin.shopify.comto create dev stores via the store creation formWHAT is this pull request doing?
Adds a Playwright
globalSetupthat authenticates once before tests start, then reuses the session:setup/global-auth.ts): Spawnsshopify auth loginvia PTY, completes OAuth in a headless browser (with passkey/WebAuthn bypass), waits for "Logged in"admin.shopify.comanddev.shopify.comto establish cookies for both domains (not justaccounts.shopify.com)setup/auth.ts): Copies the pre-authenticated CLI session files (XDG dirs) and loads browserstorageState— no re-authentication neededAlso includes a CodeQL fix: URL checks for
accounts.shopify.comredirects now usenew URL().hostnamecomparison instead of substring matching.Files changed:
setup/global-auth.tssetup/auth.tssetup/browser.tsstorageStatefrom global setupsetup/env.tsglobalLog()helper for pre-test loggingplaywright.config.tsglobalSetupentryHow to test your changes?
Checklist
pnpm changeset add