You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
assertAudioChanging has its expect assertion commented out, so the test does not fail when audio change is below threshold.
// Uncomment once the broadcast-mute testid attribute change is on prod// expect(// maxChange,// `Frames changed only ${(maxChange * 100).toFixed(2)}%, should exceed ${(MIN_AUDIO_DIFF * 100).toFixed(2)}%`,// ).toBeGreaterThan(MIN_AUDIO_DIFF);}
Latest suggestions up to d5e2795
Explore these optional code suggestions:
Category
Suggestion
Impact
Possible issue
Fail on missing audio stream
Instead of returning a sentinel on missing audio, fail fast so tests clearly indicate missing audio tracks. Throwing will immediately surface the absence of an audio stream.
-if (!stream || stream.getAudioTracks().length === 0) return -1;+if (!stream || stream.getAudioTracks().length === 0) {+ throw new Error("No audio tracks found on the video element");+}
Suggestion importance[1-10]: 7
__
Why: The test currently returns -1 silently when no audio tracks are found; throwing an error surfaces missing audio streams immediately and avoids false positives.
Medium
General
Close AudioContext after use
Close the AudioContext before returning to avoid leaking audio resources in the browser. This ensures the test doesn’t hold onto system audio handles.
Uncomment and provide the fake audio capture argument so that the browser uses a predictable audio source during E2E tests. Use a resolved path to ensure it works across environments.
Why: Reducing page.waitForTimeout lowers overall test duration and avoids excessively long idle waits.
Low
Possible issue
Throw on missing media stream
Fail the test immediately if no MediaStream is available inside the browser context instead of silently logging. Throwing an error in the page context bubbles up to the test runner.
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.
PR Type
Tests, Enhancement
Description
Add fake audio capture flag in Playwright config
Implement audio-diff assertion helper in common.ts
Integrate audio checks in video.spec.ts tests
Expose broadcast-mute test ID in component
Changes walkthrough 📝
playwright.config.ts
Enable fake audio capture option
apps/app-e2e/playwright.config.ts
--use-file-for-fake-audio-capture=./test-audio.wav
common.ts
Add audio diff assertion helper
apps/app-e2e/tests/common.ts
Page
and definedMIN_AUDIO_DIFF
assertAudioChanging
helper to measure audio diffvideo.spec.ts
Integrate audio checks and logger
apps/app-e2e/tests/video.spec.ts
assertAudioChanging
createTestLogger
for loggingbroadcast.tsx
Expose broadcast mute test ID
apps/app/components/playground/broadcast.tsx
data-testid="broadcast-mute"
to audio trigger