Make Playwright runs hermetic and fix stale race-hub specs

Six suite failures had rotted in: three race-hub specs targeted the
sub-tabbed Race Story UI deleted in the Phase 22 redesign, and the
command-center specs depended on the real OpenF1 calendar, whose focus
weekend drifted away from the seeded Monaco session as time passed.

The e2e/visual configs now point BOXBOX_OPENF1_BASE_URL (new override)
at an unreachable address so runs are hermetic and date-stable; the
race-hub specs were rewritten against the current RaceStoryCanvas UI,
and the one drifted mobile snapshot regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 00:48:07 -04:00
parent 7f0c338a57
commit 3c6115e815
7 changed files with 38 additions and 16 deletions

View File

@@ -17,24 +17,29 @@ test.describe('Race Hub Weekend Workspace', () => {
)
})
test('shows final classification when switching to Race Story', async ({ page }) => {
test('shows final running order when switching to Race Story', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await expect(page.getByText('Final Classification')).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'VER' })).toBeVisible()
await expect(page.locator('.drv-code', { hasText: 'HAM' })).toBeVisible()
const verRow = page.locator('.rs-driver-row', {
has: page.locator('.rs-driver-name', { hasText: 'VER' }),
})
const hamRow = page.locator('.rs-driver-row', {
has: page.locator('.rs-driver-name', { hasText: 'HAM' }),
})
await expect(verRow.locator('.rs-pos-col')).toHaveText('1')
await expect(hamRow.locator('.rs-pos-col')).toHaveText('2')
})
test('Race Story exposes classification, grid, and positions sub-views', async ({ page }) => {
test('Race Story renders the position evolution chart for a full session', async ({ page }) => {
await page.goto(`/race-hub?session_key=${FULL_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await page.getByRole('tab', { name: 'Starting Grid' }).click()
await expect(page.locator('.sec-title', { hasText: 'Starting Grid' })).toBeVisible()
await page.getByRole('tab', { name: 'Positions' }).click()
await expect(page.locator('[data-testid="position-chart"]')).toBeVisible()
await expect(
page.getByRole('img', { name: 'Position evolution chart' }),
).toBeVisible()
await expect(page.getByText('Lap-by-lap positions not available.')).not.toBeVisible()
})
test('strategy tab renders stint chart when stints are available', async ({ page }) => {
@@ -53,12 +58,11 @@ test.describe('Race Hub Weekend Workspace', () => {
await expect(page.locator('[data-testid="strategy-chart"]')).not.toBeVisible()
})
test('positions sub-view shows missing notice when positions are unavailable', async ({
test('Race Story shows missing notice when positions are unavailable', async ({
page,
}) => {
await page.goto(`/race-hub?session_key=${CORE_ONLY_SESSION}`)
await page.getByRole('tab', { name: 'Race Story' }).click()
await page.getByRole('tab', { name: 'Positions' }).click()
await expect(page.getByText('Lap-by-lap positions not available.')).toBeVisible()
await expect(page.locator('[data-testid="position-chart"]')).not.toBeVisible()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -19,6 +19,11 @@ export async function gotoCommandCenterReady(page: Page): Promise<void> {
await expect(page.getByTestId('command-center')).toBeVisible()
await expect(page.getByTestId('cc-focus')).toBeVisible()
await expect(page.getByTestId('cc-session-9472')).toBeVisible()
// The e2e stack runs with an unreachable OpenF1 base URL, so wait for the
// season-calendar query to settle on its local fallback before screenshotting.
await expect(
page.getByText('Using local meetings because the full calendar could not load.'),
).toBeVisible()
await waitForScreenshotReady(page)
}