Skip to content

fix(e2e): update cloud-streaming test for graph-mode UI redesign#970

Closed
emranemran wants to merge 2 commits intomainfrom
fix/e2e-selectors-after-ui-redesign
Closed

fix(e2e): update cloud-streaming test for graph-mode UI redesign#970
emranemran wants to merge 2 commits intomainfrom
fix/e2e-selectors-after-ui-redesign

Conversation

@emranemran
Copy link
Copy Markdown
Contributor

Summary

The Workflow/Perform redesign (#886) broke the e2e test — the landing page no longer renders a `Daydream Scope` heading and its default view is the graph builder, not the streaming UI. The test has been silently failing since then.

Changes

  • Wait on the Perform-mode toggle being visible as the "page loaded" signal (stable across redesigns)
  • Explicitly switch to Perform mode before the cloud/pipeline/stream steps
  • Find the cloud button by `title` attribute (handles "Connect to cloud" / "Connecting to cloud..." / "Cloud connected")
  • Bump the cloud-connect wait to 180s so fal cold-starts have room
  • Verify frame flow by polling any playing `
  • Stop uses the start-stream-button toggle with a text-based fallback

Verified

Full flow passes against `scope-livepeer-emran` deploy with passthrough pipeline, ~3 min including fal cold-start.

```
✅ Cloud mode toggled on
✅ Cloud connection established
✅ Passthrough model selected
✅ Stream started
✅ Frames flowing
✅ Stream stopped
✅ Cloud streaming test passed
```

Test plan

  • `cd e2e && VITE_DAYDREAM_API_KEY=<sk_...> (cd ../frontend && npm run build)`
  • `SCOPE_CLOUD_MODE=livepeer SCOPE_CLOUD_APP_ID=<daydream/app/ws> SCOPE_CLOUD_API_KEY=<sk_...> uv run daydream-scope &`
  • `cd e2e && npx playwright test` → passes

🤖 Generated with Claude Code

The redesign in #886 replaced the streaming-first landing with a
Workflow/Perform toggle and removed the "Daydream Scope" heading the
test was polling for. The test has been dead since then.

Updates:
- Wait on the Perform-mode toggle appearing instead of the missing heading
- Explicitly switch to Perform mode before the cloud/pipeline/stream
  steps — default is now Workflow (graph mode) where those controls
  aren't rendered
- Find the cloud button by title attribute (covers all three states:
  "Connect to cloud", "Connecting to cloud...", "Cloud connected")
- Bump the cloud-connect timeout to 180s so fal cold-starts have room
- Verify frame flow by polling any <video> element rather than locating
  the old "Video Output" card wrapper
- Stop uses the start-stream-button toggle (PlayOverlay changes role
  when streaming) with a text-based fallback

Verified locally: full flow passes in ~3 minutes against a warm fal
deploy with the passthrough pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: emranemran <emran.mah@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0bf36b7-1c9a-457a-a6e6-ab828886794b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/e2e-selectors-after-ui-redesign

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-970--preview
WebSocket wss://fal.run/daydream/scope-pr-970--preview/ws
Commit 2527830

Livepeer Runner

App ID daydream/scope-livepeer-pr-970--preview
WebSocket wss://fal.run/daydream/scope-livepeer-pr-970--preview/ws
Auth private

Testing Livepeer Mode

SCOPE_CLOUD_MODE=livepeer SCOPE_CLOUD_APP_ID="daydream/scope-livepeer-pr-970--preview/ws" uv run daydream-scope

The previous iteration of this test false-positively passed. It polled
any <video> for playback, which always finds the local input preview
playing even when the browser↔local-scope WebRTC never completes and
no frames ever reach the cloud. The result: ClickHouse saw only
websocket_connected / pipeline_loaded / websocket_disconnected —
nothing that requires a real round-trip through the livepeer runner.

Two fixes:

1. Feed the browser a synthetic camera via
   --use-fake-device-for-media-stream (plus the Camera input toggle in
   the UI). This lets getUserMedia() succeed and a real WebRTC peer
   connection between browser and local scope complete end to end,
   which triggers CloudTrack._start() → LivepeerClient.start_media()
   and the "start_stream" trickle control message the runner needs.

2. Assert on the video inside the "Video Output" card, not any
   <video>. That element only renders when a remoteStream is set,
   so waiting on its visibility and currentTime > 0 is a true
   round-trip signal. After frames start flowing, idle 15s so
   stream_heartbeat events (~every 10s on the runner side) have
   a chance to fire.

Verified locally: test passes in ~2.8 min against scope-livepeer-emran
with passthrough. Full event set lands in ClickHouse when paired with
the parity PR (#969).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: emranemran <emran.mah@gmail.com>
emranemran added a commit that referenced this pull request Apr 20, 2026
Rewrite the testing-livepeer-fal-deploy SKILL so the primary
recommended path is the Playwright test (folded in from #970 via
cherry-pick). It's the only path that exercises the full livepeer
trickle round-trip and produces every session-lifecycle Kafka event.
Keep test-cloud-connect.sh as a secondary, bash-only smoke test for
"did the fal container come up?" / bisecting cloud-connect
regressions.

Also fix run-app.sh: the previous form tried to inline-prefix env
vars via ${VAR:+VAR=$VAR} on a backslash-continued command, which
breaks under bash word-splitting ("SCOPE_CLOUD_API_KEY=sk_... command
not found"). Switch to `export` + `exec uv run`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: emranemran <emran.mah@gmail.com>
@emranemran
Copy link
Copy Markdown
Contributor Author

Folded into #962 — the two Playwright commits were cherry-picked onto the tooling branch, and the skill was rewritten to lead with the Playwright path. Closing this PR as superseded. Branch fix/e2e-selectors-after-ui-redesign is kept as reference.

@emranemran emranemran closed this Apr 20, 2026
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