20c19d15f4
Modern.js SSR intercepts all routes before any Express middleware, so the API proxy runs as a separate Express server on port 8080. Modern.js runs on 8081. The proxy uses curl subprocesses which go through the system HTTPS proxy (GOST) with a proper TLS fingerprint that the Aeroflot WAF accepts. Usage: node scripts/dev-server.mjs (replaces pnpm dev for full-stack) Also: remove stray e2e-angular test directory, fix env default to same-origin /api.
72 lines
2.8 KiB
TypeScript
72 lines
2.8 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('Navigation & Language (US-1, US-2) - React ru-ru', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('http://localhost:3002/ru-ru/onlineboard');
|
|
});
|
|
|
|
test('US-1: Tab navigation - switch between all tabs', async ({ page }) => {
|
|
// Verify Online Board tab is active
|
|
const onlineTab = page.locator('[data-testid="nav-onlineboard-tab"]');
|
|
await expect(onlineTab).toHaveClass(/active/);
|
|
|
|
// Click Schedule tab
|
|
const scheduleTab = page.locator('[data-testid="nav-schedule-tab"]');
|
|
await scheduleTab.click();
|
|
await expect(page).toHaveURL(/\/ru-ru\/schedule/);
|
|
await expect(scheduleTab).toHaveClass(/active/);
|
|
|
|
// Click Flights Map tab
|
|
const mapTab = page.locator('[data-testid="nav-flights-map-tab"]');
|
|
if (await mapTab.isVisible()) {
|
|
await mapTab.click();
|
|
await expect(page).toHaveURL(/\/ru-ru\/flights-map/);
|
|
await expect(mapTab).toHaveClass(/active/);
|
|
}
|
|
|
|
// Navigate back to Online Board
|
|
await onlineTab.click();
|
|
await expect(page).toHaveURL(/\/ru-ru\/onlineboard/);
|
|
await expect(onlineTab).toHaveClass(/active/);
|
|
});
|
|
|
|
test('US-2: Language switching - ru-ru to en-us to ru-ru', async ({ page }) => {
|
|
// Verify current language is Russian
|
|
await expect(page.locator('[data-testid="nav-onlineboard-tab"]')).toContainText('Онлайн-Табло');
|
|
|
|
// Click locale switcher dropdown
|
|
const switcher = page.locator('[data-testid="layout-locale-switcher"]');
|
|
await switcher.click();
|
|
|
|
// Select English (en-us)
|
|
await page.locator('text=English').first().click();
|
|
await expect(page).toHaveURL(/\/en-us\/onlineboard/);
|
|
|
|
// Verify UI is now in English
|
|
await expect(page.locator('[data-testid="nav-onlineboard-tab"]')).toContainText('Online Board');
|
|
|
|
// Click locale switcher dropdown again
|
|
await switcher.click();
|
|
|
|
// Switch back to Russian
|
|
await page.locator('text=Русский').first().click();
|
|
await expect(page).toHaveURL(/\/ru-ru\/onlineboard/);
|
|
await expect(page.locator('[data-testid="nav-onlineboard-tab"]')).toContainText('Онлайн-Табло');
|
|
});
|
|
|
|
test('US-2: Language switching - preserve page context', async ({ page }) => {
|
|
// Navigate to Schedule
|
|
await page.locator('[data-testid="nav-schedule-tab"]').click();
|
|
await expect(page).toHaveURL(/\/ru-ru\/schedule/);
|
|
|
|
// Switch to English via dropdown
|
|
const switcher = page.locator('[data-testid="layout-locale-switcher"]');
|
|
await switcher.click();
|
|
await page.locator('text=English').first().click();
|
|
|
|
// Should still be on Schedule page (not Online Board)
|
|
await expect(page).toHaveURL(/\/en-us\/schedule/);
|
|
await expect(page.locator('[data-testid="nav-schedule-tab"]')).toContainText('Schedule');
|
|
});
|
|
});
|