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); await selectDomain(page, domain.data);
// Create sub domain // Create sub domain
await createSubDomain(page, subDomain.data); await createSubDomain(page, subDomain.data);
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.DOMAIN);
await selectSubDomain(page, domain.data, subDomain.data); await selectSubDomain(page, domain.data, subDomain.data);
await verifyDomain(page, subDomain.data, domain.data, false); await verifyDomain(page, subDomain.data, domain.data, false);
// Follow domain // Follow domain
await followEntity(page, EntityTypeEndpoint.Domain); await followEntity(page, EntityTypeEndpoint.Domain);
await redirectToHomePage(page); await redirectToHomePage(page);
await page.waitForLoadState('networkidle');
// Check that the followed domain is shown in the following widget // Check that the followed domain is shown in the following widget
await expect( await expect(
@ -426,10 +429,14 @@ test.describe('Domains', () => {
page.locator('[data-testid="following-widget"]') page.locator('[data-testid="following-widget"]')
).toContainText(subDomain.data.displayName); ).toContainText(subDomain.data.displayName);
await sidebarClick(page, SidebarItem.DOMAIN); const subDomainRes = page.waitForResponse('/api/v1/domains/name/*');
await selectDomain(page, domain.data); await page
await selectSubDomain(page, domain.data, subDomain.data); .locator('[data-testid="following-widget"]')
await verifyDomain(page, subDomain.data, domain.data, false); .getByText(subDomain.data.displayName)
.click();
await subDomainRes;
// Unfollow domain // Unfollow domain
await unFollowEntity(page, EntityTypeEndpoint.Domain); await unFollowEntity(page, EntityTypeEndpoint.Domain);
await redirectToHomePage(page); await redirectToHomePage(page);
@ -443,7 +450,6 @@ test.describe('Domains', () => {
).not.toContainText(subDomain.data.displayName); ).not.toContainText(subDomain.data.displayName);
await sidebarClick(page, SidebarItem.DOMAIN); await sidebarClick(page, SidebarItem.DOMAIN);
await selectDomain(page, domain.data);
await selectSubDomain(page, domain.data, subDomain.data); await selectSubDomain(page, domain.data, subDomain.data);
await verifyDomain(page, subDomain.data, domain.data, false); 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', 'Check domain management permissions for data consumer owner',
async () => { async () => {
await sidebarClick(dataConsumerPage, SidebarItem.DOMAIN); await sidebarClick(dataConsumerPage, SidebarItem.DOMAIN);
await selectDomain(dataConsumerPage, testResources.domainForTest.data);
await dataConsumerPage.locator('[data-testid="loader"]').waitFor({ const permissionRes = dataConsumerPage.waitForResponse(
state: 'detached', '/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(); 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?*'); const searchRes = page.waitForResponse('/api/v1/search/query?*');
await page.click('[data-testid="search-entity-select"]'); await page.click('[data-testid="search-entity-select"]');
await page.keyboard.type(tableServiceFqn); await page.keyboard.type(topicServiceFqn);
await searchRes; await searchRes;
const lineageRes = page.waitForResponse('/api/v1/lineage/getLineage?*'); 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; await lineageRes;
const tableServiceNode = page.locator( const tableServiceNode = page.locator(

View File

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