Files
KoalaSync/tests/e2e/playwright.config.mjs
T
KoalaDev 36e1291d2c feat: rank player candidates by ordered signals, add browser E2E suite
The weighted score summed incomparable units, so size could outvote traits
that disqualify an element outright. Measured on a real page: a display:none
preload reports its full 1080p intrinsic size and scored 2073600, beating a
visible unmuted player at 509920.

Selection now compares an ordered list of signals, highest priority first:
has a source, is rendered, is not a silent background loop, rendered size
bucket, is playing, has controls, duration. Rendered size replaces intrinsic
resolution, and mute state is gone from the ranking entirely: it is a viewer
preference, not evidence about which element is the player.

It stays a ranking rather than a filter, so a page of only bad candidates
still yields one and findVideo never returns null where a video exists.

The new tests/e2e suite runs the shipped finder against real fixture pages
and drives the packed extension for injection, reinjection and remote
play/pause/seek into a first-party frame. All five scoring scenarios fail
against the previous implementation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 07:23:12 +02:00

35 lines
1.2 KiB
JavaScript

import { defineConfig } from '@playwright/test';
const PORT = Number(process.env.KOALA_E2E_PORT || 4173);
export default defineConfig({
testDir: '.',
testMatch: '**/*.spec.mjs',
// Extension tests drive a persistent context and a service worker; running
// them in parallel makes the profile directories fight each other.
workers: 1,
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 0,
reporter: process.env.CI ? 'list' : [['list']],
timeout: 30_000,
expect: { timeout: 10_000 },
use: {
baseURL: `http://localhost:${PORT}`,
trace: 'retain-on-failure',
launchOptions: {
// Several fixtures hinge on a video actually playing. Without this
// the browser's autoplay heuristics decide whether the fixture is
// valid, which shows up later as an unexplained flake.
args: ['--autoplay-policy=no-user-gesture-required']
}
},
webServer: {
command: `node ${new URL('./fixture-server.mjs', import.meta.url).pathname} ${PORT}`,
url: `http://localhost:${PORT}/pages/simple-player.html`,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe'
}
});