From 5046b0c00316dde087d5a16e2c81cd46835c50f4 Mon Sep 17 00:00:00 2001 From: Rahim Date: Mon, 5 Oct 2026 21:14:40 -0700 Subject: [PATCH 1/2] test(skin): run the compat skin at older browser minimums Compat sets its own colors with plain values, so it doesn't need the oklch() and color-mix() support that sets Chrome 111 and Firefox 121 for the other skins. Add a root compatBrowserslist with Chrome and Edge 99 and Firefox 103, generate Compat pages, and run them on BrowserStack at those versions. Chrome 99 is the first with @layer. Firefox 103 is the oldest build BrowserStack can drive with the current Playwright client. Safari and iOS keep one shared minimum, and the config fails if the two queries split there. Compat hides its center play button without container queries, so the checks click whichever play button is visible. Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/e2e/scripts/generate-pages.ts | 61 +++++-- apps/e2e/suites/browserstack/README.md | 2 +- .../suites/browserstack/playwright.config.ts | 54 +++++- apps/e2e/suites/browserstack/probes.ts | 20 ++- apps/e2e/suites/browserstack/test.ts | 6 + .../browserstack/tests/compatibility.spec.ts | 156 +++++++++--------- apps/e2e/suites/browserstack/versions.ts | 48 ++++-- package.json | 13 +- 8 files changed, 247 insertions(+), 113 deletions(-) diff --git a/apps/e2e/scripts/generate-pages.ts b/apps/e2e/scripts/generate-pages.ts index d632f862b9..79efae440c 100644 --- a/apps/e2e/scripts/generate-pages.ts +++ b/apps/e2e/scripts/generate-pages.ts @@ -154,19 +154,24 @@ interface PageDef { resource: string; category?: 'cdn' | 'captions' | 'background' | 'background-preset' | 'source-html' | 'source-react'; /** The packaged skin theme; the default skin unless set. */ - skin?: 'neutral'; + skin?: 'neutral' | 'compat'; } type SkinTheme = NonNullable | 'default'; /** The custom element a packaged HTML skin registers. */ function htmlSkinTag(media: 'video' | 'audio', skin: SkinTheme): string { - return skin === 'neutral' ? `${media}-neutral-skin` : `${media}-skin`; + return skin === 'default' ? `${media}-skin` : `${media}-${skin}-skin`; } /** The entry a packaged skin ships under for both frameworks, as `video/skin` or `video/neutral-skin`. */ function skinEntry(media: 'video' | 'audio', skin: SkinTheme): string { - return skin === 'neutral' ? `${media}/neutral-skin` : `${media}/skin`; + return skin === 'default' ? `${media}/skin` : `${media}/${skin}-skin`; +} + +/** The React component a packaged skin exports, as `VideoSkin` or `NeutralVideoSkin`. */ +function reactSkinComponent(media: 'Video' | 'Audio', skin: SkinTheme): string { + return skin === 'default' ? `${media}Skin` : `${skin[0]!.toUpperCase()}${skin.slice(1)}${media}Skin`; } // --------------------------------------------------------------------------- @@ -249,12 +254,12 @@ function reactVideoPage(media: string, resource: string, config: MediaTypeConfig if (!reactMedia) throw new Error(`No React component mapping for media type: ${media}`); const isDefaultVideo = media === 'video'; - const Skin = skin === 'neutral' ? 'NeutralVideoSkin' : 'VideoSkin'; + const Skin = reactSkinComponent('Video', skin); const skinImport = - skin === 'neutral' ? `\nimport { NeutralVideoSkin } from '@videojs/react/video/neutral-skin';` : ''; + skin === 'default' ? '' : `\nimport { ${Skin} } from '@videojs/react/${skinEntry('video', skin)}';`; const mediaImport = isDefaultVideo - ? `import { Video, VideoPlayer${skin === 'neutral' ? '' : ', VideoSkin'} } from '@videojs/react/video';${skinImport}` - : `import { ${reactMedia.component} } from '${reactMedia.importPath}';\nimport { VideoPlayer${skin === 'neutral' ? '' : ', VideoSkin'} } from '@videojs/react/video';${skinImport}`; + ? `import { Video, VideoPlayer${skin === 'default' ? ', VideoSkin' : ''} } from '@videojs/react/video';${skinImport}` + : `import { ${reactMedia.component} } from '${reactMedia.importPath}';\nimport { VideoPlayer${skin === 'default' ? ', VideoSkin' : ''} } from '@videojs/react/video';${skinImport}`; const posterProp = config.hasPoster && resourceHasPoster(resource) ? ` poster={MEDIA.${resource}.poster}` : ''; const storyboardTrack = config.hasStoryboard @@ -286,12 +291,12 @@ function reactAudioPage(media: string, resource: string, skin: SkinTheme): strin if (!reactMedia) throw new Error(`No React component mapping for media type: ${media}`); const isDefaultAudio = media === 'audio'; - const Skin = skin === 'neutral' ? 'NeutralAudioSkin' : 'AudioSkin'; + const Skin = reactSkinComponent('Audio', skin); const skinImport = - skin === 'neutral' ? `\nimport { NeutralAudioSkin } from '@videojs/react/audio/neutral-skin';` : ''; + skin === 'default' ? '' : `\nimport { ${Skin} } from '@videojs/react/${skinEntry('audio', skin)}';`; const mediaImport = isDefaultAudio - ? `import { Audio, AudioPlayer${skin === 'neutral' ? '' : ', AudioSkin'} } from '@videojs/react/audio';${skinImport}` - : `import { ${reactMedia.component} } from '${reactMedia.importPath}';\nimport { AudioPlayer${skin === 'neutral' ? '' : ', AudioSkin'} } from '@videojs/react/audio';${skinImport}`; + ? `import { Audio, AudioPlayer${skin === 'default' ? ', AudioSkin' : ''} } from '@videojs/react/audio';${skinImport}` + : `import { ${reactMedia.component} } from '${reactMedia.importPath}';\nimport { AudioPlayer${skin === 'default' ? ', AudioSkin' : ''} } from '@videojs/react/audio';${skinImport}`; return `${mediaImport} import '@videojs/react/${skinEntry('audio', skin)}.css'; @@ -641,6 +646,40 @@ const PAGES: PageDef[] = [ skin: 'neutral', }, + // Compat skins, for the browser compatibility checks + { + name: 'HTML Video Compat MP4', + path: 'html-video-compat-mp4', + framework: 'html', + media: 'video', + resource: 'mp4', + skin: 'compat', + }, + { + name: 'HTML Audio Compat MP4', + path: 'html-audio-compat-mp4', + framework: 'html', + media: 'audio', + resource: 'mp4', + skin: 'compat', + }, + { + name: 'React Video Compat MP4', + path: 'react-video-compat-mp4', + framework: 'react', + media: 'video', + resource: 'mp4', + skin: 'compat', + }, + { + name: 'React Audio Compat MP4', + path: 'react-audio-compat-mp4', + framework: 'react', + media: 'audio', + resource: 'mp4', + skin: 'compat', + }, + // CDN { name: 'CDN Video MP4', path: 'cdn-video-mp4', framework: 'html', media: 'video', resource: 'mp4', category: 'cdn' }, { diff --git a/apps/e2e/suites/browserstack/README.md b/apps/e2e/suites/browserstack/README.md index 9e4abf0f26..2569f233f4 100644 --- a/apps/e2e/suites/browserstack/README.md +++ b/apps/e2e/suites/browserstack/README.md @@ -1,6 +1,6 @@ # BrowserStack compatibility checks -Run the packaged HTML and React video, neutral video, and audio pages at the Chrome, Edge, Firefox, and Safari minimums resolved from the root browserslist. Desktop Safari coverage uses WebKit. The checks cover CSS fallbacks, closed popovers, playback, seeking, and opening menus. Playback failure is a test failure, including missing H.264 support. +Run the packaged HTML and React video, neutral video, and audio pages at the Chrome, Edge, Firefox, and Safari minimums resolved from the root browserslist. The Compat video and audio pages run at the older Chrome, Edge, and Firefox minimums in the root `compatBrowserslist`, and at the shared Safari and iOS minimums. Desktop Safari coverage uses WebKit. The checks cover CSS fallbacks, closed popovers, playback, seeking, and opening menus. Playback failure is a test failure, including missing H.264 support. This suite replaces the previous Docker floor job and its pinned Playwright clients. BrowserStack's desktop WebKit is still an engine approximation, not actual Safari. The iOS project runs Safari on a real device selected from BrowserStack's device API. BrowserStack selects iOS by major version, so the browserslist minimum is rounded up to the next whole major: iOS 17 for the current 16.4 minimum. This keeps real-device coverage within the supported range, while desktop WebKit retains the 16.4 minimum check. Selection uses a stable ordering of matching iPhones and fails if no matching device is available; the user-agent assertion verifies the selected major version. The suite does not currently verify captions or fullscreen. diff --git a/apps/e2e/suites/browserstack/playwright.config.ts b/apps/e2e/suites/browserstack/playwright.config.ts index 80b2d58f79..1d9483faad 100644 --- a/apps/e2e/suites/browserstack/playwright.config.ts +++ b/apps/e2e/suites/browserstack/playwright.config.ts @@ -4,7 +4,12 @@ import { defineConfig } from '@playwright/test'; import { suiteConfig, WEB_SERVER_SHUTDOWN } from '../../shared/playwright.ts'; import type { Options } from './test.ts'; -import { versions } from './versions.ts'; +import { compatVersions, versions } from './versions.ts'; + +// The WebKit and iOS projects run every skin, which holds only while both queries share their minimums. +if (compatVersions.safari !== versions.safari || compatVersions.ios !== versions.ios) { + throw new Error('Compat has its own Safari or iOS minimum; add Compat WebKit and iOS projects.'); +} export default defineConfig<{}, Options>({ ...suiteConfig('browserstack'), @@ -30,11 +35,19 @@ export default defineConfig<{}, Options>({ : [ { name: `chrome-${versions.chrome}`, - use: { caps: { browser: 'chrome', browser_version: versions.chrome, os: 'Windows', os_version: '10' } }, + use: { + caps: { browser: 'chrome', browser_version: versions.chrome, os: 'Windows', os_version: '10' }, + version: versions.chrome, + skins: ['default', 'neutral'], + }, }, { name: `edge-${versions.edge}`, - use: { caps: { browser: 'edge', browser_version: versions.edge, os: 'Windows', os_version: '10' } }, + use: { + caps: { browser: 'edge', browser_version: versions.edge, os: 'Windows', os_version: '10' }, + version: versions.edge, + skins: ['default', 'neutral'], + }, }, // Bundled engines require a Playwright release; version checks reject any drift from browserslist. { @@ -46,6 +59,39 @@ export default defineConfig<{}, Options>({ os_version: '10', 'browserstack.playwrightVersion': '1.41.2', }, + version: versions.firefox, + skins: ['default', 'neutral'], + }, + }, + // Compat supports older Chrome, Edge, and Firefox than the other skins; Safari and iOS share one minimum. + { + name: `compat-chrome-${compatVersions.chrome}`, + use: { + caps: { browser: 'chrome', browser_version: compatVersions.chrome, os: 'Windows', os_version: '10' }, + version: compatVersions.chrome, + skins: ['compat'], + }, + }, + { + name: `compat-edge-${compatVersions.edge}`, + use: { + caps: { browser: 'edge', browser_version: compatVersions.edge, os: 'Windows', os_version: '10' }, + version: compatVersions.edge, + skins: ['compat'], + }, + }, + { + name: `compat-firefox-${compatVersions.firefox}`, + use: { + caps: { + browser: 'playwright-firefox', + os: 'Windows', + os_version: '10', + // The oldest release BrowserStack can drive with the current client; older ones fail to create a context. + 'browserstack.playwrightVersion': '1.25.2', + }, + version: compatVersions.firefox, + skins: ['compat'], }, }, { @@ -57,12 +103,14 @@ export default defineConfig<{}, Options>({ os_version: 'Big Sur', 'browserstack.playwrightVersion': '1.35.0', }, + version: versions.safari, }, }, { name: `ios-safari-${versions.ios}`, use: { caps: { browser: 'safari', osVersion: versions.ios, realMobile: 'true' }, + version: versions.ios, // BrowserStack iOS requires an explicit viewport object. viewport: { width: 390, height: 844 }, }, diff --git a/apps/e2e/suites/browserstack/probes.ts b/apps/e2e/suites/browserstack/probes.ts index ca09117f11..7c080d80c7 100644 --- a/apps/e2e/suites/browserstack/probes.ts +++ b/apps/e2e/suites/browserstack/probes.ts @@ -1,15 +1,20 @@ interface Page { readonly path: string; readonly preset: 'video' | 'audio'; + readonly skin: 'default' | 'neutral' | 'compat'; } export const PAGES: readonly Page[] = [ - { path: '/pages/html-video-mp4.html', preset: 'video' }, - { path: '/pages/react-video-mp4.html', preset: 'video' }, - { path: '/pages/html-video-neutral-mp4.html', preset: 'video' }, - { path: '/pages/react-video-neutral-mp4.html', preset: 'video' }, - { path: '/pages/html-audio-mp4.html', preset: 'audio' }, - { path: '/pages/react-audio-mp4.html', preset: 'audio' }, + { path: '/pages/html-video-mp4.html', preset: 'video', skin: 'default' }, + { path: '/pages/react-video-mp4.html', preset: 'video', skin: 'default' }, + { path: '/pages/html-video-neutral-mp4.html', preset: 'video', skin: 'neutral' }, + { path: '/pages/react-video-neutral-mp4.html', preset: 'video', skin: 'neutral' }, + { path: '/pages/html-audio-mp4.html', preset: 'audio', skin: 'default' }, + { path: '/pages/react-audio-mp4.html', preset: 'audio', skin: 'default' }, + { path: '/pages/html-video-compat-mp4.html', preset: 'video', skin: 'compat' }, + { path: '/pages/react-video-compat-mp4.html', preset: 'video', skin: 'compat' }, + { path: '/pages/html-audio-compat-mp4.html', preset: 'audio', skin: 'compat' }, + { path: '/pages/react-audio-compat-mp4.html', preset: 'audio', skin: 'compat' }, ]; /** Values read from the page. Each is a computed style, so an invalid or missing fallback shows as its initial value. */ @@ -44,7 +49,8 @@ export function readProbe(query: typeof deepQuery): Probe | null { if (!skin) return null; const backdrop = query(document, '.video-controls-backdrop'); - const buffer = query(document, '.media-slider-buffer'); + // Compat names its time slider parts after the time slider. + const buffer = query(document, '.media-slider-buffer, .media-time-slider-buffer'); const surfaces: Element[] = []; const blurRoots: (Document | ShadowRoot)[] = [document]; diff --git a/apps/e2e/suites/browserstack/test.ts b/apps/e2e/suites/browserstack/test.ts index 33ee4f1544..d651ea11c7 100644 --- a/apps/e2e/suites/browserstack/test.ts +++ b/apps/e2e/suites/browserstack/test.ts @@ -5,10 +5,16 @@ import { getIosDevice } from './ios-device.ts'; export interface Options { caps: Record; + /** The browser version the project must launch, checked against the user agent. */ + version: string; + /** The skins whose pages the project runs. */ + skins: readonly string[]; } export const test = base.extend<{ session: Browser }, Options>({ caps: [{}, { option: true, scope: 'worker' }], + version: ['', { option: true, scope: 'worker' }], + skins: [['default', 'neutral', 'compat'], { option: true, scope: 'worker' }], context: async ({ session: browser, baseURL, viewport, actionTimeout }, use) => { const options: BrowserContextOptions = { viewport }; diff --git a/apps/e2e/suites/browserstack/tests/compatibility.spec.ts b/apps/e2e/suites/browserstack/tests/compatibility.spec.ts index 120e9eca30..b3e61e8ddb 100644 --- a/apps/e2e/suites/browserstack/tests/compatibility.spec.ts +++ b/apps/e2e/suites/browserstack/tests/compatibility.spec.ts @@ -1,100 +1,108 @@ import { PlayerPage } from '../../../shared/page-objects/player'; import { deepQuery, PAGES, readProbe } from '../probes.ts'; import { expect, test } from '../test.ts'; -import { versions } from '../versions.ts'; for (const target of PAGES) { - test(`${target.path}: skin fallbacks and playback`, async ({ page, caps }, testInfo) => { - const errors: string[] = []; + test.describe(() => { + // Evaluated before the session fixture, so skipped pages open no remote session. + test.skip(({ skins }) => !skins.includes(target.skin), `this project does not cover the ${target.skin} skin`); - page.on('pageerror', (error) => errors.push(error.message)); + test(`${target.path}: skin fallbacks and playback`, async ({ page, caps, version }, testInfo) => { + const errors: string[] = []; - const player = new PlayerPage(page); + page.on('pageerror', (error) => errors.push(error.message)); - await page.goto(target.path, { timeout: 60_000 }); + const player = new PlayerPage(page); - const userAgent = await page.evaluate(() => navigator.userAgent); + await page.goto(target.path, { timeout: 60_000 }); - await testInfo.attach('browser', { body: userAgent, contentType: 'text/plain' }); + const userAgent = await page.evaluate(() => navigator.userAgent); - if (caps.browser === 'chrome') expect(userAgent).toContain(`Chrome/${versions.chrome}.`); + await testInfo.attach('browser', { body: userAgent, contentType: 'text/plain' }); - if (caps.browser === 'edge') expect(userAgent).toContain(`Edg/${versions.edge}.`); + if (caps.browser === 'chrome') expect(userAgent).toContain(`Chrome/${version}.`); - if (caps.browser === 'playwright-firefox') expect(userAgent).toContain(`Firefox/${versions.firefox}.`); + if (caps.browser === 'edge') expect(userAgent).toContain(`Edg/${version}.`); - if (caps.browser === 'playwright-webkit') expect(userAgent).toContain(`Version/${versions.safari}`); + if (caps.browser === 'playwright-firefox') expect(userAgent).toContain(`Firefox/${version}.`); - if (caps.realMobile) { - const session: { os_version: string; browser_version: string; device: string } = JSON.parse( - await page.evaluate(() => '', 'browserstack_executor: {"action":"getSessionDetails"}') - ); - - await testInfo.attach('device', { - body: JSON.stringify({ os: session.os_version, browser: session.browser_version, device: session.device }), - contentType: 'application/json', - }); - - expect(userAgent).toContain(`OS ${versions.ios.replaceAll('.', '_')}`); - } + if (caps.browser === 'playwright-webkit') expect(userAgent).toContain(`Version/${version}`); - await player.waitForMediaReady(); - - // Real-device execution needs an explicit return instead of a bare expression string. - await expect - .poll(async () => { - const probe = await page.evaluate, string>( - (source) => new Function(`return ${source}`)(), - `(${readProbe.toString()})(${deepQuery.toString()})` + if (caps.realMobile) { + const session: { os_version: string; browser_version: string; device: string } = JSON.parse( + await page.evaluate(() => '', 'browserstack_executor: {"action":"getSessionDetails"}') ); - return probe?.styled; - }) - .toBe(true); - - const probe = await page.evaluate, string>( - (source) => new Function(`return ${source}`)(), - `(${readProbe.toString()})(${deepQuery.toString()})` - ); + await testInfo.attach('device', { + body: JSON.stringify({ os: session.os_version, browser: session.browser_version, device: session.device }), + contentType: 'application/json', + }); - expect(probe).not.toBeNull(); + expect(userAgent).toContain(`OS ${version.replaceAll('.', '_')}`); + } - if (!probe) throw new Error('The skin root did not settle.'); + await player.waitForMediaReady(); - expect(probe.visibleClosedPopovers).toBe(0); - expect(probe.bufferRight).not.toBeNull(); - expect(probe.bufferRight).not.toBe('auto'); - expect( - target.preset === 'audio' ? ['rgb(255, 255, 255)', 'oklch(1 0 0)'] : ['rgb(0, 0, 0)', 'oklch(0 0 0)'] - ).toContain(probe.primaryForeground); + // Real-device execution needs an explicit return instead of a bare expression string. + await expect + .poll(async () => { + const probe = await page.evaluate, string>( + (source) => new Function(`return ${source}`)(), + `(${readProbe.toString()})(${deepQuery.toString()})` + ); - if (target.preset === 'video') { - expect(probe.scrim).toContain('gradient'); - expect(probe.frameBorder).not.toBe('rgb(255, 0, 0)'); + return probe?.styled; + }) + .toBe(true); - if (!target.path.includes('neutral')) expect(probe.surfaceBlur).toContain('blur'); - } - - // Unsupported H.264 or rejected playback must fail here. - await player.play(); - await player.waitForPlayback(0.5); - await player.playButton.dispatchEvent('click'); - // Poll the value directly: WebKit's pinned server lacks the newer attribute-value matcher. - await expect.poll(() => player.playButton.getAttribute('data-paused'), { timeout: 5_000 }).toBe(''); - await player.seekTo(25); - expect(await player.getCurrentTime()).toBeGreaterThan(1); - - if (target.preset === 'audio') await page.addStyleTag({ content: 'body { padding-top: 320px; }' }); - - await player.playerRoot.dispatchEvent('pointermove', { pointerType: 'mouse' }); - - if (target.preset === 'video') { - await expect.poll(() => player.controls.getAttribute('data-visible')).toBe(''); - } + const probe = await page.evaluate, string>( + (source) => new Function(`return ${source}`)(), + `(${readProbe.toString()})(${deepQuery.toString()})` + ); - await page.locator('[aria-haspopup="menu"]').first().click(); - await expect(page.locator('[role="menu"][data-open]').first()).toBeVisible(); - await page.screenshot({ path: testInfo.outputPath('menu.png') }); - expect(errors).toEqual([]); + expect(probe).not.toBeNull(); + + if (!probe) throw new Error('The skin root did not settle.'); + + expect(probe.visibleClosedPopovers).toBe(0); + expect(probe.bufferRight).not.toBeNull(); + expect(probe.bufferRight).not.toBe('auto'); + expect( + target.preset === 'audio' ? ['rgb(255, 255, 255)', 'oklch(1 0 0)'] : ['rgb(0, 0, 0)', 'oklch(0 0 0)'] + ).toContain(probe.primaryForeground); + + if (target.preset === 'video') { + expect(probe.scrim).toContain('gradient'); + expect(probe.frameBorder).not.toBe('rgb(255, 0, 0)'); + + if (target.skin === 'default') expect(probe.surfaceBlur).toContain('blur'); + } + + // Unsupported H.264 or rejected playback must fail here. + // Compat hides its center play button without container queries, so click whichever play button is visible. + // The `:visible` pseudo-class also works on the older Playwright servers the bundled engines run on. + await page.locator('media-play-button:visible, .media-play-button:visible').first().click(); + await expect.poll(() => player.playButton.getAttribute('data-paused'), { timeout: 5_000 }).toBeNull(); + await player.waitForPlayback(0.5); + await player.playButton.dispatchEvent('click'); + // Poll the value directly: WebKit's pinned server lacks the newer attribute-value matcher. + await expect.poll(() => player.playButton.getAttribute('data-paused'), { timeout: 5_000 }).toBe(''); + await player.seekTo(25); + expect(await player.getCurrentTime()).toBeGreaterThan(1); + + if (target.preset === 'audio') await page.addStyleTag({ content: 'body { padding-top: 320px; }' }); + + await player.playerRoot.dispatchEvent('pointermove', { pointerType: 'mouse' }); + + if (target.preset === 'video') { + // The container's attribute is shared by every skin; the controls element differs between them. + await expect.poll(() => player.playerRoot.getAttribute('data-controls-visible')).toBe(''); + } + + await page.locator('[aria-haspopup="menu"]').first().click(); + await expect(page.locator('[role="menu"][data-open]').first()).toBeVisible(); + await page.screenshot({ path: testInfo.outputPath('menu.png') }); + expect(errors).toEqual([]); + }); }); } diff --git a/apps/e2e/suites/browserstack/versions.ts b/apps/e2e/suites/browserstack/versions.ts index f8491c3316..a9980087b6 100644 --- a/apps/e2e/suites/browserstack/versions.ts +++ b/apps/e2e/suites/browserstack/versions.ts @@ -2,23 +2,39 @@ import browserslist from 'browserslist'; import rootPackage from '../../../../package.json' with { type: 'json' }; -const browsers = browserslist(rootPackage.browserslist); +export interface Versions { + chrome: string; + edge: string; + firefox: string; + safari: string; + ios: string; +} + +function resolveVersions(query: readonly string[]): Versions { + const browsers = browserslist([...query]); -function minimum(name: string): string { - const version = browsers - .filter((entry) => entry.startsWith(`${name} `)) - .map((entry) => entry.slice(name.length + 1).split('-')[0]!) - .sort((a, b) => a.localeCompare(b, undefined, { numeric: true }))[0]; - if (!version) throw new Error(`The root browserslist has no supported ${name} version.`); + function minimum(name: string): string { + const version = browsers + .filter((entry) => entry.startsWith(`${name} `)) + .map((entry) => entry.slice(name.length + 1).split('-')[0]!) + .sort((a, b) => a.localeCompare(b, undefined, { numeric: true }))[0]; + if (!version) throw new Error(`The browserslist query has no supported ${name} version.`); - return version; + return version; + } + + return { + chrome: minimum('chrome'), + edge: minimum('edge'), + firefox: minimum('firefox'), + safari: minimum('safari'), + // BrowserStack selects iOS by major version; round up to stay within the supported range. + ios: String(Math.ceil(Number(minimum('ios_saf')))), + }; } -export const versions = { - chrome: minimum('chrome'), - edge: minimum('edge'), - firefox: minimum('firefox'), - safari: minimum('safari'), - // BrowserStack selects iOS by major version; round up to stay within the supported range. - ios: String(Math.ceil(Number(minimum('ios_saf')))), -}; +/** Minimums for every skin, from the root `browserslist`. */ +export const versions = resolveVersions(rootPackage.browserslist); + +/** Minimums for the Compat skins, from the root `compatBrowserslist`. */ +export const compatVersions = resolveVersions(rootPackage.compatBrowserslist); diff --git a/package.json b/package.json index b896de818e..5e987333e7 100644 --- a/package.json +++ b/package.json @@ -83,5 +83,16 @@ "node": ">=22.19.0", "npm": ">=10.9.3" }, - "packageManager": "pnpm@12.6.0" + "packageManager": "pnpm@12.6.0", + "compatBrowserslist": [ + "chrome >= 99", + "edge >= 99", + "firefox >= 103", + "safari >= 16.4", + "ios_saf >= 16.4", + "and_chr >= 99", + "and_ff >= 103", + "samsung >= 18", + "opera >= 85" + ] } From c43bb9f3327297dd7bbaafe8ce4eb3519d5461fc Mon Sep 17 00:00:00 2001 From: Rahim Date: Mon, 5 Oct 2026 21:21:37 -0700 Subject: [PATCH 2/2] test(skin): read the play state on every browserstack engine Real-device iOS throws for a missing attribute where other engines return null, and Firefox's pinned server lacks the attribute matcher. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../suites/browserstack/tests/compatibility.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/e2e/suites/browserstack/tests/compatibility.spec.ts b/apps/e2e/suites/browserstack/tests/compatibility.spec.ts index b3e61e8ddb..97f5217fcd 100644 --- a/apps/e2e/suites/browserstack/tests/compatibility.spec.ts +++ b/apps/e2e/suites/browserstack/tests/compatibility.spec.ts @@ -82,7 +82,18 @@ for (const target of PAGES) { // Compat hides its center play button without container queries, so click whichever play button is visible. // The `:visible` pseudo-class also works on the older Playwright servers the bundled engines run on. await page.locator('media-play-button:visible, .media-play-button:visible').first().click(); - await expect.poll(() => player.playButton.getAttribute('data-paused'), { timeout: 5_000 }).toBeNull(); + // Firefox's pinned server lacks the attribute matcher, and real-device iOS throws for a missing attribute. + await expect + .poll( + () => + player.playButton.getAttribute('data-paused').catch((error: Error) => { + if (error.message.includes(`Attribute 'data-paused' not found`)) return null; + + throw error; + }), + { timeout: 5_000 } + ) + .toBeNull(); await player.waitForPlayback(0.5); await player.playButton.dispatchEvent('click'); // Poll the value directly: WebKit's pinned server lacks the newer attribute-value matcher.