From 29b5ee9dcc575148f7774d78c2eb550aad8e652f Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Thu, 5 Sep 2024 22:09:43 +0530 Subject: [PATCH] minor(test): fix ingestion related flaky for aut (#17727) --- .../entity/ingestion/RedshiftWithDBTIngestionClass.ts | 8 ++++---- .../support/entity/ingestion/ServiceBaseClass.ts | 6 ++++-- .../support/entity/ingestion/SnowflakeIngestionClass.ts | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts index d656498e224..8a008a6bdd4 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/RedshiftWithDBTIngestionClass.ts @@ -166,15 +166,15 @@ class RedshiftWithDBTIngestionClass extends ServiceBaseClass { await sidebarClick(page, SidebarItem.TAGS); await page.waitForSelector('[data-testid="data-summary-container"]'); + await page.click( `[data-testid="data-summary-container"] >> text=${DBT.classification}` ); // Verify DBT tag category is added - await page.waitForSelector('[data-testid="tag-name"]'); - const tagName = await page.textContent('[data-testid="tag-name"]'); - - expect(tagName).toContain(DBT.classification); + await page.waitForSelector('[data-testid="loader"]', { + state: 'detached', + }); await page.waitForSelector('.ant-table-row'); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts index 06ea9e2c4a2..b83e0253246 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/ServiceBaseClass.ts @@ -41,6 +41,7 @@ class ServiceBaseClass { protected entityName: string; protected shouldTestConnection: boolean; protected shouldAddIngestion: boolean; + protected entityFQN: string | null; constructor( category: Services, @@ -56,6 +57,7 @@ class ServiceBaseClass { this.entityName = entity; this.shouldTestConnection = shouldTestConnection; this.shouldAddIngestion = shouldAddIngestion; + this.entityFQN = null; } visitService() { @@ -402,7 +404,7 @@ class ServiceBaseClass { // Navigate to ingested table await visitEntityPage({ page, - searchTerm: this.entityName, + searchTerm: this.entityFQN ?? this.entityName, dataTestId: entityDataTestId ?? `${this.serviceName}-${this.entityName}`, }); @@ -446,7 +448,7 @@ class ServiceBaseClass { // Navigate to table name await visitEntityPage({ page, - searchTerm: this.entityName, + searchTerm: this.entityFQN ?? this.entityName, dataTestId: entityDataTestId ?? `${this.serviceName}-${this.entityName}`, }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SnowflakeIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SnowflakeIngestionClass.ts index fa93a00d29f..44046f7ec9a 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SnowflakeIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SnowflakeIngestionClass.ts @@ -29,6 +29,8 @@ class SnowflakeIngestionClass extends ServiceBaseClass { 'CUSTOMER' ); this.schema = 'TPCH_SF1000'; + const database = process.env.PLAYWRIGHT_SNOWFLAKE_DATABASE ?? ''; + this.entityFQN = `${this.serviceName}.${database}.${this.schema}.${this.entityName} `; } async createService(page: Page) {