From c00146e95b732b460bf23f837370491c51253a27 Mon Sep 17 00:00:00 2001 From: Pranita Fulsundar Date: Fri, 12 Sep 2025 18:09:39 +0530 Subject: [PATCH] fix: policies.spec.ts (#23366) --- .../ui/playwright/e2e/Pages/Policies.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Policies.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Policies.spec.ts index ce353fb9c09..03752b6244c 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Policies.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Policies.spec.ts @@ -87,12 +87,16 @@ const addRule = async ( test.describe('Policy page should work properly', () => { test.beforeEach('Visit entity details page', async ({ page }) => { + test.slow(true); + await redirectToHomePage(page); await settingClick(page, GlobalSettingOptions.POLICIES); await page.waitForSelector('[data-testid="loader"]', { state: 'detached' }); }); test('Add new policy with invalid condition', async ({ page }) => { + test.slow(true); + await test.step( 'Default Policies and Roles should be displayed', async () => { @@ -292,11 +296,18 @@ test.describe('Policy page should work properly', () => { await page.waitForSelector('[data-testid="loader"]', { state: 'detached', }); + const policyElement = page.locator('[data-testid="policy-name"]', { + hasText: UPDATED_POLICY_NAME, + }); + await getElementWithPagination(page, policyElement, false); + // Click on delete action button await page .locator(`[data-testid="delete-action-${UPDATED_POLICY_NAME}"]`) .click({ force: true }); + await expect(page.locator('[role="dialog"].ant-modal')).toBeVisible(); + // Type 'DELETE' in the confirmation text input await page .locator('[data-testid="confirmation-text-input"]') @@ -313,6 +324,11 @@ test.describe('Policy page should work properly', () => { }); test('Policy should have associated rules and teams', async ({ page }) => { + const policyElement = page.locator('[data-testid="policy-name"]', { + hasText: DEFAULT_POLICIES.organizationPolicy, + }); + await getElementWithPagination(page, policyElement, false); + const policyResponsePromise = page.waitForResponse( '/api/v1/policies/name/OrganizationPolicy?fields=owners%2Clocation%2Cteams%2Croles' );