Skip to content

test(e2e): video recording happy-path spec (Phase 2)#337

Merged
ionleu merged 1 commit into
developfrom
test/capture-video-happy
Jun 12, 2026
Merged

test(e2e): video recording happy-path spec (Phase 2)#337
ionleu merged 1 commit into
developfrom
test/capture-video-happy

Conversation

@ionleu

@ionleu ionleu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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.ts already arms --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 picker.
  • pickMimeType() in video.capture.ts falls back vp9 → vp8 → bare WebM; the fake source supports all three.

Fixture tightening (same PR):

  • mock-api.ts now returns a proper InitSliceResponse shape — assets.screenshots[] + assets.video + assets.records + assets.events + assets.annotations — matching packages/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.fixme again, 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:

  • Root: pnpm test:video builds Chrome prod + runs the new spec.
  • tests/e2e: test:video script targets capture-video-happy.spec.ts only.

Test plan

  • pnpm exec tsc --noEmit -p tests/e2e/playwright/tsconfig.json clean.
  • npx eslint tests/e2e/playwright/**/*.ts clean.
  • Run pnpm test:video locally with .fixme removed; tune selectors as needed; flip in a follow-up.

Phase plan recap

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.
@ionleu ionleu requested a review from LuminitaL as a code owner June 12, 2026 01:55
@ionleu ionleu merged commit 7c0fb06 into develop Jun 12, 2026
3 of 5 checks passed
@ionleu ionleu deleted the test/capture-video-happy branch June 12, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant