diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.spec.ts index 2d1a48d77f23..03011b1c712c 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.spec.ts @@ -867,6 +867,45 @@ test.describe('Glossary tests', () => { await afterAction(); }); + test('Verify Expand All For Nested Glossary Terms', async ({ browser }) => { + const { page, afterAction, apiContext } = await performAdminLogin(browser); + const glossary1 = new Glossary(); + const glossaryTerm1 = new GlossaryTerm(glossary1); + await glossary1.create(apiContext); + await glossaryTerm1.create(apiContext); + const glossaryTerm2 = new GlossaryTerm( + glossary1, + glossaryTerm1.responseData.fullyQualifiedName + ); + await glossaryTerm2.create(apiContext); + const glossaryTerm3 = new GlossaryTerm( + glossary1, + glossaryTerm2.responseData.fullyQualifiedName + ); + await glossaryTerm3.create(apiContext); + + try { + await sidebarClick(page, SidebarItem.GLOSSARY); + await selectActiveGlossary(page, glossary1.data.displayName); + await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName); + await page.getByTestId('terms').click(); + await page.getByTestId('expand-collapse-all-button').click(); + + await expect( + page.getByRole('cell', { name: glossaryTerm2.data.displayName }) + ).toBeVisible(); + await expect( + page.getByRole('cell', { name: glossaryTerm3.data.displayName }) + ).toBeVisible(); + } finally { + await glossaryTerm3.delete(apiContext); + await glossaryTerm2.delete(apiContext); + await glossaryTerm1.delete(apiContext); + await glossary1.delete(apiContext); + await afterAction(); + } + }); + test.afterAll(async ({ browser }) => { const { afterAction, apiContext } = await performAdminLogin(browser); await user1.delete(apiContext); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/Glossary.interface.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/Glossary.interface.ts index 3c633429b2e1..4ed9dc443bd2 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/Glossary.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/Glossary.interface.ts @@ -64,4 +64,5 @@ export type GlossaryTermData = { owners?: UserTeamRef[]; fullyQualifiedName: string; reviewers: UserTeamRef[]; + parent?: string; }; diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/GlossaryTerm.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/GlossaryTerm.ts index a9a6c4364324..bd51bcbe4648 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/GlossaryTerm.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/glossary/GlossaryTerm.ts @@ -34,8 +34,12 @@ export class GlossaryTerm { responseData: GlossaryTermResponseDataType; - constructor(glossary: Glossary, name?: string) { + constructor(glossary: Glossary, parent?: string, name?: string) { this.data.glossary = glossary.data.name; + if (parent) { + this.data.parent = parent; + } + this.data.name = name ?? this.data.name; // eslint-disable-next-line no-useless-escape this.data.fullyQualifiedName = `\"${this.data.glossary}\".\"${this.data.name}\"`; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx index f13edb0bebae..353dedacb500 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx @@ -390,8 +390,9 @@ const GlossaryTermTab = ({ const fetchAllTerms = async () => { setIsTableLoading(true); + const key = isGlossary ? 'glossary' : 'parent'; const { data } = await getGlossaryTerms({ - glossary: activeGlossary?.id || '', + [key]: activeGlossary?.id || '', limit: API_RES_MAX_SIZE, fields: [ TabSpecificField.OWNERS,