test(e2e): video recording happy-path spec (Phase 2)#337
Merged
Conversation
Sibling to the screenshot spec. Drives popup → RECORDING.START → ~2s of fake-media recording → toolbar stop → submit → asset upload. The extension fixture already passes `--use-fake-ui-for-media-stream`, `--use-fake-device-for-media-stream`, and `--auto-select-desktop-capture-source=Entire screen`, so getDisplayMedia resolves without a real picker. MediaRecorder picks the first supported WebM codec (vp9 → vp8 → bare WebM), all of which work against Chromium's fake media source. Also tightens mock-api.ts to return a proper InitSliceResponse shape (matching packages/shared/lib/interfaces/slice.interface.ts) instead of the placeholder array Phase 1 used. RTK Query needs the right asset object — screenshots[] / video / records / events — so both specs can share one mock. Marked test.fixme until the selector pass has been validated locally; the spec body documents the three most likely failure points. Wiring: - Root: `pnpm test:video` builds Chrome prod + runs the new spec. - tests/e2e: `test:video` script pinned to capture-video-happy.spec.ts.
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.
Summary
Sibling to the Phase-1 screenshot spec (#336). Drives popup →
RECORDING.START→ ~2s of fake-media recording → toolbar stop → submit → asset upload.Why this works in CI
extension.tsalready arms--use-fake-ui-for-media-stream,--use-fake-device-for-media-stream, and--auto-select-desktop-capture-source=Entire screen, sogetDisplayMediaresolves without a picker.pickMimeType()invideo.capture.tsfalls back vp9 → vp8 → bare WebM; the fake source supports all three.Fixture tightening (same PR):
mock-api.tsnow returns a properInitSliceResponseshape —assets.screenshots[]+assets.video+assets.records+assets.events+assets.annotations— matchingpackages/shared/lib/interfaces/slice.interface.ts. Phase 1 used a placeholder array shape that wouldn't have matched RTK Query's expectations for the video flow.test.fixmeagain, same reasoning as Phase 1. The spec body lists the three most likely failure points (getDisplayMedia rejected, stop-button selector localisation, FFmpeg lazy-load timeout).Wiring:
pnpm test:videobuilds Chrome prod + runs the new spec.tests/e2e:test:videoscript targetscapture-video-happy.spec.tsonly.Test plan
pnpm exec tsc --noEmit -p tests/e2e/playwright/tsconfig.jsonclean.npx eslint tests/e2e/playwright/**/*.tsclean.pnpm test:videolocally with.fixmeremoved; tune selectors as needed; flip in a follow-up.Phase plan recap