AFFiNE/tests/kit/utils/load-page.ts

24 lines
580 B
TypeScript
Raw Normal View History

import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
2022-11-28 16:17:34 +03:00
export let coreUrl = 'http://localhost:8080';
export function setCoreUrl(url: string) {
coreUrl = url;
}
export async function openHomePage(page: Page) {
await page.goto(coreUrl);
2022-11-28 16:17:34 +03:00
}
export async function open404Page(page: Page) {
await page.goto(`${coreUrl}/404`);
}
export async function openJournalsPage(page: Page) {
await page.getByTestId('slider-bar-journals-button').click();
await expect(
page.locator('.doc-title-container:has-text("Today")')
).toBeVisible();
}