fix glossary tests (#19352)

This commit is contained in:
Karan Hotchandani 2025-01-14 21:44:40 +05:30 committed by GitHub
parent a28c30ec7f
commit 94cbadb772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -1219,13 +1219,17 @@ test.describe('Glossary tests', () => {
const firstGlossaryName = json.data[0].displayName;
await expect(
page.getByRole('menuitem', { name: firstGlossaryName })
page
.getByTestId('glossary-left-panel')
.getByRole('menuitem', { name: firstGlossaryName })
).toBeVisible();
const lastGlossaryName = json.data[json.data.length - 1].displayName;
await expect(
page.getByRole('menuitem', { name: lastGlossaryName })
page
.getByTestId('glossary-left-panel')
.getByRole('menuitem', { name: lastGlossaryName })
).toBeVisible();
} finally {
for (const glossary of glossaries) {

View File

@ -62,11 +62,14 @@ export const selectActiveGlossary = async (
const isSelected = await menuItem.evaluate((element) => {
return element.classList.contains('ant-menu-item-selected');
});
if (!isSelected) {
const glossaryResponse = page.waitForResponse('/api/v1/glossaryTerms*');
await menuItem.click();
await glossaryResponse;
} else {
await page.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
}
};