mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-30 19:36:41 +00:00
fix: policies.spec.ts (#23366)
This commit is contained in:
parent
d5ca346270
commit
c00146e95b
@ -87,12 +87,16 @@ const addRule = async (
|
|||||||
|
|
||||||
test.describe('Policy page should work properly', () => {
|
test.describe('Policy page should work properly', () => {
|
||||||
test.beforeEach('Visit entity details page', async ({ page }) => {
|
test.beforeEach('Visit entity details page', async ({ page }) => {
|
||||||
|
test.slow(true);
|
||||||
|
|
||||||
await redirectToHomePage(page);
|
await redirectToHomePage(page);
|
||||||
await settingClick(page, GlobalSettingOptions.POLICIES);
|
await settingClick(page, GlobalSettingOptions.POLICIES);
|
||||||
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
|
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Add new policy with invalid condition', async ({ page }) => {
|
test('Add new policy with invalid condition', async ({ page }) => {
|
||||||
|
test.slow(true);
|
||||||
|
|
||||||
await test.step(
|
await test.step(
|
||||||
'Default Policies and Roles should be displayed',
|
'Default Policies and Roles should be displayed',
|
||||||
async () => {
|
async () => {
|
||||||
@ -292,11 +296,18 @@ test.describe('Policy page should work properly', () => {
|
|||||||
await page.waitForSelector('[data-testid="loader"]', {
|
await page.waitForSelector('[data-testid="loader"]', {
|
||||||
state: 'detached',
|
state: 'detached',
|
||||||
});
|
});
|
||||||
|
const policyElement = page.locator('[data-testid="policy-name"]', {
|
||||||
|
hasText: UPDATED_POLICY_NAME,
|
||||||
|
});
|
||||||
|
await getElementWithPagination(page, policyElement, false);
|
||||||
|
|
||||||
// Click on delete action button
|
// Click on delete action button
|
||||||
await page
|
await page
|
||||||
.locator(`[data-testid="delete-action-${UPDATED_POLICY_NAME}"]`)
|
.locator(`[data-testid="delete-action-${UPDATED_POLICY_NAME}"]`)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
|
|
||||||
|
await expect(page.locator('[role="dialog"].ant-modal')).toBeVisible();
|
||||||
|
|
||||||
// Type 'DELETE' in the confirmation text input
|
// Type 'DELETE' in the confirmation text input
|
||||||
await page
|
await page
|
||||||
.locator('[data-testid="confirmation-text-input"]')
|
.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 }) => {
|
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(
|
const policyResponsePromise = page.waitForResponse(
|
||||||
'/api/v1/policies/name/OrganizationPolicy?fields=owners%2Clocation%2Cteams%2Croles'
|
'/api/v1/policies/name/OrganizationPolicy?fields=owners%2Clocation%2Cteams%2Croles'
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user