Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fae3499
fix(playwright): stabilize flaky online users and explore specs
harsh-vador Jul 29, 2026
ed2fbec
fix(playwright): assert empty-placeholder after last tag deletion
Rohit0301 Jul 29, 2026
38f53d5
test(playwright): stabilize owner selector opening
harsh-vador Jul 29, 2026
c3290ef
fix(playwright): accept unmapped explore tab response
harsh-vador Jul 29, 2026
3d395e2
Merge branch 'main' into fix-flaky-playwright-specs
harsh-vador Jul 29, 2026
fab8bfb
Merge branch 'main' into fix-tag-delete-empty-table
Rohit0301 Jul 29, 2026
abf0dfa
fix(playwright): remove owner selector retry loop
harsh-vador Jul 29, 2026
10415e7
test(playwright): fix four flaky lineage/persona/customize specs
chirag-madlani Jul 29, 2026
71c8b4b
test(playwright): retry until widget-info-tabs shows, not modal root
chirag-madlani Jul 29, 2026
6d021a3
fix(playwright): wait for the newly triggered pipeline run, not the p…
ShaileshParmar11 Jul 29, 2026
380cc2f
fix(playwright): treat runId or timestamp as sufficient evidence of a…
ShaileshParmar11 Jul 29, 2026
28f2f00
fix issue with AssetHealthWidget
chirag-madlani Jul 30, 2026
d6347c0
ci(playwright): run Data Quality + Observability specs on DQ/observab…
ShaileshParmar11 Jul 30, 2026
86f274f
fix(ui): make the Asset Health widget E2E spec seed its own tables
siddhant1 Jul 30, 2026
37fcd34
Merge branch 'main' into ShaileshParmar11/flaky-test-rca
ShaileshParmar11 Jul 30, 2026
130d2db
fix(playwright): paginate across pages to find rows in GlossaryTermRe…
anuj-kumary Jul 30, 2026
1f81576
fix(playwright): use waitFor in findRowAcrossPages to avoid stale-DOM…
anuj-kumary Jul 30, 2026
c9829a6
fix(ci): run DQ import/export specs in the dedicated ImportExport lane
ShaileshParmar11 Jul 30, 2026
558ec13
test(playwright): wait for the modal's Yes button, not the antd root
chirag-madlani Jul 30, 2026
e331d94
Revert AssetHealthWidget EMPTY_TABLE_FQN change
chirag-madlani Jul 30, 2026
08ce53b
test(playwright): wait for ES to index 60 subdomains before UI check
chirag-madlani Jul 30, 2026
276ced9
fix(e2e): converge SubDomainPagination on search indexing instead of …
siddhant1 Jul 30, 2026
55b1360
Revert "test(playwright): wait for ES to index 60 subdomains before U…
chirag-madlani Jul 30, 2026
ea7d08b
Merge branch 'main' into fix/subdomain-pagination-search-index-race
siddhant1 Jul 30, 2026
7f1c666
fix(playwright): re-trigger test-suite pipeline when Airflow runs an …
ShaileshParmar11 Jul 30, 2026
055ec75
fix lint checks
anuj-kumary Jul 30, 2026
9ba4c99
Merge branch 'main' into fix/glossary-term-relation-settings-pagination
anuj-kumary Jul 30, 2026
50b17fc
fix(test): correct EditAll-deny assertions in EntityPermissions Playw…
Rohit0301 Jul 30, 2026
1bbbaed
Merge branch 'main' into fix-tag-delete-empty-table
Rohit0301 Jul 30, 2026
c7a498f
Merge PR #30627 into batch
siddhant1 Jul 30, 2026
77a086c
Merge PR #30628 into batch
siddhant1 Jul 30, 2026
ca8134f
Merge PR #30648 into batch
siddhant1 Jul 30, 2026
ac0d638
Merge PR #30655 into batch
siddhant1 Jul 30, 2026
571a1c3
Merge PR #30672 into batch
siddhant1 Jul 30, 2026
98a0311
Merge PR #30685 into batch
siddhant1 Jul 30, 2026
a948c59
Merge PR #30671 into batch
siddhant1 Jul 30, 2026
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
34 changes: 31 additions & 3 deletions .github/playwright/impact-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,40 @@
{
"sources": [
"openmetadata-ui/src/main/resources/ui/src/components/DataQuality/**",
"openmetadata-ui/src/main/resources/ui/src/pages/TestSuite/**",
"openmetadata-service/src/main/java/org/openmetadata/service/resources/tests/**"
"openmetadata-ui/src/main/resources/ui/src/components/IncidentManager/**",
"openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/**",
"openmetadata-ui/src/main/resources/ui/src/components/Alerts/**",
"openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/**",
"openmetadata-ui/src/main/resources/ui/src/pages/IncidentManager/**",
"openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteDetailsPage/**",
"openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/**",
"openmetadata-ui/src/main/resources/ui/src/pages/ProfilerConfigurationPage/**",
"openmetadata-ui/src/main/resources/ui/src/pages/ObservabilityAlertsPage/**",
"openmetadata-ui/src/main/resources/ui/src/pages/AddObservabilityPage/**",
"openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/**",
"openmetadata-ui/src/main/resources/ui/src/rest/testAPI.ts",
"openmetadata-ui/src/main/resources/ui/src/rest/incidentManagerAPI.ts",
"openmetadata-ui/src/main/resources/ui/src/rest/dataQualityDashboardAPI.ts",
"openmetadata-ui/src/main/resources/ui/src/rest/observabilityAPI.ts",
"openmetadata-ui/src/main/resources/ui/src/rest/alertsAPI.ts",
"openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/**",
"openmetadata-ui/src/main/resources/ui/src/utils/Alerts/**",
"openmetadata-ui/src/main/resources/ui/src/utils/Observability*",
"openmetadata-ui/src/main/resources/ui/playwright/utils/incidentManager.ts",
"openmetadata-service/src/main/java/org/openmetadata/service/resources/dqtests/**",
"openmetadata-service/src/main/java/org/openmetadata/service/resources/events/**",
"openmetadata-service/src/main/java/org/openmetadata/service/events/subscription/**",
"openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestCase*.java",
"openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestSuiteRepository.java",
"openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TestDefinitionRepository.java",
"openmetadata-spec/src/main/resources/json/schema/tests/**"
],
"projects": ["chromium", "Basic", "Ingestion", "Reindex"],
"projects": ["chromium", "Basic", "Ingestion", "Reindex", "ImportExport"],
"specs": [
"playwright/e2e/Features/DataQuality/**/*.spec.ts",
"playwright/e2e/Features/IncidentManager.spec.ts",
"playwright/e2e/Flow/ObservabilityAlerts.spec.ts",
"playwright/e2e/Flow/NotificationAlerts.spec.ts",
"playwright/e2e/Pages/TestSuite*.spec.ts"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
userPage: Page;
}>({
adminPage: async ({ browser }, use) => {
const adminPage = await browser.newPage();

Check warning on line 63 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.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

Check warning on line 63 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.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();
},
userPage: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 69 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.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

Check warning on line 69 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CustomizeDetailPage.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 user.login(page);
await use(page);
await page.close();
Expand Down Expand Up @@ -463,8 +463,17 @@
.getByTestId('add-widget-button');
await expect(addWidgetButton).toBeVisible();
await expect(addWidgetButton).toBeEnabled();
await addWidgetButton.click();
await expect(adminPage.getByTestId('widget-info-tabs')).toBeVisible();

// Under CI load the react-grid-layout is still settling after the
// "Add tab" dialog closes; the first click can land on a detaching
// element and never open the widget picker. Retry until the picker's
// inner content appears — `add-widget-modal` itself is the antd
// `.ant-modal-root` wrapper (0×0), which always reports hidden.
const widgetInfoTabs = adminPage.getByTestId('widget-info-tabs');
await expect(async () => {
await addWidgetButton.click();
await expect(widgetInfoTabs).toBeVisible({ timeout: 5000 });
}).toPass({ timeout: 30000 });

await adminPage
.getByTestId('add-widget-modal')
Expand Down Expand Up @@ -607,8 +616,17 @@
.getByTestId('add-widget-button');
await expect(addWidgetButton).toBeVisible();
await expect(addWidgetButton).toBeEnabled();
await addWidgetButton.click();
await expect(adminPage.getByTestId('widget-info-tabs')).toBeVisible();

// Under CI load the react-grid-layout is still settling after the
// "Add tab" dialog closes; the first click can land on a detaching
// element and never open the widget picker. Retry until the picker's
// inner content appears — `add-widget-modal` itself is the antd
// `.ant-modal-root` wrapper (0×0), which always reports hidden.
const widgetInfoTabs = adminPage.getByTestId('widget-info-tabs');
await expect(async () => {
await addWidgetButton.click();
await expect(widgetInfoTabs).toBeVisible({ timeout: 5000 });
}).toPass({ timeout: 30000 });

await adminPage
.getByTestId('add-widget-modal')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,41 @@
* limitations under the License.
*/

import { expect } from '@playwright/test';
import { expect, Page } from '@playwright/test';
import { PLAYWRIGHT_BASIC_TEST_TAG_OBJ } from '../../constant/config';
import { GlobalSettingOptions } from '../../constant/settings';
import { SidebarItem } from '../../constant/sidebar';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { redirectToHomePage } from '../../utils/common';
import { waitForAllLoadersToDisappear } from '../../utils/entity';
import { settingClick, sidebarClick } from '../../utils/sidebar';
import { sidebarClick } from '../../utils/sidebar';
import { test } from '../fixtures/pages';

let testUser: UserClass;

const ONLINE_USERS_PATH = '/settings/members/online-users';

const navigateToOnlineUsersPage = async (page: Page) => {
const onlineUsersRes = page.waitForResponse(
(response) =>
response.url().includes('/api/v1/users/online') &&
response.request().method() === 'GET'
);

await page.goto(ONLINE_USERS_PATH, { waitUntil: 'domcontentloaded' });
await page.waitForURL(`**${ONLINE_USERS_PATH}**`, {
waitUntil: 'domcontentloaded',
});
const onlineUsersResponse = await onlineUsersRes;

expect(onlineUsersResponse.status()).toBe(200);

await waitForAllLoadersToDisappear(page);

await expect(page.getByTestId('online-users-page')).toBeVisible();
await expect(page.getByTestId('online-users-table')).toBeVisible();
};

test.describe('Online Users Feature', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => {
test.beforeAll(async ({ browser }) => {
testUser = new UserClass();
Expand All @@ -39,18 +61,10 @@
await afterAction();
});

test.beforeEach(async ({ page }) => {
await redirectToHomePage(page);
});

test('Should show online users under Settings > Members > Online Users for admins', async ({
page,
}) => {
const onlineUsersRes = page.waitForResponse('/api/v1/users/online?*');
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);
await onlineUsersRes;

await waitForAllLoadersToDisappear(page);
await navigateToOnlineUsersPage(page);

// Verify we're on the Online Users page
await expect(
Expand Down Expand Up @@ -87,7 +101,7 @@
browser,
page,
}) => {
const userPage = await browser.newPage();

Check warning on line 104 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OnlineUsers.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

Check warning on line 104 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OnlineUsers.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
try {
await testUser.login(userPage);
await redirectToHomePage(userPage);
Expand All @@ -97,13 +111,7 @@
await userPage.close();
}

const onlineUsersRes = page.waitForResponse('/api/v1/users/online?*');
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);
await onlineUsersRes;

await waitForAllLoadersToDisappear(page);

await expect(page.getByTestId('online-users-table')).toBeVisible();
await navigateToOnlineUsersPage(page);

const displayName = testUser.responseData.displayName;
const searchResponse = page.waitForResponse(
Expand All @@ -125,13 +133,7 @@
});

test('Should not show bots in online users list', async ({ page }) => {
const onlineUsersRes = page.waitForResponse('/api/v1/users/online?*');
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);
await onlineUsersRes;

await waitForAllLoadersToDisappear(page);

await expect(page.getByTestId('online-users-table')).toBeVisible();
await navigateToOnlineUsersPage(page);

// Verify bot users are not shown (ingestion-bot should not be visible)
const tableRows = page.locator('tbody tr');
Expand All @@ -146,11 +148,7 @@
});

test('Should filter users by time window', async ({ page }) => {
const onlineUsersRes = page.waitForResponse('/api/v1/users/online?*');
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);
await onlineUsersRes;

await waitForAllLoadersToDisappear(page);
await navigateToOnlineUsersPage(page);

const timeFilterDropdown = page.getByTestId('time-window-select');

Expand All @@ -161,9 +159,7 @@
await timeFilterDropdown.click();

// Wait for dropdown to fully render
await page.locator('.ant-select-dropdown:visible').waitFor({
state: 'visible',
});
await expect(page.locator('.ant-select-dropdown:visible')).toBeVisible();

await expect(
page.locator('.ant-select-dropdown:visible [title="Last 5 minutes"]')
Expand All @@ -183,7 +179,9 @@
await page
.locator('.ant-select-dropdown:visible [title="Last hour"]')
.click();
await onlineRes;
const onlineResponse = await onlineRes;

expect(onlineResponse.status()).toBe(200);

// Verify the filter has changed
await expect(timeFilterDropdown).toContainText('Last hour');
Expand All @@ -207,11 +205,7 @@
});

test('Should show correct last activity format', async ({ page }) => {
const onlineUsersRes = page.waitForResponse('/api/v1/users/online?*');
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);
await onlineUsersRes;

await waitForAllLoadersToDisappear(page);
await navigateToOnlineUsersPage(page);
// Check various time formats in the Last Activity column
const activityCells = page.locator('tbody tr td:nth-child(3)');
const count = await activityCells.count();
Expand Down Expand Up @@ -239,7 +233,7 @@
}) => {
test.slow(); // Mark this test as slow since it involves multiple logins and navigation
await test.step('Visit Explore Page as New User', async () => {
const userPage = await browser.newPage();

Check warning on line 236 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OnlineUsers.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

Check warning on line 236 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OnlineUsers.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 testUser.login(userPage);
await redirectToHomePage(userPage);

Expand All @@ -254,9 +248,7 @@
const displayName = testUser.responseData.displayName;

// 2 step - go to online user page and check that user display name should present
await settingClick(page, GlobalSettingOptions.ONLINE_USERS);

await waitForAllLoadersToDisappear(page);
await navigateToOnlineUsersPage(page);

// Search for the user to ensure it is visible in the list
const searchResponse = page.waitForResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
testUserPage: Page;
}>({
page: async ({ browser }, use) => {
const adminPage = await browser.newPage();

Check warning on line 109 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 109 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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
try {
await adminUser.login(adminPage);
await use(adminPage);
Expand All @@ -115,7 +115,7 @@
}
},
testUserPage: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 118 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 118 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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
try {
await testUser.login(page);
await use(page);
Expand Down Expand Up @@ -156,7 +156,7 @@
denyAllPage: Page;
}>({
editAllPage: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 159 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 159 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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
try {
await editAllUser.login(page);
await use(page);
Expand All @@ -165,7 +165,7 @@
}
},
specificEditsPage: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 168 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 168 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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
try {
await specificEditsUser.login(page);
await use(page);
Expand Down Expand Up @@ -226,16 +226,20 @@
}
);

headerPermTest.skip(
headerPermTest(
'EditTier, EditOwners, EditCertification allowed but EditAll denied – edit buttons not visible',
async ({ specificEditsPage }) => {
await headerPermTable.visitEntityPage(specificEditsPage);

await expect(specificEditsPage.getByTestId('edit-tier')).toBeVisible();
await expect(specificEditsPage.getByTestId('edit-owner')).toBeVisible();
await expect(
specificEditsPage.getByTestId('edit-tier')
).not.toBeVisible();
await expect(
specificEditsPage.getByTestId('edit-owner')
).not.toBeVisible();
await expect(
specificEditsPage.getByTestId('edit-certification')
).toBeVisible();
).not.toBeVisible();
}
);
}
Expand Down Expand Up @@ -263,7 +267,7 @@
// Allow permissions tests
test.describe('Allow permissions', () => {
test.beforeAll('Initialize allow permissions', async ({ browser }) => {
const page = await browser.newPage();

Check warning on line 270 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 270 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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(page);
await initializePermissions(page, 'allow', ALL_OPERATIONS);
await assignRoleToUser(page, testUser);
Expand Down Expand Up @@ -299,7 +303,7 @@
}

test.afterAll('Cleanup allow permissions', async ({ browser }) => {
const page = await browser.newPage();

Check warning on line 306 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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

Check warning on line 306 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Permissions/EntityPermissions.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(page);
const { apiContext } = await getApiContext(page);
await cleanupPermissions(apiContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/

import { expect, Page, test } from '@playwright/test';
import { expect, Page, Response, test } from '@playwright/test';
import { redirectToHomePage } from '../../utils/common';

// Maps entityType keys from the API aggregation to the explore left-panel tab testid labels.
Expand All @@ -35,36 +35,61 @@ const ENTITY_TYPE_TO_TAB_TESTID: Record<string, string> = {
};

const SEARCH_URL_FRAGMENT = '/api/v1/search/query';
const SEARCH_QUERY = 'customers';
const SEARCH_RESULT_SIZE = '15';

const getSearchParams = (response: Response) =>
new URL(response.url()).searchParams;

const isSearchQueryResponse = (response: Response, index: string) => {
const searchParams = getSearchParams(response);

return (
response.url().includes(SEARCH_URL_FRAGMENT) &&
response.request().method() === 'GET' &&
searchParams.get('q') === SEARCH_QUERY &&
searchParams.get('index') === index
);
};

const isTabSearchQueryResponse = (response: Response) => {
const searchParams = getSearchParams(response);
const index = searchParams.get('index') ?? '';

return (
isSearchQueryResponse(response, index) &&
searchParams.get('size') === SEARCH_RESULT_SIZE &&
searchParams.get('from') === '0'
);
};

async function runSearchValidation(page: Page): Promise<void> {
const apiCountResPromise = page.waitForResponse(
'api/v1/search/query?q=customers&index=dataAsset&*'
const apiCountResPromise = page.waitForResponse((response) =>
isSearchQueryResponse(response, 'dataAsset')
);

// Capture the initial table tab search response which fires automatically on load
const initialTabSearchResPromise = page.waitForResponse(
(response) =>
response.url().includes(SEARCH_URL_FRAGMENT) &&
response.url().includes('size=15') &&
response.url().includes('from=0') &&
response.request().method() === 'GET'
isTabSearchQueryResponse
);

await page.getByTestId('searchBox').fill('customers');
await page.getByTestId('searchBox').fill(SEARCH_QUERY);
await page.getByTestId('searchBox').press('Enter');

const [apiCountRes, initialTabSearchRes] = await Promise.all([
apiCountResPromise,
initialTabSearchResPromise,
]);

expect(apiCountRes.status()).toBe(200);
expect(initialTabSearchRes.status()).toBe(200);

const countResponseBody = await apiCountRes.json();
const initialTabSearchBody = await initialTabSearchRes.json();
const initialTabSearchIndex = new URL(
initialTabSearchRes.url()
).searchParams.get('index');

// Wait for the explore left panel to appear after search
await page.getByTestId('explore-left-panel').waitFor({ state: 'visible' });
await expect(page.getByTestId('explore-left-panel')).toBeVisible();

const aggregations = countResponseBody?.aggregations ?? {};
const entityTypeBuckets: Array<{ key: string; doc_count: number }> =
Expand All @@ -87,13 +112,11 @@ async function runSearchValidation(page: Page): Promise<void> {
}

const countLocator = tabLocator.getByTestId('filter-count');
const countText = await countLocator.textContent();
const displayedCount = parseInt(countText?.trim() ?? '0', 10);

expect(
displayedCount,
await expect(
countLocator,
`Left panel count for "${bucket.key}" should match API count`
).toBe(bucket.doc_count);
).toHaveText(`${bucket.doc_count}`);
}
});

Expand Down Expand Up @@ -124,16 +147,16 @@ async function runSearchValidation(page: Page): Promise<void> {
} else {
const tabSearchResPromise = page.waitForResponse(
(response) =>
response.url().includes(SEARCH_URL_FRAGMENT) &&
response.url().includes('size=15') &&
response.url().includes('from=0') &&
response.request().method() === 'GET' &&
response.url().includes(`index=${bucket.key}`)
isSearchQueryResponse(response, bucket.key) &&
getSearchParams(response).get('size') === SEARCH_RESULT_SIZE &&
getSearchParams(response).get('from') === '0'
);

await tabLocator.click();

const tabSearchRes = await tabSearchResPromise;
expect(tabSearchRes.status()).toBe(200);

tabSearchBody = await tabSearchRes.json();
}

Expand Down
Loading
Loading