35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { test, expect } from "./fixtures/console-gate";
|
|
import { addDays, formatYmd } from "./helpers/dates";
|
|
|
|
test.describe("Schedule", () => {
|
|
test("/ru/schedule renders the start page", async ({ page, consoleMessages }) => {
|
|
await page.goto("/ru/schedule");
|
|
await page.waitForLoadState("domcontentloaded");
|
|
|
|
// The ScheduleStartPage should render
|
|
await expect(page.locator('[data-testid="schedule-start"]')).toBeVisible({
|
|
timeout: 10000,
|
|
});
|
|
|
|
// The search form should be present
|
|
await expect(
|
|
page.locator('[data-testid="schedule-search-form"]'),
|
|
).toBeVisible();
|
|
});
|
|
|
|
test("/ru/schedule/route/SVO-LED-{today..+6} renders the search page", async ({
|
|
page,
|
|
consoleMessages,
|
|
}) => {
|
|
const from = formatYmd(new Date());
|
|
const to = formatYmd(addDays(new Date(), 6));
|
|
await page.goto(`/ru/schedule/route/SVO-LED-${from}-${to}`);
|
|
await page.waitForLoadState("domcontentloaded");
|
|
|
|
expect(page.url()).toContain(`/schedule/route/SVO-LED-${from}-${to}`);
|
|
|
|
// Page should render something (search results, loading, or error)
|
|
await expect(page.locator("body")).not.toBeEmpty();
|
|
});
|
|
});
|