fix flaky playwright (#22038)

* fix flaky playwright

* fix flakiness
This commit is contained in:
Karan Hotchandani 2025-07-03 18:50:46 +05:30 committed by GitHub
parent bd5955fca2
commit fd0e07a99f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 16 deletions

View File

@ -412,11 +412,14 @@ test.describe('Domains', () => {
await selectDomain(page, domain.data);
// Create sub domain
await createSubDomain(page, subDomain.data);
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
await selectSubDomain(page, domain.data, subDomain.data);
await verifyDomain(page, subDomain.data, domain.data, false);
// Follow domain
await followEntity(page, EntityTypeEndpoint.Domain);
await redirectToHomePage(page);
await page.waitForLoadState('networkidle');
// Check that the followed domain is shown in the following widget
await expect(
@ -426,10 +429,14 @@ test.describe('Domains', () => {
page.locator('[data-testid="following-widget"]')
).toContainText(subDomain.data.displayName);
await sidebarClick(page, SidebarItem.DOMAIN);
await selectDomain(page, domain.data);
await selectSubDomain(page, domain.data, subDomain.data);
await verifyDomain(page, subDomain.data, domain.data, false);
const subDomainRes = page.waitForResponse('/api/v1/domains/name/*');
await page
.locator('[data-testid="following-widget"]')
.getByText(subDomain.data.displayName)
.click();
await subDomainRes;
// Unfollow domain
await unFollowEntity(page, EntityTypeEndpoint.Domain);
await redirectToHomePage(page);
@ -443,7 +450,6 @@ test.describe('Domains', () => {
).not.toContainText(subDomain.data.displayName);
await sidebarClick(page, SidebarItem.DOMAIN);
await selectDomain(page, domain.data);
await selectSubDomain(page, domain.data, subDomain.data);
await verifyDomain(page, subDomain.data, domain.data, false);
@ -901,11 +907,18 @@ test.describe('Data Consumer Domain Ownership', () => {
'Check domain management permissions for data consumer owner',
async () => {
await sidebarClick(dataConsumerPage, SidebarItem.DOMAIN);
await selectDomain(dataConsumerPage, testResources.domainForTest.data);
await dataConsumerPage.locator('[data-testid="loader"]').waitFor({
state: 'detached',
});
const permissionRes = dataConsumerPage.waitForResponse(
'/api/v1/permissions/domain/*'
);
await dataConsumerPage
.getByRole('menuitem', {
name: testResources.domainForTest.data.displayName,
})
.locator('span')
.click();
await permissionRes;
await dataConsumerPage.getByTestId('domain-details-add-button').click();

View File

@ -256,11 +256,11 @@ test('Verify column lineage between table and topic', async ({ browser }) => {
const searchRes = page.waitForResponse('/api/v1/search/query?*');
await page.click('[data-testid="search-entity-select"]');
await page.keyboard.type(tableServiceFqn);
await page.keyboard.type(topicServiceFqn);
await searchRes;
const lineageRes = page.waitForResponse('/api/v1/lineage/getLineage?*');
await page.click(`[data-testid="node-suggestion-${tableServiceFqn}"]`);
await page.click(`[data-testid="node-suggestion-${topicServiceFqn}"]`);
await lineageRes;
const tableServiceNode = page.locator(

View File

@ -128,17 +128,13 @@ export const selectSubDomain = async (
});
if (!isSelected) {
const subDomainRes = page.waitForResponse(
'/api/v1/search/query?*&from=0&size=50&index=domain_search_index'
);
await menuItem.click();
await subDomainRes;
await page.waitForLoadState('networkidle');
}
await page.getByTestId('subdomains').getByText('Sub Domains').click();
await page.getByTestId(subDomain.name).click();
await page.waitForLoadState('networkidle');
await page.locator('[data-testid="loader"]').waitFor({ state: 'detached' });
};
export const selectDataProductFromTab = async (