freezmo/tests/run-all.mjs
Martin Dvorak a4c85ed77a Frutiger Aero: the theme now plays its soundtrack
Selecting Aero starts a random track from the Frutiger Aero playlist
(Bigblamboii's set on SoundCloud); every following track is drawn at random
too, so the set shuffles itself. The player is the credit bar from the mock:
a 44px glass circle with a note by default, expanding into pause + the
track's title + "SoundCloud - artist" (both reported by the widget).

- Only Aero ever touches SoundCloud: the embed and the widget API are created
  while the theme is on and the listener has not turned it off; light/dark
  request nothing (pinned by a suite check).
- The off choice persists (freezmo.aero-music.v1); re-selecting Aero in
  Settings is fresh consent (applyTheme clears it).
- Autoplay rides the theme-selection gesture; after a reload the circle comes
  up paused (browsers require a gesture) and one tap starts it.
- Volume 45; the iframe is 1px and inert, only the audio engine; the credit
  area collapses back to the circle without stopping the music.
- Geometry: clears the phone tab bar, lifts above the chat composer and the
  wizard bar, steps aside under immersive overlays and while the cookie
  notice shares the corner. 44px targets on phones.
- Cookie policy gained the third-party-embed paragraph it was owed.

tests/aero-music-test.mjs (16th suite, stubbed widget API, 21 checks). All
suites green, contrast scan clean. Version 0.7.0, SW v92.
2026-10-15 22:47:44 +00:00

50 lines
1.4 KiB
JavaScript

/**
* Runs every Freezmo browser suite in order.
*
* npm run test:e2e # everything
* npm run test:e2e -- phase1 # only suites whose name contains "phase1"
*
* Each suite is a standalone script that talks to the running app on :3207
* (FREEZMO_URL overrides). Suites that need a stub Ollama or extra server
* instance start their own on their own port and clean up after themselves.
*/
import { spawn } from "node:child_process";
import path from "node:path";
const SUITES = [
"regression",
"activities-test",
"aero-music-test",
"bubbles-test",
"mobile-test",
"wizard-test",
"native-test",
"i18n-test",
"freeze-loading-test",
"phase1-test",
"phase2-test",
"phase3-test",
"security-test",
"chat-test",
"providers-test",
"review-test",
];
const filters = process.argv.slice(2);
const list = filters.length ? SUITES.filter((name) => filters.some((f) => name.includes(f))) : SUITES;
const here = path.dirname(new URL(import.meta.url).pathname);
const repo = path.resolve(here, "..");
let failed = 0;
for (const suite of list) {
console.log(`\n===== ${suite} =====`);
const code = await new Promise((resolve) => {
const child = spawn(process.execPath, [path.join(here, `${suite}.mjs`)], { cwd: repo, stdio: "inherit" });
child.on("close", resolve);
});
if (code !== 0) failed += 1;
}
console.log(`\n${list.length - failed}/${list.length} suites passed`);
process.exit(failed ? 1 : 0);