Files
AFFiNE-Mirror/tests/kit/src/mobile.ts
T
2025-02-07 15:15:45 +08:00

29 lines
643 B
TypeScript

import { expect } from '@playwright/test';
import { test as baseTest } from './playwright';
type CurrentDocCollection = {
meta: { id: string; flavour: string };
};
export const test = baseTest.extend<{
workspace: {
current: () => Promise<CurrentDocCollection>;
};
}>({
page: async ({ page }, use) => {
await page.goto('/');
await expect(
page.locator('.affine-page-viewport[data-mode="edgeless"]')
).toBeVisible({
timeout: 30 * 1000,
});
await page.goto('/');
await use(page);
console.log(
'Browser User Agent:',
await page.evaluate(() => navigator.userAgent)
);
},
});