test(e2e): locate pane blocks by document-block testid

UI-06 and UI-13b reuse the pane-scoped helper; stop clicking overlay
or native heading/paragraph tags that the renderer does not emit.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-13 17:24:54 +00:00
co-authored by Cursor
parent 9e0901ce25
commit faaacae5f6
+2 -2
View File
@@ -363,7 +363,7 @@ async function closeNamedDialog(page: Page, name: string, timeout = 10_000) {
async function openFirstPaneEditorAndFill(target: Page, text: string) {
const pane = target.getByTestId('active-document-pane');
const block = pane.locator('[data-overlay-kind], p, h1, h2').first();
const block = pane.getByTestId('document-block').first();
await block.dblclick({ timeout: 15_000 });
const editor = target.locator('textarea, [contenteditable="true"]').last();
await expect(editor).toBeVisible({ timeout: 10_000 });
@@ -1091,7 +1091,7 @@ test.describe.serial('document-revision-runtime UI acceptance', () => {
await expect(pageB.getByText('双击任意段落就地编辑')).toHaveCount(0);
const pane = pageB.getByTestId('active-document-pane');
await pane.locator('[data-overlay-kind], p, h1, h2').first().dblclick({ timeout: 15_000 });
await pane.getByTestId('document-block').first().dblclick({ timeout: 15_000 });
await expect(pageB.getByRole('button', { name: /保存修改|保存并关闭/ })).toHaveCount(0);
await shot(pageB, 'UI-13a-reviewer-readonly.png');
await ctxB.close();