[pull] main from tldraw:main#593
Merged
Merged
Conversation
In order to move dotcom E2E coverage toward stable user scenarios, this PR adds a scenario-based Playwright project and fixture, migrates broad smoke coverage into namespaced scenario tests, and keeps the old smoke suite separate for remaining reset-based and auth-specific coverage. Relates to #9185. ### Questions and answers **What problem was solved?** Dotcom E2E coverage was built from isolated UI smoke tests that reset the whole database and shared users between runs. That made tests slow, order-sensitive, and poor at proving real collaborative behavior, since each test exercised a single window rather than how owners, members, and visitors actually interact. Reset-based isolation also blocked tests from running fully in parallel. **How did this PR solve it?** It adds a scenario-based Playwright project (`chromium-scenarios`, `fullyParallel: true`) and a `scenario` fixture with named actors (`owner`, `member`, `visitor`) whose contexts and pages are owned and cleaned up by the fixture. Scenarios namespace their files and workspaces with `scenario.name('label')` and reuse stable Clerk test accounts instead of resetting the database, so they run in parallel without clobbering each other. Common setup is exposed through helpers like `createPersonalFile`, `createSharedFile`, `createGuestEditFile`, `createPublishedFile`, `importFileFromUrl`, `setSharedLinkType`, `createWorkspaceWithMember`, and `createLegacyRouteFixture`, and readiness is awaited through actor helpers (`actor.goto`, `waitForFileRoomConnected`, `waitForAppStoreHydrated`, and friends) rather than sleeps. Broad smoke coverage was migrated into namespaced `*.scenario.spec.ts` tests, while reset-based coverage and auth edge cases remain in the preserved legacy `chromium` smoke suite until they can move over cleanly. **What's changed for me as a developer?** Run the default dotcom suite with `yarn e2e-dotcom` from the repo root (or `yarn workspace dotcom e2e`) — this now runs the scenario project only. Use `yarn workspace dotcom e2e-scenarios` to run scenarios without clearing stored auth, `yarn e2e-dotcom-smoke` for the preserved legacy smoke suite, and `yarn e2e-dotcom-all` to run both when comparing old and new coverage. New collaborative dotcom coverage should be written as scenario tests using the fixture and named actors; see `apps/dotcom/client/e2e/README.md` for conventions. **What does not change?** This is primarily test infrastructure and coverage. There are no public API changes; the small app and worker changes support namespaced, debug-only test fixtures and align legacy history rendering with the existing history response shape. The legacy smoke suite is preserved (not deleted) and remains the home for reset-based coverage and auth edge cases still tracked by #9185. ### Change type - [x] `improvement` ### Test plan 1. `yarn run -T oxfmt --check apps/dotcom/client/e2e/README.md apps/dotcom/client/e2e/consts.ts apps/dotcom/client/e2e/fixtures/Database.ts apps/dotcom/client/e2e/fixtures/Sidebar.ts apps/dotcom/client/e2e/fixtures/scenario-test.ts apps/dotcom/client/e2e/tests/auth.scenario.spec.ts apps/dotcom/client/e2e/tests/client-too-old.scenario.spec.ts apps/dotcom/client/e2e/tests/import-download.scenario.spec.ts apps/dotcom/client/e2e/tests/legacy-routes.scenario.spec.ts apps/dotcom/client/e2e/tests/sharing-live.scenario.spec.ts apps/dotcom/client/e2e/tests/ui.scenario.spec.ts apps/dotcom/client/e2e/tests/homepage.spec.ts apps/dotcom/client/e2e/tests/not-logged-in.spec.ts apps/dotcom/client/e2e/tests/sharing.spec.ts apps/dotcom/client/e2e/tests/signin-dialog.spec.ts apps/dotcom/client/e2e/tests/test-import-download.spec.ts apps/dotcom/client/e2e/tests/workspaces.spec.ts apps/dotcom/client/package.json apps/dotcom/client/playwright.config.ts apps/dotcom/client/src/tla/pages/legacy-history.tsx apps/dotcom/sync-worker/src/testRoutes.ts package.json` 2. `yarn run -T oxlint apps/dotcom/client/e2e/consts.ts apps/dotcom/client/e2e/fixtures/Database.ts apps/dotcom/client/e2e/fixtures/Sidebar.ts apps/dotcom/client/e2e/fixtures/scenario-test.ts apps/dotcom/client/e2e/tests/auth.scenario.spec.ts apps/dotcom/client/e2e/tests/client-too-old.scenario.spec.ts apps/dotcom/client/e2e/tests/import-download.scenario.spec.ts apps/dotcom/client/e2e/tests/legacy-routes.scenario.spec.ts apps/dotcom/client/e2e/tests/sharing-live.scenario.spec.ts apps/dotcom/client/e2e/tests/ui.scenario.spec.ts apps/dotcom/client/e2e/tests/homepage.spec.ts apps/dotcom/client/e2e/tests/not-logged-in.spec.ts apps/dotcom/client/e2e/tests/sharing.spec.ts apps/dotcom/client/e2e/tests/signin-dialog.spec.ts apps/dotcom/client/e2e/tests/test-import-download.spec.ts apps/dotcom/client/e2e/tests/workspaces.spec.ts apps/dotcom/client/playwright.config.ts apps/dotcom/client/src/tla/pages/legacy-history.tsx apps/dotcom/sync-worker/src/testRoutes.ts` 3. `NODE_OPTIONS='--no-strip-types' yarn workspace dotcom playwright test --project=chromium-scenarios --list` - [ ] Unit tests - [x] End to end tests ### Code changes | Section | LOC change | | -------------- | ----------- | | Tests | +1504 / -1236 | | Apps | +59 / -4 | | Config/tooling | +31 / -9 |
Addresses #7464 Adds an example showing the different types of edge scrolling behaviors
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )