mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
### TL;DR tests: workspace embedding e2e > CLOSE BS-3052 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced comprehensive end-to-end tests for workspace embedding settings, including toggling embedding, uploading and managing attachments, pagination, and ignoring documents. - Added utilities for automated interaction with the settings panel and document creation in tests. - **Tests** - Implemented detailed scenarios to verify workspace embedding functionality and user interactions within the settings panel. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
// eslint-disable no-empty-pattern
|
|
import { test as base } from '@affine-test/kit/playwright';
|
|
import type { Page } from '@playwright/test';
|
|
|
|
import { ChatPanelUtils } from '../utils/chat-panel-utils';
|
|
import { EditorUtils } from '../utils/editor-utils';
|
|
import { SettingsPanelUtils } from '../utils/settings-panel-utils';
|
|
import { TestUtils } from '../utils/test-utils';
|
|
|
|
interface TestUtilsFixtures {
|
|
utils: {
|
|
testUtils: TestUtils;
|
|
chatPanel: typeof ChatPanelUtils;
|
|
editor: typeof EditorUtils;
|
|
settings: typeof SettingsPanelUtils;
|
|
};
|
|
loggedInPage: Page;
|
|
}
|
|
|
|
export const test = base.extend<TestUtilsFixtures>({
|
|
utils: async ({}, use) => {
|
|
const testUtils = TestUtils.getInstance();
|
|
await use({
|
|
testUtils,
|
|
chatPanel: ChatPanelUtils,
|
|
editor: EditorUtils,
|
|
settings: SettingsPanelUtils,
|
|
});
|
|
},
|
|
loggedInPage: async ({ browser }, use) => {
|
|
const context = await browser.newContext({
|
|
storageState: 'storageState.json',
|
|
});
|
|
const page = await context.newPage();
|
|
await use(page);
|
|
await context.close();
|
|
},
|
|
});
|
|
|
|
export type TestFixtures = typeof test;
|