375bcfb0fa
Copies Playwright e2e tests (58 specs, 300+ tests) designed for cross-app testing. Adapts API mocks to match real Aeroflot dictionary format (title objects with multilingual keys), adds board/schedule/days endpoint mocks, and provides Angular-specific Playwright config on port 4203.
1686 lines
63 KiB
TypeScript
1686 lines
63 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
||
import type { Page } from '@playwright/test';
|
||
import {
|
||
buildOnlineBoardPath,
|
||
buildRouteParam,
|
||
buildSchedulePath,
|
||
generateFlight,
|
||
generateFlights,
|
||
getToday,
|
||
getTomorrow,
|
||
getYesterday,
|
||
getFutureDate,
|
||
getPastDate,
|
||
CITIES,
|
||
AIRPORTS,
|
||
FLIGHT_NUMBERS,
|
||
STATUS_TYPES,
|
||
AIRCRAFT_TYPES,
|
||
} from '../support/test-utilities';
|
||
|
||
const today = getToday();
|
||
const tomorrow = getTomorrow();
|
||
const yesterday = getYesterday();
|
||
const futureDate = getFutureDate(7);
|
||
const pastDate = getPastDate(7);
|
||
|
||
// ============================================================================
|
||
// Flight Details - Online Board & Schedule (50+ tests)
|
||
// ============================================================================
|
||
|
||
test.describe('Flight Details - Online Board & Schedule', () => {
|
||
// ============================================================================
|
||
// Category 1: Online Board Flight Details - Basic (8 tests)
|
||
// ============================================================================
|
||
test.describe('Category 1: Online Board Flight Details - Basic', () => {
|
||
test('Should open flight details from Online Board arrival search results (Test 1)', async ({
|
||
page,
|
||
}) => {
|
||
await page.goto(`/ru-ru${buildOnlineBoardPath('arrival', 'MOW', today)}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/[A-Z]{2}\s?\d+-\d{8}/);
|
||
});
|
||
|
||
test('Should open flight details from Online Board departure search results (Test 2)', async ({
|
||
page,
|
||
}) => {
|
||
await page.goto(`/ru-ru${buildOnlineBoardPath('departure', 'MOW', today)}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/[A-Z]{2}\s?\d+-\d{8}/);
|
||
});
|
||
|
||
test('Should open flight details from Online Board route search results (Test 3)', async ({
|
||
page,
|
||
}) => {
|
||
await page.goto(`/ru-ru${buildOnlineBoardPath('departure', 'MOW', today)}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeTab = page.locator('[data-testid="route-search-tab"]');
|
||
await routeTab.click();
|
||
await page.waitForTimeout(500);
|
||
|
||
const departureInput = page.locator('[data-testid="departure-city-input"]');
|
||
const arrivalInput = page.locator('[data-testid="arrival-city-input"]');
|
||
|
||
await departureInput.fill('Moscow');
|
||
await page.waitForTimeout(500);
|
||
await departureInput.press('Enter');
|
||
await page.waitForTimeout(500);
|
||
|
||
await arrivalInput.fill('Sochi');
|
||
await page.waitForTimeout(500);
|
||
await arrivalInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/[A-Z]{2}\s?\d+-\d{8}/);
|
||
});
|
||
|
||
test('Should open flight details from Online Board flight search results (Test 4)', async ({
|
||
page,
|
||
}) => {
|
||
await page.goto(`/ru-ru${buildOnlineBoardPath('departure', 'MOW', today)}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="flight-search-input"]');
|
||
await searchInput.fill('SU 1124');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/SU1124-\d{8}/);
|
||
});
|
||
|
||
test('Should verify flight number display (Test 5)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightNumber = page.locator('[data-testid="flight-number"]');
|
||
await expect(flightNumber).toBeVisible();
|
||
await expect(flightNumber).toContainText(flight.flightNumber);
|
||
});
|
||
|
||
test('Should verify carrier logo display (Test 6)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const carrierLogo = page.locator('[data-testid="carrier-logo"]');
|
||
await expect(carrierLogo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify route display (Test 7)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
|
||
await expect(routeInfo).toContainText(flight.departure.cityName);
|
||
await expect(routeInfo).toContainText(flight.arrival.cityName);
|
||
});
|
||
|
||
test('Should verify basic flight information (Test 8)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page.getByText(flight.flightNumber)).toBeVisible();
|
||
await expect(page.getByText(flight.airlineName)).toBeVisible();
|
||
await expect(page.getByText(flight.departure.cityName)).toBeVisible();
|
||
await expect(page.getByText(flight.arrival.cityName)).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 2: Online Board Flight Details - Status (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 2: Online Board Flight Details - Status', () => {
|
||
test('Should verify flight status display - Scheduled (Test 9)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'scheduled',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
await expect(status).toContainText('scheduled');
|
||
});
|
||
|
||
test('Should verify flight status display - Sent (Test 10)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'departed',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status display - In Flight (Test 11)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'inFlight',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status display - Landed (Test 12)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
status: 'landed',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status display - Arrived (Test 13)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
status: 'arrived',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status display - Delayed (Test 14)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'delayed',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status display - Cancelled (Test 15)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'cancelled',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const status = page.locator('[data-testid="flight-status"]');
|
||
await expect(status).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status icon (Test 16)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'scheduled',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const statusIcon = page.locator('[data-testid="status-icon"]');
|
||
await expect(statusIcon).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status details (Test 17)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'scheduled',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const statusDetails = page.locator('[data-testid="status-details"]');
|
||
await expect(statusDetails).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status badges (Test 18)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'boarding',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const statusBadge = page.locator('[data-testid="status-badge"]');
|
||
await expect(statusBadge).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status color coding (Test 19)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'delayed',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const statusContainer = page.locator('[data-testid="status-container"]');
|
||
await expect(statusContainer).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight status timestamp (Test 20)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'scheduled',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const statusTimestamp = page.locator('[data-testid="status-timestamp"]');
|
||
await expect(statusTimestamp).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 3: Online Board Flight Details - Aircraft (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 3: Online Board Flight Details - Aircraft', () => {
|
||
test('Should verify aircraft information display (Test 21)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftSection = page.locator('[data-testid="aircraft-section"]');
|
||
await expect(aircraftSection).toBeVisible();
|
||
});
|
||
|
||
test('Should verify aircraft type display (Test 22)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftType = page.locator('[data-testid="aircraft-type"]');
|
||
await expect(aircraftType).toBeVisible();
|
||
await expect(aircraftType).toContainText(flight.aircraft?.type || '');
|
||
});
|
||
|
||
test('Should verify aircraft seats configuration (Test 23)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const seatInfo = page.locator('[data-testid="seat-info"]');
|
||
await expect(seatInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify aircraft previous flight information (Test 24)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', previousFlight: 'SU 1123' },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const previousFlight = page.locator('[data-testid="previous-flight"]');
|
||
await expect(previousFlight).toBeVisible();
|
||
});
|
||
|
||
test('Should verify aircraft equipment details (Test 25)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const equipmentDetails = page.locator('[data-testid="equipment-details"]');
|
||
await expect(equipmentDetails).toBeVisible();
|
||
});
|
||
|
||
test('Should verify aircraft model display (Test 26)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftModel = page.locator('[data-testid="aircraft-model"]');
|
||
await expect(aircraftModel).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 4: Online Board Flight Details - Services (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 4: Online Board Flight Details - Services', () => {
|
||
test('Should verify registration information display (Test 27)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const registrationInfo = page.locator('[data-testid="registration-info"]');
|
||
await expect(registrationInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify boarding information display (Test 28)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'boarding',
|
||
boarding: { gate: '11', status: 'Идёт посадка' },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const boardingInfo = page.locator('[data-testid="boarding-info"]');
|
||
await expect(boardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify deboarding information display (Test 29)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
status: 'arrived',
|
||
deplaning: { status: 'В процессе', transfer: 'Трап' },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const deboardingInfo = page.locator('[data-testid="deboarding-info"]');
|
||
await expect(deboardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify meal information display (Test 30)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
catering: { economy: true, business: true },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const mealInfo = page.locator('[data-testid="meal-info"]');
|
||
await expect(mealInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify on-board services display (Test 31)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const onboardServices = page.locator('[data-testid="onboard-services"]');
|
||
await expect(onboardServices).toBeVisible();
|
||
});
|
||
|
||
test('Should verify service icons (Test 32)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const serviceIcons = page.locator('[data-testid="service-icon"]');
|
||
await expect(serviceIcons).toHaveCount(3);
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 5: Online Board Flight Details - Schedule (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 5: Online Board Flight Details - Schedule', () => {
|
||
test('Should verify flight schedule display (Test 33)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const scheduleSection = page.locator('[data-testid="schedule-section"]');
|
||
await expect(scheduleSection).toBeVisible();
|
||
});
|
||
|
||
test('Should verify scheduled departure time (Test 34)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const scheduledDep = page.locator('[data-testid="scheduled-departure"]');
|
||
await expect(scheduledDep).toBeVisible();
|
||
|
||
const depTime = flight.departure.time.scheduled.slice(11, 16);
|
||
await expect(scheduledDep).toContainText(depTime);
|
||
});
|
||
|
||
test('Should verify scheduled arrival time (Test 35)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const scheduledArr = page.locator('[data-testid="scheduled-arrival"]');
|
||
await expect(scheduledArr).toBeVisible();
|
||
|
||
const arrTime = flight.arrival.time.scheduled.slice(11, 16);
|
||
await expect(scheduledArr).toContainText(arrTime);
|
||
});
|
||
|
||
test('Should verify actual departure time (Test 36)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
status: 'departed',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const actualDep = page.locator('[data-testid="actual-departure"]');
|
||
await expect(actualDep).toBeVisible();
|
||
});
|
||
|
||
test('Should verify actual arrival time (Test 37)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
status: 'arrived',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const actualArr = page.locator('[data-testid="actual-arrival"]');
|
||
await expect(actualArr).toBeVisible();
|
||
});
|
||
|
||
test('Should verify flight duration (Test 38)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const duration = page.locator('[data-testid="flight-duration"]');
|
||
await expect(duration).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 6: Schedule Flight Details - Basic (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 6: Schedule Flight Details - Basic', () => {
|
||
test('Should open flight details from Schedule search results (Test 39)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/schedule\/details/);
|
||
});
|
||
|
||
test('Should verify flight number display in Schedule (Test 40)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('SU 1124');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightNumber = page.locator('[data-testid="flight-number"]');
|
||
await expect(flightNumber).toBeVisible();
|
||
});
|
||
|
||
test('Should verify carrier logo display in Schedule (Test 41)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('SU 1124');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const carrierLogo = page.locator('[data-testid="carrier-logo"]');
|
||
await expect(carrierLogo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify route display in Schedule (Test 42)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify basic flight information in Schedule (Test 43)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('SU 1124');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page.getByText('SU 1124')).toBeVisible();
|
||
await expect(page.getByText('Aeroflot')).toBeVisible();
|
||
});
|
||
|
||
test('Should verify round-trip information (Test 44)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const roundTripTab = page.locator('[data-testid="round-trip-tab"]');
|
||
await roundTripTab.click();
|
||
await page.waitForTimeout(500);
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const roundTripInfo = page.locator('[data-testid="round-trip-info"]');
|
||
await expect(roundTripInfo).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 7: Schedule Flight Details - Multi-leg (6 tests)
|
||
// ============================================================================
|
||
test.describe('Category 7: Schedule Flight Details - Multi-leg', () => {
|
||
test('Should open multi-leg flight details (Test 45)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const multiLegTab = page.locator('[data-testid="multi-leg-tab"]');
|
||
await multiLegTab.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/schedule\/details/);
|
||
});
|
||
|
||
test('Should verify leg switcher (Test 46)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const legSwitcher = page.locator('[data-testid="leg-switcher"]');
|
||
await expect(legSwitcher).toBeVisible();
|
||
});
|
||
|
||
test('Should verify leg information display (Test 47)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const legInfo = page.locator('[data-testid="leg-info"]');
|
||
await expect(legInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify transfer information (Test 48)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const transferInfo = page.locator('[data-testid="transfer-info"]');
|
||
await expect(transferInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should verify multi-leg route display (Test 49)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const multiLegRoute = page.locator('[data-testid="multi-leg-route"]');
|
||
await expect(multiLegRoute).toBeVisible();
|
||
});
|
||
|
||
test('Should verify timeline display (Test 50)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const timeline = page.locator('[data-testid="timeline"]');
|
||
await expect(timeline).toBeVisible();
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 8: Flight Details Navigation (4 tests)
|
||
// ============================================================================
|
||
test.describe('Category 8: Flight Details Navigation', () => {
|
||
test('Should navigate back to search results (Test 51)', async ({ page }) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru${buildOnlineBoardPath('departure', 'MOW', today)}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const backLink = page.locator('[data-testid="back-link"]');
|
||
await backLink.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/onlineboard\/departure\/MOW-\d{8}/);
|
||
});
|
||
|
||
test('Should navigate to previous flight in multi-leg (Test 52)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const prevFlightBtn = page.locator('[data-testid="prev-flight-btn"]');
|
||
await prevFlightBtn.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/schedule\/details/);
|
||
});
|
||
|
||
test('Should navigate to next flight in multi-leg (Test 53)', async ({ page }) => {
|
||
await page.goto(`/ru-ru${buildSchedulePath()}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const searchInput = page.locator('[data-testid="schedule-search-input"]');
|
||
await searchInput.fill('Moscow');
|
||
await searchInput.press('Enter');
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const flightCard = page.locator('[data-testid="schedule-flight-card"]').first();
|
||
await flightCard.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const nextFlightBtn = page.locator('[data-testid="next-flight-btn"]');
|
||
await nextFlightBtn.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/\/ru-ru\/schedule\/details/);
|
||
});
|
||
|
||
test('Should navigate between Online Board and Schedule details (Test 54)', async ({
|
||
page,
|
||
}) => {
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const onlineBoardLink = page.locator('[data-testid="online-board-link"]');
|
||
await onlineBoardLink.click();
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page).toHaveURL(/onlineboard\/departure\/MOW-\d{8}/);
|
||
});
|
||
});
|
||
|
||
// ============================================================================
|
||
// Category 9: Edge Cases (2 tests)
|
||
// ============================================================================
|
||
test.describe('Category 9: Edge Cases', () => {
|
||
test('Should handle network error gracefully (Test 55)', async ({ page }) => {
|
||
await page.route('**/api/flights/**', (route) => {
|
||
return route.abort('internetdisconnected');
|
||
});
|
||
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const networkError = page.locator('[data-testid="network-error"]');
|
||
await expect(networkError).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight not found (404) (Test 56)', async ({ page }) => {
|
||
await page.route('**/api/flights/**', async (route) => {
|
||
await route.fulfill({
|
||
status: 404,
|
||
json: { error: 'Not Found', message: 'Flight not found' },
|
||
});
|
||
});
|
||
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const notFound = page.locator('[data-testid="not-found"]');
|
||
await expect(notFound).toBeVisible();
|
||
});
|
||
|
||
test('Should handle server error (500) (Test 57)', async ({ page }) => {
|
||
await page.route('**/api/flights/**', async (route) => {
|
||
await route.fulfill({
|
||
status: 500,
|
||
json: { error: 'Internal Server Error', message: 'Server error' },
|
||
});
|
||
});
|
||
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const serverError = page.locator('[data-testid="server-error"]');
|
||
await expect(serverError).toBeVisible();
|
||
});
|
||
|
||
test('Should handle timeout error (504) (Test 58)', async ({ page }) => {
|
||
await page.route('**/api/flights/**', async (route) => {
|
||
await route.fulfill({
|
||
status: 504,
|
||
json: { error: 'Gateway Timeout', message: 'Request timeout' },
|
||
});
|
||
});
|
||
|
||
const flight = generateFlight({ direction: 'departure', cityCode: 'MOW' });
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const timeoutError = page.locator('[data-testid="timeout-error"]');
|
||
await expect(timeoutError).toBeVisible();
|
||
});
|
||
|
||
test('Should handle invalid date format (Test 59)', async ({ page }) => {
|
||
await page.goto(`/ru-ru/SU1124-INVALID`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const errorState = page.locator('[data-testid="error-state"]');
|
||
await expect(errorState).toBeVisible();
|
||
});
|
||
|
||
test('Should handle empty flight number (Test 60)', async ({ page }) => {
|
||
await page.goto(`/ru-ru/-${today.replace(/-/g, '')}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const errorState = page.locator('[data-testid="error-state"]');
|
||
await expect(errorState).toBeVisible();
|
||
});
|
||
|
||
test('Should handle special characters in flight number (Test 61)', async ({ page }) => {
|
||
await page.goto(`/ru-ru/SU!@#$-${today.replace(/-/g, '')}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const errorState = page.locator('[data-testid="error-state"]');
|
||
await expect(errorState).toBeVisible();
|
||
});
|
||
|
||
test('Should handle very long flight number (Test 62)', async ({ page }) => {
|
||
const longFlightNumber = 'SU'.padEnd(100, '1');
|
||
await page.goto(`/ru-ru/${longFlightNumber}-${today.replace(/-/g, '')}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const errorState = page.locator('[data-testid="error-state"]');
|
||
await expect(errorState).toBeVisible();
|
||
});
|
||
|
||
test('Should handle Unicode characters in flight number (Test 63)', async ({ page }) => {
|
||
await page.goto(`/ru-ru/SU1124 flight 🛫-${today.replace(/-/g, '')}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const errorState = page.locator('[data-testid="error-state"]');
|
||
await expect(errorState).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft information (Test 64)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftSection = page.locator('[data-testid="aircraft-section"]');
|
||
await expect(aircraftSection).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing schedule information (Test 65)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
schedule: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const scheduleSection = page.locator('[data-testid="schedule-section"]');
|
||
await expect(scheduleSection).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing boarding information (Test 66)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
boarding: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const boardingInfo = page.locator('[data-testid="boarding-info"]');
|
||
await expect(boardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing arrival information (Test 67)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'Adler',
|
||
cityCode: 'AER',
|
||
cityName: 'Sochi',
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const arrivalInfo = page.locator('[data-testid="arrival-info"]');
|
||
await expect(arrivalInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing departure information (Test 68)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'Sheremetyevo',
|
||
cityCode: 'MOW',
|
||
cityName: 'Moscow',
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const departureInfo = page.locator('[data-testid="departure-info"]');
|
||
await expect(departureInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing catering information (Test 69)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
catering: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const mealInfo = page.locator('[data-testid="meal-info"]');
|
||
await expect(mealInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing checkin information (Test 70)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
checkin: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const checkinInfo = page.locator('[data-testid="checkin-info"]');
|
||
await expect(checkinInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing deplaning information (Test 71)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
deplaning: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const deboardingInfo = page.locator('[data-testid="deboarding-info"]');
|
||
await expect(deboardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing arrivalInfo (Test 72)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
arrivalInfo: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const arrivalInfo = page.locator('[data-testid="arrival-info"]');
|
||
await expect(arrivalInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing lastUpdated (Test 73)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
lastUpdated: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const lastUpdated = page.locator('[data-testid="last-updated"]');
|
||
await expect(lastUpdated).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft name (Test 74)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', name: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftName = page.locator('[data-testid="aircraft-name"]');
|
||
await expect(aircraftName).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft previousFlight (Test 75)', async ({
|
||
page,
|
||
}) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', previousFlight: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const previousFlight = page.locator('[data-testid="previous-flight"]');
|
||
await expect(previousFlight).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft seats (Test 76)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', totalSeats: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const seatInfo = page.locator('[data-testid="seat-info"]');
|
||
await expect(seatInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft equipment (Test 77)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', equipment: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const equipmentDetails = page.locator('[data-testid="equipment-details"]');
|
||
await expect(equipmentDetails).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft model (Test 78)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', model: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftModel = page.locator('[data-testid="aircraft-model"]');
|
||
await expect(aircraftModel).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft type (Test 79)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: undefined },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftType = page.locator('[data-testid="aircraft-type"]');
|
||
await expect(aircraftType).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing aircraft (Test 80)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const aircraftSection = page.locator('[data-testid="aircraft-section"]');
|
||
await expect(aircraftSection).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing schedule (Test 81)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
schedule: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const scheduleSection = page.locator('[data-testid="schedule-section"]');
|
||
await expect(scheduleSection).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing boarding (Test 82)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
boarding: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const boardingInfo = page.locator('[data-testid="boarding-info"]');
|
||
await expect(boardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing checkin (Test 83)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
checkin: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const checkinInfo = page.locator('[data-testid="checkin-info"]');
|
||
await expect(checkinInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing deplaning (Test 84)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
deplaning: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const deboardingInfo = page.locator('[data-testid="deboarding-info"]');
|
||
await expect(deboardingInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing arrivalInfo (Test 85)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'arrival',
|
||
cityCode: 'MOW',
|
||
arrivalInfo: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const arrivalInfo = page.locator('[data-testid="arrival-info"]');
|
||
await expect(arrivalInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing catering (Test 86)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
catering: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const mealInfo = page.locator('[data-testid="meal-info"]');
|
||
await expect(mealInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing lastUpdated (Test 87)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
lastUpdated: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const lastUpdated = page.locator('[data-testid="last-updated"]');
|
||
await expect(lastUpdated).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing all optional fields (Test 88)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: undefined,
|
||
schedule: undefined,
|
||
boarding: undefined,
|
||
checkin: undefined,
|
||
deplaning: undefined,
|
||
arrivalInfo: undefined,
|
||
catering: undefined,
|
||
lastUpdated: undefined,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page.getByText(flight.flightNumber)).toBeVisible();
|
||
await expect(page.getByText(flight.airlineName)).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with null values (Test 89)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: null,
|
||
schedule: null,
|
||
boarding: null,
|
||
checkin: null,
|
||
deplaning: null,
|
||
arrivalInfo: null,
|
||
catering: null,
|
||
lastUpdated: null,
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page.getByText(flight.flightNumber)).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with empty strings (Test 90)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: '', name: '', previousFlight: '' },
|
||
schedule: { scheduledDeparture: '', scheduledArrival: '', duration: '' },
|
||
boarding: { gate: '', status: '', startTime: '', endTime: '' },
|
||
checkin: { status: '', startTime: '', endTime: '' },
|
||
deplaning: { status: '', startTime: '', endTime: '', transfer: '' },
|
||
arrivalInfo: { baggageBelt: '', transfer: '' },
|
||
catering: { economy: false, business: false },
|
||
lastUpdated: '',
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
await expect(page.getByText(flight.flightNumber)).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with zero values (Test 91)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', totalSeats: 0, economySeats: 0, businessSeats: 0 },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const seatInfo = page.locator('[data-testid="seat-info"]');
|
||
await expect(seatInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with negative values (Test 92)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: { type: 'Airbus A320', totalSeats: -1, economySeats: -1, businessSeats: -1 },
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const seatInfo = page.locator('[data-testid="seat-info"]');
|
||
await expect(seatInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with very large values (Test 93)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
aircraft: {
|
||
type: 'Airbus A320',
|
||
totalSeats: 999999,
|
||
economySeats: 999999,
|
||
businessSeats: 999999,
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const seatInfo = page.locator('[data-testid="seat-info"]');
|
||
await expect(seatInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with special characters in city names (Test 94)', async ({
|
||
page,
|
||
}) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'Sheremetyevo',
|
||
cityCode: 'MOW',
|
||
cityName: 'Москва!@#$%',
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'Adler',
|
||
cityCode: 'AER',
|
||
cityName: 'Сочи!@#$%',
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with very long city names (Test 95)', async ({ page }) => {
|
||
const longCityName = 'Москва'.repeat(100);
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'Sheremetyevo',
|
||
cityCode: 'MOW',
|
||
cityName: longCityName,
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'Adler',
|
||
cityCode: 'AER',
|
||
cityName: longCityName,
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with Unicode characters in all fields (Test 96)', async ({
|
||
page,
|
||
}) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'Sheremetyevo 🛫',
|
||
cityCode: 'MOW',
|
||
cityName: 'Москва 🇷🇺',
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'Adler 🛬',
|
||
cityCode: 'AER',
|
||
cityName: 'Сочи 🇷🇺',
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with mixed case in all fields (Test 97)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'SHEREMETYEVO',
|
||
cityCode: 'MOW',
|
||
cityName: 'MOSCOW',
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'ADLER',
|
||
cityCode: 'AER',
|
||
cityName: 'SOCHI',
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with special characters in airport codes (Test 98)', async ({
|
||
page,
|
||
}) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO!@#$',
|
||
airportName: 'Sheremetyevo',
|
||
cityCode: 'MOW',
|
||
cityName: 'Moscow',
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
arrival: {
|
||
airportCode: 'AER!@#$',
|
||
airportName: 'Adler',
|
||
cityCode: 'AER',
|
||
cityName: 'Sochi',
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const routeInfo = page.locator('[data-testid="route-info"]');
|
||
await expect(routeInfo).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing terminal information (Test 99)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
departure: {
|
||
airportCode: 'SVO',
|
||
airportName: 'Sheremetyevo',
|
||
cityCode: 'MOW',
|
||
cityName: 'Moscow',
|
||
terminal: undefined,
|
||
time: { scheduled: '2026-04-06T12:13:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const terminal = page.locator('[data-testid="terminal"]');
|
||
await expect(terminal).toBeVisible();
|
||
});
|
||
|
||
test('Should handle flight with missing arrival terminal (Test 100)', async ({ page }) => {
|
||
const flight = generateFlight({
|
||
direction: 'departure',
|
||
cityCode: 'MOW',
|
||
arrival: {
|
||
airportCode: 'AER',
|
||
airportName: 'Adler',
|
||
cityCode: 'AER',
|
||
cityName: 'Sochi',
|
||
terminal: undefined,
|
||
time: { scheduled: '2026-04-06T16:05:00+03:00' },
|
||
},
|
||
});
|
||
const slug = `${flight.flightNumber.replace(/\s+/g, '')}-${today.replace(/-/g, '')}`;
|
||
|
||
await page.goto(`/ru-ru/${slug}`);
|
||
await page.waitForLoadState('networkidle');
|
||
|
||
const arrivalTerminal = page.locator('[data-testid="arrival-terminal"]');
|
||
await expect(arrivalTerminal).toBeVisible();
|
||
});
|
||
});
|
||
});
|