Skip to content

Commit acc237d

Browse files
siddhant1Siddhantclaude
authored andcommitted
fix(tests): scope glossary-terms-table column headers to columnheader role (#27187)
validateGlossaryTerm asserted the table headers (Terms, Description, Owners, Status) with getByTestId('glossary-terms-table').getByText(...), which triggered a Playwright strict mode violation: getByText('Owners') matched both the column header <div class="resizable-title">Owners</div> and the "No Owners" placeholder cell rendered in rows without owners. This broke the "Approve and reject glossary term from Glossary Listing" test (and any other test going through createGlossaryTerms). Scope the assertions to getByRole('columnheader', { name: ... }) so we match the <th> elements directly instead of anything with matching text inside the table body. Co-authored-by: Siddhant <siddhant@MacBook-Pro-457.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit daa2dce)
1 parent 48170a6 commit acc237d

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

  • openmetadata-ui/src/main/resources/ui/playwright/utils

openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,16 +706,24 @@ export const validateGlossaryTerm = async (
706706
await expect(page.locator('[data-testid="loader"]')).toHaveCount(0);
707707

708708
await expect(
709-
page.getByTestId('glossary-terms-table').getByText('Terms')
709+
page
710+
.getByTestId('glossary-terms-table')
711+
.getByRole('columnheader', { name: 'Terms' })
710712
).toBeVisible();
711713
await expect(
712-
page.getByTestId('glossary-terms-table').getByText('Description')
714+
page
715+
.getByTestId('glossary-terms-table')
716+
.getByRole('columnheader', { name: 'Description' })
713717
).toBeVisible();
714718
await expect(
715-
page.getByTestId('glossary-terms-table').getByText('Owners')
719+
page
720+
.getByTestId('glossary-terms-table')
721+
.getByRole('columnheader', { name: 'Owners' })
716722
).toBeVisible();
717723
await expect(
718-
page.getByTestId('glossary-terms-table').getByText('Status')
724+
page
725+
.getByTestId('glossary-terms-table')
726+
.getByRole('columnheader', { name: 'Status' })
719727
).toBeVisible();
720728

721729
if (isGlossaryTermPage) {

0 commit comments

Comments
 (0)