diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/IngestionBot.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/IngestionBot.spec.ts index c7f7152f33e..92eb96b90a8 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/IngestionBot.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/IngestionBot.spec.ts @@ -108,12 +108,14 @@ test.describe('Ingestion Bot ', () => { // Add assets to domain 1 await redirectToHomePage(page); await sidebarClick(page, SidebarItem.DOMAIN); + await page.waitForLoadState('networkidle'); await selectDomain(page, domain1.data); await addAssetsToDomain(page, domain1, domainAsset1); // Add assets to domain 2 await redirectToHomePage(page); await sidebarClick(page, SidebarItem.DOMAIN); + await page.waitForLoadState('networkidle'); await selectDomain(page, domain2.data); await addAssetsToDomain(page, domain2, domainAsset2); }); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts index 092a979c09d..7171acdcf06 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/PersonaDeletionUserProfile.spec.ts @@ -11,24 +11,16 @@ * limitations under the License. */ -import { expect, test } from '@playwright/test'; +import { expect } from '@playwright/test'; import { DELETE_TERM } from '../../constant/common'; import { GlobalSettingOptions } from '../../constant/settings'; import { UserClass } from '../../support/user/UserClass'; -import { - createNewPage, - descriptionBox, - redirectToHomePage, - uuid, -} from '../../utils/common'; +import { performAdminLogin } from '../../utils/admin'; +import { descriptionBox, redirectToHomePage, uuid } from '../../utils/common'; import { validateFormNameFieldInput } from '../../utils/form'; import { setPersonaAsDefault } from '../../utils/persona'; import { settingClick } from '../../utils/sidebar'; - -// use the admin user to login -test.use({ - storageState: 'playwright/.auth/admin.json', -}); +import { test } from '../fixtures/pages'; const PERSONA_DETAILS = { name: `test-persona-${uuid()}`, @@ -46,13 +38,13 @@ test.describe.serial('User profile works after persona deletion', () => { const user = new UserClass(); test.beforeAll('Create user', async ({ browser }) => { - const { apiContext, afterAction } = await createNewPage(browser); + const { apiContext, afterAction } = await performAdminLogin(browser); await user.create(apiContext); await afterAction(); }); test.afterAll('Cleanup', async ({ browser }) => { - const { apiContext, afterAction } = await createNewPage(browser); + const { apiContext, afterAction } = await performAdminLogin(browser); await user.delete(apiContext); await afterAction(); }); @@ -118,8 +110,11 @@ test.describe.serial('User profile works after persona deletion', () => { // Step 2: Navigate directly to user profile and verify persona is shown await test.step('Verify persona appears on user profile', async () => { // Go directly to user profile URL - await page.goto(`http://localhost:8585/users/${user.responseData.name}`); + await page.goto(`/users/${user.responseData.name}`); await page.waitForLoadState('networkidle'); + await page.waitForSelector('[data-testid="loader"]', { + state: 'detached', + }); // Check if persona appears on the user profile const personaCard = page.getByTestId('persona-details-card'); @@ -187,9 +182,7 @@ test.describe.serial('User profile works after persona deletion', () => { 'Verify user profile still loads after persona deletion', async () => { // Go directly to user profile URL again - await page.goto( - `http://localhost:8585/users/${user.responseData.name}` - ); + await page.goto(`/users/${user.responseData.name}`); await page.waitForLoadState('networkidle'); // User profile should load without errors diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts index 5ac4cac5e20..bf479b518b1 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataContracts.spec.ts @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { expect, Page, test as base } from '@playwright/test'; +import { test as base, expect, Page } from '@playwright/test'; import { DATA_CONTRACT_DETAILS, DATA_CONTRACT_SEMANTICS1, @@ -28,6 +28,7 @@ import { TagClass } from '../../support/tag/TagClass'; import { UserClass } from '../../support/user/UserClass'; import { performAdminLogin } from '../../utils/admin'; import { selectOption } from '../../utils/advancedSearch'; +import { resetTokenFromBotPage } from '../../utils/bot'; import { clickOutside, redirectToHomePage, @@ -65,7 +66,7 @@ test.describe('Data Contracts', () => { test.beforeAll('Setup pre-requests', async ({ browser }) => { test.slow(true); - const { apiContext, afterAction } = await performAdminLogin(browser); + const { apiContext, afterAction, page } = await performAdminLogin(browser); await table.create(apiContext); await testClassification.create(apiContext); await testTag.create(apiContext); @@ -101,6 +102,12 @@ test.describe('Data Contracts', () => { }, ], }); + + if (!process.env.PLAYWRIGHT_IS_OSS) { + // Todo: Remove this patch once the issue is fixed #19140 + await resetTokenFromBotPage(page, 'testsuite-bot'); + } + await afterAction(); });