test(core): embedding settings (#11554)

### 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 -->
This commit is contained in:
yoyoyohamapi
2025-05-15 06:43:07 +00:00
parent 9fee8147cb
commit d00315e372
4 changed files with 497 additions and 1 deletions
@@ -6,7 +6,10 @@ import {
pressEscape,
selectAllByKeyboard,
} from '@affine-test/kit/utils/keyboard';
import { getBlockSuiteEditorTitle } from '@affine-test/kit/utils/page-logic';
import {
clickNewPageButton,
getBlockSuiteEditorTitle,
} from '@affine-test/kit/utils/page-logic';
import type { EdgelessRootBlockComponent } from '@blocksuite/affine/blocks/root';
import type {
MindmapElementModel,
@@ -288,6 +291,19 @@ export class EditorUtils {
await page.waitForTimeout(100);
}
public static async createDoc(page: Page, title: string, docContent: string) {
await clickNewPageButton(page);
await page.keyboard.insertText(title);
await this.focusToEditor(page);
const texts = docContent.split('\n');
for (const [index, line] of texts.entries()) {
await page.keyboard.insertText(line);
if (index !== texts.length - 1) {
await page.keyboard.press('Enter');
}
}
}
public static async createCollectionAndDoc(
page: Page,
collectionName: string,