Repository navigation
test(ui): fix flaky glossary description assertion in 2.0 - #33576
Conversation
Backport of the glossary.ts fix from #32591. verifyGlossaryDetails read the description via page.textContent(), which waits for the viewer element to mount but not for its rich-text content to hydrate. On a cold first attempt it returns "" and expect().toContain() fails immediately without retrying. Switch to expect(...).toContainText(), which polls and survives the hydration gap. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟢 Low risk Fixes a flaky Playwright assertion in the glossary description test by switching to a web-first assertion that properly waits for rich-text content to hydrate. No issues found. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Description
Backport to
2.0of theglossary.tsPlaywright fix from #32591.verifyGlossaryDetailsread the glossary description withpage.textContent('[data-testid="viewer-container"]'), which waits for the viewer element to mount but not for its rich-text content to hydrate. On a cold first attempt the call returns"", andexpect(...).toContain(description)fails immediately without retrying:Switched to
expect(page.getByTestId('viewer-container')).toContainText(description), a web-first assertion that polls and survives the hydration gap.This mirrors the fix already on
main; the backport touches only this assertion.Type of change
How was this tested
Pages/Glossary.spec.ts—Glossary & terms creation for reviewer as team🤖 Generated with Claude Code
The PR appears safe to merge and correctly addresses the flaky assertion without changing the tested behavior.
Summary
This PR backports the Playwright glossary-description stability fix to the 2.0 branch.
textContent()check with a retrying locator assertion.Reviews (1) · Last reviewed commit: "test(ui): fix flaky glossary description..."