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.1 KiB
TypeScript
72 lines
2.1 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
test.describe('US-102: Browser History Navigation', () => {
|
|
const BASE_URL = 'http://localhost:3001';
|
|
|
|
test('should update URL when search form changes', async ({ page }) => {
|
|
await page.goto(`${BASE_URL}/ru-ru/schedule`);
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// Fill departure city input
|
|
const inputs = page.locator('input');
|
|
await inputs.first().fill('Moscow');
|
|
|
|
// Check URL contains parameter
|
|
const url = page.url();
|
|
expect(url).toContain('city=Moscow');
|
|
});
|
|
|
|
test('should preserve state on back button', async ({ page }) => {
|
|
await page.goto(`${BASE_URL}/ru-ru/schedule`);
|
|
|
|
// Set initial state
|
|
const inputs = page.locator('input');
|
|
await inputs.first().fill('Moscow');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// Navigate away and back
|
|
await page.goto(`${BASE_URL}/ru-ru/flights`);
|
|
await page.goBack();
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// State should be preserved in URL
|
|
const url = page.url();
|
|
expect(url).toContain('city=Moscow');
|
|
});
|
|
|
|
test('should support forward navigation', async ({ page }) => {
|
|
await page.goto(`${BASE_URL}/ru-ru/schedule`);
|
|
|
|
const inputs = page.locator('input');
|
|
await inputs.first().fill('St Petersburg');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// Go back then forward
|
|
await page.goBack();
|
|
await page.goForward();
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// URL should match forward state
|
|
const url = page.url();
|
|
expect(url).toContain('St');
|
|
});
|
|
|
|
test('should console have zero errors', async ({ page }) => {
|
|
const errors: string[] = [];
|
|
page.on('console', (msg) => {
|
|
if (msg.type() === 'error') errors.push(msg.text());
|
|
});
|
|
|
|
await page.goto(`${BASE_URL}/ru-ru/schedule`);
|
|
const inputs = page.locator('input');
|
|
await inputs.first().fill('Moscow');
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
await page.goBack();
|
|
await page.waitForLoadState('networkidle');
|
|
await page.goForward();
|
|
|
|
expect(errors).toHaveLength(0);
|
|
});
|
|
});
|