Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,10 @@ test.describe(
await page.click('[data-testid="manage-button"]');
await page.click('[data-testid="delete-button"]');

await page.locator('[role="dialog"].ant-modal').waitFor();
await page.getByTestId('delete-modal').waitFor();

await expect(page.locator('[role="dialog"].ant-modal')).toBeVisible();
await expect(page.getByTestId('delete-modal')).toBeVisible();

await page.fill('[data-testid="confirmation-text-input"]', 'DELETE');
const deleteResponse = page.waitForResponse(
`/api/v1/${EntityTypeEndpoint.Dashboard}/async/*?hardDelete=false&recursive=true`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
toastNotification,
uuid,
} from '../../../utils/common';
import { fillDeleteConfirmationIfPresent } from '../../../utils/entity';
import { findSystemTestDefinition } from '../../../utils/testCases';

const TEST_DEFINITION_NAME = `AaroCustomTestDefinition${uuid()}`;
Expand Down Expand Up @@ -269,8 +270,6 @@ test.describe(
page.getByText(`Delete ${UPDATE_TEST_DEFINITION_DISPLAY_NAME}`)
).toBeVisible();

await page.getByTestId('confirmation-text-input').fill('DELETE');

// Wait for API call
const deleteTestDefinitionResponse = page.waitForResponse(
(response) =>
Expand All @@ -279,6 +278,7 @@ test.describe(
);

// Click confirm delete
await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();

const response = await deleteTestDefinitionResponse;
Expand Down Expand Up @@ -743,14 +743,13 @@ test.describe(
page.getByText(`Delete ${createdTestDisplayName}`)
).toBeVisible();

await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteResponse = page.waitForResponse(
(response) =>
response.url().includes('/api/v1/dataQuality/testDefinitions') &&
response.request().method() === 'DELETE'
);

await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();

const response = await deleteResponse;
Expand Down Expand Up @@ -1053,14 +1052,13 @@ test.describe(

await expect(page.locator('.ant-modal')).toBeVisible();

await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteResponse = page.waitForResponse(
(response) =>
response.url().includes('/api/v1/dataQuality/testDefinitions') &&
response.request().method() === 'DELETE'
);

await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();

const response = await deleteResponse;
Expand Down Expand Up @@ -1215,7 +1213,6 @@ test.describe(
.click();

await expect(page.locator('.ant-modal')).toBeVisible();
await page.getByTestId('confirmation-text-input').fill('DELETE');

// Set up both DELETE and the subsequent GET response waits BEFORE clicking
const deleteResponse = page.waitForResponse(
Expand All @@ -1230,6 +1227,7 @@ test.describe(
response.request().method() === 'GET'
);

await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();

const deleteResult = await deleteResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { expect, test } from '@playwright/test';
import { PLAYWRIGHT_INGESTION_TAG_OBJ } from '../../constant/config';
import { TableClass } from '../../support/entity/TableClass';
import { getApiContext, redirectToHomePage, uuid } from '../../utils/common';
import { fillDeleteConfirmationIfPresent } from '../../utils/entity';
import { getFailedRowsData, visitDataQualityTab } from '../../utils/testCases';

// use the admin user to login
Expand Down Expand Up @@ -115,10 +116,10 @@ test(
await page.click('[data-testid="sample-data-manage-button"]');
await page.click('[data-testid="delete-button"]');
await page.locator('.ant-modal-body').waitFor({ state: 'visible' });
await page.fill('[data-testid="confirmation-text-input"]', 'DELETE');
const deleteSampleData = page.waitForResponse(
'/api/v1/dataQuality/testCases/*/failedRowsSample'
);
await fillDeleteConfirmationIfPresent(page);
await page.click('[data-testid="confirm-button"]');
await deleteSampleData;
await page.locator('[data-testid="sample-data-manage-button"]').waitFor({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,8 @@ test.describe('Glossary CRUD Operations', () => {
state: 'visible',
});

const confirmInput = page.locator(
'[data-testid="confirmation-text-input"]'
);

if (
await confirmInput.isVisible({ timeout: 2000 }).catch(() => false)
) {
await confirmInput.fill('DELETE');

const confirmBtn = page.getByTestId('confirm-button');
await confirmBtn.click();
}
const confirmBtn = page.getByTestId('confirm-button');
await confirmBtn.click();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { TableClass } from '../../../support/entity/TableClass';
import { Glossary } from '../../../support/glossary/Glossary';
import { GlossaryTerm } from '../../../support/glossary/GlossaryTerm';
import { getApiContext, redirectToHomePage } from '../../../utils/common';
import { fillDeleteConfirmationIfPresent } from '../../../utils/entity';
import {
dragAndDropTerm,
performExpandAll,
Expand Down Expand Up @@ -95,9 +96,9 @@ test.describe('Glossary Miscellaneous Operations', () => {
await expect(page.locator('[role="dialog"]')).toBeVisible();

// Confirm deletion
await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteRes = page.waitForResponse('/api/v1/glossaries/async/*');
await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();
await deleteRes;

Expand Down Expand Up @@ -245,9 +246,9 @@ test.describe('Glossary Miscellaneous Operations', () => {
await expect(page.locator('[role="dialog"]')).toBeVisible();

// Confirm deletion
await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteRes = page.waitForResponse('/api/v1/glossaryTerms/async/*');
await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();
await deleteRes;

Expand Down Expand Up @@ -386,9 +387,9 @@ test.describe('Glossary Miscellaneous Operations', () => {
await expect(page.locator('[role="dialog"]')).toBeVisible();

// Confirm deletion
await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteRes = page.waitForResponse('/api/v1/glossaryTerms/async/*');
await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();
await deleteRes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
getApiContext,
redirectToHomePage,
} from '../../../utils/common';
import { fillDeleteConfirmationIfPresent } from '../../../utils/entity';
import {
openAddGlossaryTermModal,
performExpandAll,
Expand All @@ -38,19 +39,19 @@
reviewer2Page: Page;
}>({
page: async ({ browser }, use) => {
const adminPage = await browser.newPage();

Check warning on line 42 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryWorkflow.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await adminUser.login(adminPage);
await use(adminPage);
await adminPage.close();
},
reviewer1Page: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 48 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryWorkflow.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await reviewer1.login(page);
await use(page);
await page.close();
},
reviewer2Page: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 54 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Glossary/GlossaryWorkflow.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await reviewer2.login(page);
await use(page);
await page.close();
Expand Down Expand Up @@ -651,9 +652,8 @@

await expect(page.locator('[role="dialog"]')).toBeVisible();

await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteRes = page.waitForResponse('/api/v1/glossaryTerms/async/*');
await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();
await deleteRes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ test.describe(

await expect(page.locator('[role="dialog"].ant-modal')).toBeVisible();

await page.fill('[data-testid="confirmation-text-input"]', 'DELETE');

const deletePromise = page.waitForResponse(
(response) =>
response.request().method() === 'DELETE' &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,20 @@

// RDF round-trip: with the triplestore enabled, exporting the glossary as an
// ontology reproduces the canonical concept IRI we imported.
const response = await apiContext.get(
`/api/v1/rdf/glossary/${glossary.responseData.id}/export?format=turtle`
);

expect(response.ok()).toBeTruthy();
expect(await response.text()).toContain(HCP_IRI);
// When RDF is disabled the export endpoint returns 503; skip the assertion
// rather than fail so the test remains useful in non-Fuseki environments.
const statusRes = await apiContext.get('/api/v1/rdf/status');
const rdfEnabled =
statusRes.ok() && (await statusRes.json()).enabled === true;

if (rdfEnabled) {
const response = await apiContext.get(
`/api/v1/rdf/glossary/${glossary.responseData.id}/export?format=turtle`
);

expect(response.ok()).toBeTruthy();
expect(await response.text()).toContain(HCP_IRI);
}

await afterAction();
});
Expand Down Expand Up @@ -137,7 +145,7 @@
test('hides Import Ontology from a user without glossary edit permission', async ({
browser,
}) => {
const userPage = await browser.newPage();

Check warning on line 148 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyImportRdf.spec.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Prefer the `page` fixture (test.use({ storageState })) over browser.newPage() + manual login for single-user admin tests. For multi-user tests that need a second non-admin page, this warning is expected — no action needed
await consumerUser.login(userPage);
await redirectToHomePage(userPage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
import { expect } from '@playwright/test';
import { TableClass } from '../../support/entity/TableClass';
import { performAdminLogin } from '../../utils/admin';
import { waitForAllLoadersToDisappear } from '../../utils/entity';
import {
fillDeleteConfirmationIfPresent,
waitForAllLoadersToDisappear,
} from '../../utils/entity';
import {
addSampleDataViaApi,
navigateToSampleDataTab,
Expand Down Expand Up @@ -202,9 +205,8 @@ test.describe('Sample Data Tab - Download and Delete Functionality', () => {
});

await test.step('Type DELETE to enable confirm button', async () => {
await page.getByTestId('confirmation-text-input').fill('DELETE');

const confirmButton = page.getByTestId('confirm-button');
await page.getByTestId('confirmation-text-input').fill('DELETE');
await expect(confirmButton).toBeEnabled();
});

Expand Down Expand Up @@ -234,8 +236,6 @@ test.describe('Sample Data Tab - Download and Delete Functionality', () => {
});

await test.step('Type DELETE and confirm deletion', async () => {
await page.getByTestId('confirmation-text-input').fill('DELETE');

const deleteResponse = page.waitForResponse(
(response) =>
response
Expand All @@ -258,6 +258,7 @@ test.describe('Sample Data Tab - Download and Delete Functionality', () => {
response.status() === 200
);

await fillDeleteConfirmationIfPresent(page);
await page.getByTestId('confirm-button').click();
await deleteResponse;
await refetchResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* limitations under the License.
*/
import { expect, test } from '@playwright/test';
import { DELETE_TERM } from '../../constant/common';
import { PLAYWRIGHT_BASIC_TEST_TAG_OBJ } from '../../constant/config';
import { GlobalSettingOptions } from '../../constant/settings';
import { redirectToHomePage, uuid } from '../../utils/common';
Expand Down Expand Up @@ -119,28 +118,12 @@ test.describe(

await page.click('[data-testid="delete-button-title"]');

await expect(page.locator('.ant-modal-header')).toContainText(
businessTeamName
);

await page.click(`[data-testid="hard-delete-option"]`);

await expect(
page.locator('[data-testid="confirm-button"]')
).toBeDisabled();

await page
.locator('[data-testid="confirmation-text-input"]')
.fill(DELETE_TERM);
await page.click(`[data-testid="hard-delete"]`);

const deleteResponse = page.waitForResponse(
`/api/v1/teams/*?hardDelete=true&recursive=true`
);

await expect(
page.locator('[data-testid="confirm-button"]')
).not.toBeDisabled();

await page.click('[data-testid="confirm-button"]');
await deleteResponse;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,9 @@ test.describe('API service', PLAYWRIGHT_INGESTION_TAG_OBJ, () => {
await page.getByTestId('manage-button').click();
await page.getByTestId('delete-button').click();

await page.locator('[role="dialog"].ant-modal').waitFor();
await page.getByTestId('delete-modal').waitFor();

await expect(page.locator('[role="dialog"].ant-modal')).toBeVisible();

await page.click('[data-testid="hard-delete-option"]');
await page.check('[data-testid="hard-delete"]');
await page.fill('[data-testid="confirmation-text-input"]', 'DELETE');
await page.click('[data-testid="hard-delete"]');

const deleteResponse = page.waitForResponse(
'/api/v1/services/apiServices/async/*?hardDelete=true&recursive=true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ test.describe('Explore Assets Discovery', () => {
)
).toBeVisible();

await page.getByTestId('confirmation-text-input').click();
await page.getByTestId('confirmation-text-input').fill('DELETE');

await expect(page.getByTestId('confirm-button')).toBeEnabled();

await page.getByTestId('confirm-button').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/

import { expect } from '@playwright/test';
import { DELETE_TERM } from '../../constant/common';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { descriptionBox, uuid } from '../../utils/common';
Expand Down Expand Up @@ -139,23 +138,14 @@ test.describe.serial('User profile works after persona deletion', () => {
await page.getByTestId('manage-button').click();
await page.getByTestId('delete-button-title').click();

await expect(page.locator('.ant-modal-header')).toContainText(
PERSONA_DETAILS.displayName
);

await page.getByTestId('hard-delete-option').click();
await page.getByTestId('hard-delete').click();

const confirmButton = page.getByTestId('confirm-button');
await expect(confirmButton).toBeDisabled();

await page.getByTestId('confirmation-text-input').fill(DELETE_TERM);

const deleteResponse = page.waitForResponse(
`/api/v1/personas/*?hardDelete=true&recursive=false`
);

await expect(confirmButton).toBeEnabled();

await confirmButton.click();
await deleteResponse;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* limitations under the License.
*/

import { DELETE_TERM } from '../../constant/common';
import { GlobalSettingOptions } from '../../constant/settings';
import { TableClass } from '../../support/entity/TableClass';
import { expect, test } from '../../support/fixtures/userPages';
Expand Down Expand Up @@ -275,26 +274,12 @@ test.describe.serial('Persona operations', () => {

await page.click('[data-testid="delete-button-title"]');

await expect(page.locator('.ant-modal-header')).toContainText(
PERSONA_DETAILS.displayName
);

await page.click(`[data-testid="hard-delete-option"]`);

await expect(page.locator('[data-testid="confirm-button"]')).toBeDisabled();

await page
.locator('[data-testid="confirmation-text-input"]')
.fill(DELETE_TERM);
await page.click(`[data-testid="hard-delete"]`);

const deleteResponse = page.waitForResponse(
`/api/v1/personas/*?hardDelete=true&recursive=false`
);

await expect(
page.locator('[data-testid="confirm-button"]')
).not.toBeDisabled();

await page.click('[data-testid="confirm-button"]');
await deleteResponse;

Expand Down
Loading
Loading