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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user