[PR #7833] [MERGED] test(e2e): keep browser test runs silent #7957

Closed
opened 2026-10-24 04:09:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7833
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara

Base: staging ← Head: test/silent-e2e


📝 Commits (1)

  • 5c32039 test(e2e): keep browser test runs silent

📊 Changes

4 files changed (+146 additions, -6 deletions)

View changed files

➕ e2e/silent-test-audio.e2e.ts (+76 -0)
📝 e2e/ui-state-fixture.ts (+65 -2)
📝 playwright.config.ts (+3 -2)
📝 playwright.multiplayer.config.ts (+2 -2)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No issue was filed; @SpicyMarinara asked for this directly, after hearing the test apps through her speakers while agents ran Playwright. One can be opened if a tracking issue is wanted.

Why this change

  • Local browser test runs were audible. Headless WebKit (the mobile-webkit project) on macOS plays sound through the speakers, and every test reply set off the notification ping, since those sounds default on. Speech, music and game sound effects could play too.
  • Chromium projects already sent audio to a device nobody hears (--disable-audio-output). WebKit has no such switch, so the fix has to live in the shared test fixture.

What changed

  • Nothing changes in the app. This only affects browser tests.
  • seedUIState (in e2e/ui-state-fixture.ts, used by nearly every spec and by the shared game and production openers) now turns the three reply pings (Conversation, Roleplay, Game) off by default, like its existing surprise-visit and holiday-theme defaults. A spec that tests the pings still turns them on, as translation-notifications already does.
  • The first seedUIState call for a browser context also adds a script that runs before the app in every page of that context, including pages a test opens later:
    • The browser mutes every media element when it is played, starts loading, or has muted set. Reading muted still returns what the app or test set, so play(), its events and existing play() spies behave as before.
    • Web Audio reaches the speakers only through a gain of 0. Connecting to a live context's destination goes through one zero-gain node per context. The call still returns destination, and offline contexts are left alone.
  • Chromium projects launch with --mute-audio as well. playwright.production.config.ts inherits the base config's projects, so its runs get the flag too. playwright.multiplayer.config.ts adds it to its two Chromium projects. No Firefox projects exist.
  • New e2e/silent-test-audio.e2e.ts checks the following on every project:
    • A played <audio> and an autoplaying one are muted by the browser, while muted still reads false.
    • An oscillator wired like the ping reaches the speakers only through a gain of 0.
    • The pings start off, and a spec can turn one back on.
    • It cannot make noise even if the fixture breaks: the clip is the app's silent primer and the oscillator never starts.
  • Not done:
    • No speechSynthesis shim, because the client never calls speechSynthesis.
    • Element volume is left alone, since muted already silences the element and the app's volume reads and fades stay unchanged.
    • Specs that open a page without seedUIState (local-notifications, a few deliberately unseeded fresh contexts, the multiplayer guest view) are not covered on WebKit. None of them play audio.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run checks (for the reviewer to confirm, not ticked):

  • pnpm check exited 0. pnpm smoke:production (playwright.production.config.ts) passed on desktop-chromium.
  • e2e/silent-test-audio.e2e.ts passed on desktop-chromium, mobile-chromium and mobile-webkit. With the fixture's script registration disabled, it failed on desktop-chromium as expected: the browser had not muted the media and the app's gain node reached the speakers.
  • Audio-related specs on desktop-chromium, 37 passed and 1 skipped by design. These covered all of tts-mobile-playback, tts-pcm-settings, tts-request-timeout, scene-tts-preferences, translation-notifications, chat-window-intro and game-world-art. They also covered the TTS, voice, Music Player, sound-command, Soundtrack, VN speech, ambient and notification-position tests in core-flows, roleplay-commands, roleplay-vn, ux-feedback-sweep and chat-sweep.

Manual verification notes

  • Manually run a few audio specs on mobile-webkit on a Mac with the speakers on, such as pnpm exec playwright test e2e/translation-notifications.e2e.ts e2e/tts-mobile-playback.e2e.ts --project=mobile-webkit. Confirm nothing is heard and they pass.
  • Manually confirm that CI's three projects stay green with the new defaults.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable. This only changes test infrastructure.

Summary by CodeRabbit

  • Tests
    • Expanded automated checks for notification audio playback, browser muting, audio routing, and saved sound preferences across browser configurations. Added coverage to verify that notification sounds can be exercised in tests while remaining inaudible, and that seeded preferences reflect the expected sound settings.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7833 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `test/silent-e2e` --- ### 📝 Commits (1) - [`5c32039`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5c320391588ddfb3891baff75b034b03f4f4af7e) test(e2e): keep browser test runs silent ### 📊 Changes **4 files changed** (+146 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `e2e/silent-test-audio.e2e.ts` (+76 -0) 📝 `e2e/ui-state-fixture.ts` (+65 -2) 📝 `playwright.config.ts` (+3 -2) 📝 `playwright.multiplayer.config.ts` (+2 -2) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No issue was filed; @SpicyMarinara asked for this directly, after hearing the test apps through her speakers while agents ran Playwright. One can be opened if a tracking issue is wanted. ## Why this change - Local browser test runs were audible. Headless WebKit (the `mobile-webkit` project) on macOS plays sound through the speakers, and every test reply set off the notification ping, since those sounds default on. Speech, music and game sound effects could play too. - Chromium projects already sent audio to a device nobody hears (`--disable-audio-output`). WebKit has no such switch, so the fix has to live in the shared test fixture. ## What changed - Nothing changes in the app. This only affects browser tests. - `seedUIState` (in `e2e/ui-state-fixture.ts`, used by nearly every spec and by the shared game and production openers) now turns the three reply pings (Conversation, Roleplay, Game) off by default, like its existing surprise-visit and holiday-theme defaults. A spec that tests the pings still turns them on, as `translation-notifications` already does. - The first `seedUIState` call for a browser context also adds a script that runs before the app in every page of that context, including pages a test opens later: - The browser mutes every media element when it is played, starts loading, or has `muted` set. Reading `muted` still returns what the app or test set, so `play()`, its events and existing `play()` spies behave as before. - Web Audio reaches the speakers only through a gain of 0. Connecting to a live context's `destination` goes through one zero-gain node per context. The call still returns `destination`, and offline contexts are left alone. - Chromium projects launch with `--mute-audio` as well. `playwright.production.config.ts` inherits the base config's projects, so its runs get the flag too. `playwright.multiplayer.config.ts` adds it to its two Chromium projects. No Firefox projects exist. - New `e2e/silent-test-audio.e2e.ts` checks the following on every project: - A played `<audio>` and an autoplaying one are muted by the browser, while `muted` still reads `false`. - An oscillator wired like the ping reaches the speakers only through a gain of 0. - The pings start off, and a spec can turn one back on. - It cannot make noise even if the fixture breaks: the clip is the app's silent primer and the oscillator never starts. - Not done: - No `speechSynthesis` shim, because the client never calls `speechSynthesis`. - Element `volume` is left alone, since `muted` already silences the element and the app's volume reads and fades stay unchanged. - Specs that open a page without `seedUIState` (`local-notifications`, a few deliberately unseeded fresh contexts, the multiplayer guest view) are not covered on WebKit. None of them play audio. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run checks (for the reviewer to confirm, not ticked): - `pnpm check` exited 0. `pnpm smoke:production` (`playwright.production.config.ts`) passed on desktop-chromium. - `e2e/silent-test-audio.e2e.ts` passed on desktop-chromium, mobile-chromium and mobile-webkit. With the fixture's script registration disabled, it failed on desktop-chromium as expected: the browser had not muted the media and the app's gain node reached the speakers. - Audio-related specs on desktop-chromium, 37 passed and 1 skipped by design. These covered all of `tts-mobile-playback`, `tts-pcm-settings`, `tts-request-timeout`, `scene-tts-preferences`, `translation-notifications`, `chat-window-intro` and `game-world-art`. They also covered the TTS, voice, Music Player, sound-command, Soundtrack, VN speech, ambient and notification-position tests in `core-flows`, `roleplay-commands`, `roleplay-vn`, `ux-feedback-sweep` and `chat-sweep`. ### Manual verification notes - Manually run a few audio specs on `mobile-webkit` on a Mac with the speakers on, such as `pnpm exec playwright test e2e/translation-notifications.e2e.ts e2e/tts-mobile-playback.e2e.ts --project=mobile-webkit`. Confirm nothing is heard and they pass. - Manually confirm that CI's three projects stay green with the new defaults. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable. This only changes test infrastructure. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Expanded automated checks for notification audio playback, browser muting, audio routing, and saved sound preferences across browser configurations. Added coverage to verify that notification sounds can be exercised in tests while remaining inaudible, and that seeded preferences reflect the expected sound settings. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7957
No description provided.