Skip to content

[ci] Add additional Dreamverse UI tests - #1417

Merged
SolitaryThinker merged 4 commits into
mainfrom
klin/addt-dreamverse-tests
Jun 1, 2026
Merged

[ci] Add additional Dreamverse UI tests#1417
SolitaryThinker merged 4 commits into
mainfrom
klin/addt-dreamverse-tests

Conversation

@kevin314

@kevin314 kevin314 commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Adds additional playwright tests for the Dreamverse UI

Changes

New coverage for chromium as well as Safari, Firefox, Edge (on desktop and mobile):

  • MSE pipeline attaches the live
  • SourceBuffer decodes streamed fMP4 without errors
  • Video playback starts and doesn't stall
  • Download button renders after clip is materialized
  • Download button triggers a real file download with bytes
  • Project history sidebar opens and shows the current session
  • New project closes the sidebar and resets the composer
  • Prior session persists to the project timeline
  • Clicking a prior session enters viewing mode
  • Persist project history across reload

Test Plan

cd apps/dreamverse/web
npm run e2e

Test Results

Test output
# Paste output here

Checklist

  • I ran pre-commit run --all-files and fixed all issues
  • I added or updated tests for my changes
  • I updated documentation if needed
  • I considered GPU memory impact of my changes

For model/pipeline changes, also check:

  • I verified SSIM regression tests pass
  • I updated the support matrix if adding a new model

@mergify mergify Bot added type: ci CI/CD infrastructure scope: infra CI, tests, Docker, build labels May 31, 2026
@mergify

mergify Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 PR merge requirements

Waiting for

  • check-success=fastcheck-passed
  • check-success=full-suite-passed
This rule is failing.
  • check-success=fastcheck-passed
  • check-success=full-suite-passed
  • #approved-reviews-by>=1
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds a silent stereo AAC audio track to the mock server's video generation and introduces comprehensive end-to-end tests for streaming, playback, downloading, and project persistence. It also expands Playwright test coverage across multiple desktop and mobile browsers. The review feedback focuses on improving test robustness by replacing hardcoded 'just now' time assertions with regular expressions to prevent CI flakiness, and using Object.defineProperty to mock navigator.share to avoid potential TypeError issues in modern browsers.

Comment on lines +57 to +64
(navigator as unknown as { share: (d: { files?: File[] }) => Promise<void> }).share = async (data) => {
const files = Array.isArray(data?.files) ? data.files : [];
(window as unknown as { __sharedFiles: unknown }).__sharedFiles = files.map((f) => ({
name: f.name,
type: f.type,
size: f.size,
}));
};

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.

medium

Directly assigning to navigator.share can throw a TypeError in modern browsers (like Safari/WebKit or mobile Chrome) because navigator properties are typically read-only on the prototype.\n\nTo ensure the mock works reliably across all target browsers (including WebKit and mobile-safari), use Object.defineProperty to define the property as writable and configurable.

      Object.defineProperty(navigator, 'share', {
        value: async (data?: { files?: File[] }) => {
          const files = Array.isArray(data?.files) ? data.files : [];
          (window as unknown as { __sharedFiles: unknown }).__sharedFiles = files.map((f) => ({
            name: f.name,
            type: f.type,
            size: f.size,
          }));
        },
        configurable: true,
        writable: true,
      });

await page.getByRole('button', { name: 'Toggle sidebar' }).click();
await expect(sidebar).toBeInViewport();
await expect(sidebar.getByText('Previous', { exact: true })).toBeVisible({ timeout: 30_000 });
await expect(sidebar.getByText('just now').first()).toBeVisible();

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.

medium

Using the hardcoded string 'just now' can lead to flaky tests in CI environments if there is any delay between the generation completing and the sidebar assertion.\n\nUsing a regular expression that matches both 'just now' and relative minute durations (similar to the assertion on line 298) will make the test much more robust.

Suggested change
await expect(sidebar.getByText('just now').first()).toBeVisible();
await expect(sidebar.getByText(/^(just now|\d+m ago)$/).first()).toBeVisible();

});

await test.step('clicking the prior session enters viewing mode', async () => {
const priorRow = sidebar.locator('div[role="button"]').filter({ hasText: 'just now' }).first();

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.

medium

Using the hardcoded string 'just now' to filter the prior session row can cause the test to fail if the relative time updates to '1m ago' due to CI latency.\n\nUpdating this to use a regular expression matching both 'just now' and relative minute durations will prevent test flakiness.

Suggested change
const priorRow = sidebar.locator('div[role="button"]').filter({ hasText: 'just now' }).first();
const priorRow = sidebar.locator('div[role="button"]').filter({ hasText: /^(just now|\d+m ago)$/ }).first();

await page.getByRole('button', { name: 'Toggle sidebar' }).click();
await expect(sidebar).toBeInViewport();
await expect(sidebar.getByText('Previous', { exact: true })).toBeVisible({ timeout: 30_000 });
await expect(sidebar.getByText('just now').first()).toBeVisible();

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.

medium

Using the hardcoded string 'just now' here can cause flakiness if the page reload or preceding steps take longer than a minute in CI.\n\nUsing a regular expression matching both 'just now' and relative minute durations (as done on line 298) ensures consistency and robustness.

Suggested change
await expect(sidebar.getByText('just now').first()).toBeVisible();
await expect(sidebar.getByText(/^(just now|\d+m ago)$/).first()).toBeVisible();

@mergify

mergify Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Pre-commit checks failed

Hi @kevin314, the pre-commit checks have failed. To fix them locally:

# Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install

# Run all checks and auto-fix what's possible
pre-commit run --all-files

Common fixes:

  • yapf: yapf -i <file> (formatting)
  • ruff: ruff check --fix <file> (linting)
  • codespell: codespell --write-changes <file> (spelling)

After fixing, commit and push the changes. The checks will re-run automatically.

For future commits, pre-commit will run automatically on changed files before each commit.

Address review S1s on PR #1417:
- Use Object.defineProperty on Navigator.prototype for share/canShare
  stubs (direct assignment silently no-ops on Chromium/WebKit where
  navigator.share is a non-writable accessor).
- Replace exact-text 'just now' assertions with the regex pattern\n  already used at the third site; avoids minute-boundary flake on\n  slow CI runs.
@SolitaryThinker

Copy link
Copy Markdown
Collaborator

Both S1s from the prior review have been pushed.

  • S1.1 — navigator.share is now stubbed via Object.defineProperty on Navigator.prototype so it installs cleanly on Chromium/WebKit (the mobile-safari / mobile-chromium projects this PR adds). Also adds a canShare stub so the share branch is exercised deterministically.
  • S1.2 — The remaining two 'just now' literals now use the same /^(just now|\d+m ago)$/ regex already used at the third assertion site. No minute-boundary flake.

The S2 (msedge orphan in browser matrix) is unchanged — separate cleanup decision for the maintainer.

— Gob (@SolitaryThinker's AI reviewer, posting on his behalf)

@mergify

mergify Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Pre-commit checks failed

Hi @kevin314, the pre-commit checks have failed. To fix them locally:

# Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install

# Run all checks and auto-fix what's possible
pre-commit run --all-files

Common fixes:

  • yapf: yapf -i <file> (formatting)
  • ruff: ruff check --fix <file> (linting)
  • codespell: codespell --write-changes <file> (spelling)

After fixing, commit and push the changes. The checks will re-run automatically.

For future commits, pre-commit will run automatically on changed files before each commit.

@SolitaryThinker

Copy link
Copy Markdown
Collaborator

Hi @kevin314 — automated re-review from Gob, one of @SolitaryThinker's AI reviewers. Findings aren't all human-verified; ping @SolitaryThinker if anything looks off.

TL;DR

Both prior S1s are closed cleanly at 55cc0f7b44ed0a584d1880c3d1e7169efb7b9f11: navigator.share is now installed via Object.defineProperty(Navigator.prototype, 'share', {value, configurable, writable}) with a matching canShare stub, and all 'just now' literal assertions are replaced with the anchored /^(just now|\d+m ago)$/ regex. The S2 msedge browser-matrix orphan is intentionally deferred as an explicit followup. No new findings, no scope drift.

Verdict: approve-with-followup (was: ship-with-fixes)

  • S0 (blockers): 0
  • S1 (must-fix): 0
  • S2 (should-fix; surfaced if persistent or important): 0 net new (prior S2 deferred as followup)
  • S3 (discussion): not shown here; see archived review.md

Prior findings status

# Prior finding Status at 55cc0f7b Address commit Evidence (file:line)
S1.1 navigator.share direct assignment will throw on Chromium/WebKit ✅ closed 55cc0f7b apps/dreamverse/web/e2e/mock-backed-generation.spec.ts:65-74Object.defineProperty(Navigator.prototype, 'share', { value: stub, configurable: true, writable: true }) plus matching canShare block at line 70. Direct navigator.share = assignment fully removed (0 hits).
S1.2 'just now' exact-text assertions will flake near minute boundaries ✅ closed 55cc0f7b Same file, lines 259, 263, 300, 308 — all literal 'just now' assertion sites now use /^(just now|\d+m ago)$/ (or the loose hasText: /just now|\d+m ago/ form for the locator filter). 0 literal 'just now' hits remain.
S2 msedge orphan: in playwright.config.ts but absent from pr_test.py Modal CI invocation ⏸️ deferred (acceptable) n/a apps/dreamverse/web/playwright.config.ts:39 still declares msedge; fastvideo/tests/modal/pr_test.py:251,265-269 still only installs/invokes chromium webkit firefox mobile-safari mobile-chromium. Unchanged — explicit followup.

New findings

(none)


— Gob (@SolitaryThinker's AI reviewer). Full review (including the new-work audit and S3 items) is archived locally.

1 similar comment
@SolitaryThinker

Copy link
Copy Markdown
Collaborator

Hi @kevin314 — automated re-review from Gob, one of @SolitaryThinker's AI reviewers. Findings aren't all human-verified; ping @SolitaryThinker if anything looks off.

TL;DR

Both prior S1s are closed cleanly at 55cc0f7b44ed0a584d1880c3d1e7169efb7b9f11: navigator.share is now installed via Object.defineProperty(Navigator.prototype, 'share', {value, configurable, writable}) with a matching canShare stub, and all 'just now' literal assertions are replaced with the anchored /^(just now|\d+m ago)$/ regex. The S2 msedge browser-matrix orphan is intentionally deferred as an explicit followup. No new findings, no scope drift.

Verdict: approve-with-followup (was: ship-with-fixes)

  • S0 (blockers): 0
  • S1 (must-fix): 0
  • S2 (should-fix; surfaced if persistent or important): 0 net new (prior S2 deferred as followup)
  • S3 (discussion): not shown here; see archived review.md

Prior findings status

# Prior finding Status at 55cc0f7b Address commit Evidence (file:line)
S1.1 navigator.share direct assignment will throw on Chromium/WebKit ✅ closed 55cc0f7b apps/dreamverse/web/e2e/mock-backed-generation.spec.ts:65-74Object.defineProperty(Navigator.prototype, 'share', { value: stub, configurable: true, writable: true }) plus matching canShare block at line 70. Direct navigator.share = assignment fully removed (0 hits).
S1.2 'just now' exact-text assertions will flake near minute boundaries ✅ closed 55cc0f7b Same file, lines 259, 263, 300, 308 — all literal 'just now' assertion sites now use /^(just now|\d+m ago)$/ (or the loose hasText: /just now|\d+m ago/ form for the locator filter). 0 literal 'just now' hits remain.
S2 msedge orphan: in playwright.config.ts but absent from pr_test.py Modal CI invocation ⏸️ deferred (acceptable) n/a apps/dreamverse/web/playwright.config.ts:39 still declares msedge; fastvideo/tests/modal/pr_test.py:251,265-269 still only installs/invokes chromium webkit firefox mobile-safari mobile-chromium. Unchanged — explicit followup.

New findings

(none)


— Gob (@SolitaryThinker's AI reviewer). Full review (including the new-work audit and S3 items) is archived locally.

@SolitaryThinker

Copy link
Copy Markdown
Collaborator

/merge

@github-actions github-actions Bot added the ready PR is ready to merge label May 31, 2026
@mergify

mergify Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Pre-commit checks failed

Hi @kevin314, the pre-commit checks have failed. To fix them locally:

# Install pre-commit if you haven't already
uv pip install pre-commit
pre-commit install

# Run all checks and auto-fix what's possible
pre-commit run --all-files

Common fixes:

  • yapf: yapf -i <file> (formatting)
  • ruff: ruff check --fix <file> (linting)
  • codespell: codespell --write-changes <file> (spelling)

After fixing, commit and push the changes. The checks will re-run automatically.

For future commits, pre-commit will run automatically on changed files before each commit.

Pre-commit yapf (--all-files --hook-stage manual) flagged line-wrap
drift in two files outside PR #1417's diff. Bundling the minimal
reflow here so the PR's pre-commit gate goes green. No logic change.
@mergify mergify Bot added the scope: model Model architecture (DiTs, encoders, VAEs) label May 31, 2026
@SolitaryThinker
SolitaryThinker merged commit c2930b2 into main Jun 1, 2026
12 of 19 checks passed
@SolitaryThinker
SolitaryThinker deleted the klin/addt-dreamverse-tests branch June 1, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PR is ready to merge scope: infra CI, tests, Docker, build scope: model Model architecture (DiTs, encoders, VAEs) type: ci CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants