diff --git a/apps/web/tests/cot-translation.e2e.ts b/apps/web/tests/cot-translation.e2e.ts index aebd5278ac..3bbb7da033 100644 --- a/apps/web/tests/cot-translation.e2e.ts +++ b/apps/web/tests/cot-translation.e2e.ts @@ -238,6 +238,10 @@ it.skipIf(MODE === 'record')('persists Bing reasoning translation across reopen expect(await typography()).toEqual(translatedTypography) await page.mouse.move(0, 0) const translationAction = reasoning.getByRole('button', { name: '查看译文', exact: true }) + const titleBox = await reasoning.getByRole('button', { name: '思考', exact: true }).boundingBox() + const actionBox = await translationAction.boundingBox() + if (titleBox === null || actionBox === null) throw new Error('Reasoning title and translation action must be visible') + expect(actionBox.y + actionBox.height / 2).toBeCloseTo(titleBox.y + titleBox.height / 2, 1) expect(await translationAction.evaluate(element => getComputedStyle(element).opacity)).toBe('1') await translationAction.click() await composer.focus() diff --git a/apps/web/tests/lifecycle-chrome.e2e.ts b/apps/web/tests/lifecycle-chrome.e2e.ts index 4f9fba2f43..a9226b7fb7 100644 --- a/apps/web/tests/lifecycle-chrome.e2e.ts +++ b/apps/web/tests/lifecycle-chrome.e2e.ts @@ -399,14 +399,13 @@ describe('web e2e: lifecycle & chrome (workspace flow / reload / dark mode)', () const processWasOpen = await process.getAttribute('aria-expanded') === 'true' try { await expandOwningTurnProcess(page, thinkRow) - const collapsedHeader = thinkRow.locator('[data-disclosure-row]').first() + const collapsedHeader = thinkRow.locator('[data-disclosure-header]').first() await collapsedHeader.waitFor({ timeout: 10_000 }) // Collapsed, the rule's `data-open` gate is absent and the header stays in - // flow. It is `relative` here — the row is the sweep-glare overlay anchor - // — so the assertion is the absence of `sticky`, not a specific value. + // flow, so assert the absence of `sticky`, not a specific value. expect(await collapsedHeader.evaluate(element => getComputedStyle(element).position)).not.toBe('sticky') - await collapsedHeader.click() - const openHeader = page.locator('[data-variant="think"] [data-open] [data-disclosure-row]').first() + await collapsedHeader.locator('[data-disclosure-row]').click() + const openHeader = page.locator('[data-variant="think"] [data-open] [data-disclosure-header]').first() await openHeader.waitFor({ timeout: 10_000 }) const openStyle = await openHeader.evaluate((element) => { const style = getComputedStyle(element)