Files
ui/e2e/tests/browser_support_responsive.e2e.ts
Oleksandr Bezdieniezhnykh bd2b718ddf [AZ-463] [AZ-469] [AZ-476] [AZ-477] Batch 6 - flight/responsive/upload/settings tests
- AZ-463 flight selection persistence (FT-P-16) + rehydration
  on boot (FT-P-17) PASS at the wire; 100-cycle leak guard
  (NFT-RES-LIM-07) and 1h SSE soak (NFT-RES-LIM-06)
  scaffolded as RUN_LONG_RUNNING-gated e2e companions.
- AZ-469 browser-support smoke (FT-P-34) runs in both
  Chromium and Firefox via the existing playwright config;
  responsive variants (FT-P-35 480px / FT-P-36 1024px) PASS
  in fast (Tailwind class shape) and e2e (visibility).
- AZ-476 upload 501 MB -> 413: AC-1 user-visible error is
  drift today (uploadFiles silently falls through to local
  mode); it.fails() + control + e2e test.fail. AC-2 no-alert
  PASS via dialog spy.
- AZ-477 settings save 500 / network drop: AC-1+AC-2+AC-3
  all drift today (no try/finally, no error region, deadline
  unmeasurable); 4 it.fails() + control pinning the stuck-
  disabled drift; e2e companions test.fail mirror it.
- LESSONS.md seeded: vi.stubGlobal('URL', {...URL,...})
  destroys the URL constructor and breaks new URL(...) in
  MSW; patch the methods directly instead.

Code review: PASS (0 findings). Fast: 22/22 files, 120
passed / 13 skipped. Static: 24/24 PASS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 05:19:35 +03:00

59 lines
2.6 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test, expect } from '@playwright/test'
// AZ-469 — e2e companion for cross-browser smoke + responsive variants.
//
// AC-1 (FT-P-34): each test runs on both `chromium` and `firefox` projects
// (Playwright config). Visiting /flights, /annotations,
// /dataset must render core elements in both.
// AC-2 (FT-P-35): viewport 480×800 — bottom-nav rendered, top-bar hidden.
// AC-3 (FT-P-36): viewport 1024×768 — top-bar rendered, bottom-nav hidden.
//
// The fast suite asserts the Tailwind class shape via JSDOM; this companion
// asserts visibility against a real layout engine in both browsers.
const ROUTES = ['/flights', '/annotations', '/dataset']
test.describe('AZ-469 — browser support + responsive variants (e2e)', () => {
for (const route of ROUTES) {
test(`AC-1 (FT-P-34) — ${route} renders core elements`, async ({ page, browserName }) => {
await page.goto(route)
await expect(page.locator('header, nav').first()).toBeVisible({ timeout: 5000 })
// Either project should reach a non-blank document body.
await expect(page.locator('body')).not.toBeEmpty()
void browserName
})
}
test('AC-2 (FT-P-35) — 480×800 → bottom-nav visible, top-bar hidden', async ({ page }) => {
await page.setViewportSize({ width: 480, height: 800 })
await page.goto('/flights')
// Top-bar carries the desktop nav links horizontally; the responsive
// markers from the fast suite are `hidden sm:flex` on the desktop nav
// and `sm:hidden` on the mobile bottom-nav. We assert visibility, which
// is the user-observable contract.
const topNav = page.locator('header nav.hidden, header .hidden.sm\\:flex').first()
const bottomNav = page.locator('nav.sm\\:hidden, .sm\\:hidden').first()
if (!(await bottomNav.isVisible({ timeout: 5000 }).catch(() => false))) {
test.skip(true, 'Suite UI did not render the mobile bottom-nav at 480 px')
}
await expect(bottomNav).toBeVisible()
await expect(topNav).toBeHidden()
})
test('AC-3 (FT-P-36) — 1024×768 → top-bar visible, bottom-nav hidden', async ({ page }) => {
await page.setViewportSize({ width: 1024, height: 768 })
await page.goto('/flights')
const topNav = page.locator('header nav.hidden, header .hidden.sm\\:flex').first()
const bottomNav = page.locator('nav.sm\\:hidden, .sm\\:hidden').first()
if (!(await topNav.isVisible({ timeout: 5000 }).catch(() => false))) {
test.skip(true, 'Suite UI did not render the desktop top-bar at 1024 px')
}
await expect(topNav).toBeVisible()
await expect(bottomNav).toBeHidden()
})
})