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 @@ -30,7 +30,6 @@ import { REACTION_EMOJIS, reactOnFeedCard } from '../../utils/activityFeed';
import { performAdminLogin } from '../../utils/admin';
import {
redirectToHomePage,
removeLandingBanner,
uuid,
visitOwnProfilePage,
} from '../../utils/common';
Expand Down Expand Up @@ -168,7 +167,6 @@ test.describe('FeedWidget on landing page', () => {
try {
// Set persona as default
await redirectToHomePage(adminPage);
await removeLandingBanner(adminPage);
await waitForAllLoadersToDisappear(adminPage);
await setUserDefaultPersona(adminPage, testPersona.data.displayName);

Expand Down Expand Up @@ -199,7 +197,6 @@ test.describe('FeedWidget on landing page', () => {
}

await redirectToHomePage(adminPage);
await removeLandingBanner(adminPage);
await waitForAllLoadersToDisappear(adminPage);
} finally {
await adminPage.close();
Expand All @@ -224,7 +221,6 @@ test.describe('FeedWidget on landing page', () => {
test.beforeEach(async ({ page }) => {
await adminUser.login(page);
await redirectToHomePage(page);
await removeLandingBanner(page);
await waitForAllLoadersToDisappear(page);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import { selectOption } from '../../utils/advancedSearch';
import { redirectToHomePage, removeLandingBanner } from '../../utils/common';
import { redirectToHomePage } from '../../utils/common';
import {
addCuratedAssetPlaceholder,
CURATED_ASSETS_WIDGET_KEY,
Expand Down Expand Up @@ -63,7 +63,7 @@

const test = base.extend<{ page: Page }>({
page: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 66 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/CuratedAssets.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 use(page);
await page.close();
Expand Down Expand Up @@ -101,7 +101,6 @@

await setUserDefaultPersona(page, persona.responseData.displayName);
await redirectToHomePage(page);
await removeLandingBanner(page);

await page.getByTestId('sidebar-toggle').click();
});
Expand Down Expand Up @@ -188,7 +187,6 @@
).toBeVisible();

await redirectToHomePage(page);
await removeLandingBanner(page);

await waitForAllLoadersToDisappear(page, 'entity-list-skeleton');

Expand Down Expand Up @@ -387,7 +385,6 @@
// Wait for auto-save to complete before navigating

await redirectToHomePage(page);
await removeLandingBanner(page);

await waitForAllLoadersToDisappear(page, 'entity-list-skeleton');

Expand Down Expand Up @@ -503,7 +500,6 @@

// Navigate to landing page to verify widget
await redirectToHomePage(page);
await removeLandingBanner(page);

await waitForAllLoadersToDisappear(page, 'entity-list-skeleton');

Expand Down Expand Up @@ -646,7 +642,6 @@

// Navigate to landing page to verify widget
await redirectToHomePage(page);
await removeLandingBanner(page);

await waitForAllLoadersToDisappear(page, 'entity-list-skeleton');

Expand Down Expand Up @@ -685,7 +680,6 @@
await page.locator('[data-testid="save-button"]').click();

await redirectToHomePage(page);
await removeLandingBanner(page);

// Verify placeholder is not visible when no widget is configured
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { PersonaClass } from '../../../support/persona/PersonaClass';
import { UserClass } from '../../../support/user/UserClass';
import { performAdminLogin } from '../../../utils/admin';
import { redirectToHomePage, removeLandingBanner } from '../../../utils/common';
import { redirectToHomePage } from '../../../utils/common';
import {
addAndVerifyWidget,
setUserDefaultPersona,
Expand Down Expand Up @@ -59,7 +59,7 @@

const test = base.extend<{ page: Page }>({
page: async ({ browser }, use) => {
const page = await browser.newPage();

Check warning on line 62 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/LandingPageWidgets/DomainDataProductsWidgets.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 use(page);
await page.close();
Expand Down Expand Up @@ -95,7 +95,6 @@
test.slow(); // Slow Test
test.beforeEach(async ({ page }, testInfo) => {
await redirectToHomePage(page, false);
await removeLandingBanner(page);
await waitForAllLoadersToDisappear(page).catch(() => undefined);

if (testInfo.title !== 'Assign Widgets') {
Expand All @@ -112,7 +111,6 @@
dataProduct.responseData.id ?? ''
);
await redirectToHomePage(page, false);
await removeLandingBanner(page);
await waitForAllLoadersToDisappear(page).catch(() => undefined);
}
});
Expand All @@ -134,7 +132,6 @@

test('Verify Widgets are having 0 count initially', async ({ page }) => {
await redirectToHomePage(page, false);
await removeLandingBanner(page);
await waitForAllLoadersToDisappear(page).catch(() => undefined);

await verifyWidgetCountOnCurrentPage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
import { PersonaClass } from '../../support/persona/PersonaClass';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import {
redirectToHomePage,
removeLandingBanner,
toastNotification,
} from '../../utils/common';
import { redirectToHomePage, toastNotification } from '../../utils/common';
import {
checkAllDefaultWidgets,
navigateToCustomizeLandingPage,
Expand Down Expand Up @@ -98,7 +94,7 @@
// the stock layout instead of the persona's customizable one.
void persona;

const adminPage = await browser.newPage();

Check warning on line 97 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeLandingPage.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(adminPage);
await use(adminPage);
await adminPage.close();
Expand Down Expand Up @@ -339,7 +335,6 @@

await saveCustomizeLayoutPage(adminPage);
await redirectToHomePage(adminPage, false);
await removeLandingBanner(adminPage);
await waitForAllLoadersToDisappear(adminPage).catch(() => undefined);

await waitForLandingPageWidget(adminPage, 'KnowledgePanel.MyData');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import { UserClass } from '../../support/user/UserClass';
import { insertActivityEventForTest } from '../../utils/activityAPI';
import { performAdminLogin } from '../../utils/admin';
import {
getApiContext,
redirectToHomePage,
removeLandingBanner,
} from '../../utils/common';
import { getApiContext, redirectToHomePage } from '../../utils/common';
import {
addAndVerifyWidget,
removeAndVerifyWidget,
Expand Down Expand Up @@ -127,7 +123,7 @@
// the stock layout instead of the persona's customizable one.
void persona;

const page = await browser.newPage();

Check warning on line 126 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Flow/CustomizeWidgets.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(page);
await use(page);
await page.close();
Expand Down Expand Up @@ -238,7 +234,6 @@

test.beforeEach(async ({ page }) => {
await redirectToHomePage(page);
await removeLandingBanner(page);
await waitForAllLoadersToDisappear(page);
await waitForAllLoadersToDisappear(page, 'entity-list-skeleton');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ test.describe(
});

test.beforeEach('Visit entity details page', async ({ page }) => {
await user.login(page);
// Tour is entered from the welcome banner, so this suite must NOT suppress
// it. The other tour tests already guard against the banner if present.
await user.login(page, undefined, undefined, {
suppressWelcomeScreen: false,
});
});

test('Tour should work from help section', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* limitations under the License.
*/

import { Page } from '@playwright/test';
import { KnowledgeCenterClass } from '../../support/entity/KnowledgeCenterClass';
import { expect, test as baseTest } from '../../support/fixtures/userPages';
import { Glossary } from '../../support/glossary/Glossary';
Expand Down Expand Up @@ -68,6 +69,31 @@ export const test = baseTest.extend<{
},
});

/**
* Assert the owner chip is in the summary panel, re-opening the entity if it is
* not. The panel renders owners from the Explore search document, which is
* refreshed asynchronously after the owner PATCH — a panel that rendered before
* that refresh will never show the chip, so waiting on it is waiting on the
* wrong thing. Re-navigating re-reads it.
*/
async function expectOwnerInPanel(
page: Page,
entityName: string,
ownerName: string
) {
const ownerChip = page
.locator('[data-testid="entity-summary-panel-container"]')
.getByTestId(ownerName);

await expect(async () => {
if (!(await ownerChip.isVisible())) {
await navigateToKCEntity(page, entityName);
}

await expect(ownerChip).toBeVisible({ timeout: 10_000 });
}).toPass({ timeout: 60_000, intervals: [2_000, 5_000] });
}

test.describe('Knowledge Center Right Panel Test Suite', () => {
test.beforeAll(async ({ browser }) => {
test.slow(true);
Expand Down Expand Up @@ -163,7 +189,6 @@ test.describe('Knowledge Center Right Panel Test Suite', () => {
test('Should update owners for knowledgeCenter', async ({
adminPage,
rightPanel,
overview,
}) => {
await navigateToKCEntity(
adminPage,
Expand All @@ -174,7 +199,11 @@ test.describe('Knowledge Center Right Panel Test Suite', () => {
rightPanel.setEntityConfigByType('knowledgeCenter');

await addOwnerInKCPanel(adminPage, user1.getUserDisplayName());
await overview.shouldShowOwner(user1.getUserDisplayName());
await expectOwnerInPanel(
adminPage,
getEntityDisplayName(knowledgeCenter.responseData),
user1.getUserDisplayName()
);
});
});

Expand Down Expand Up @@ -277,7 +306,11 @@ test.describe('Knowledge Center Right Panel Test Suite', () => {
rightPanel.setEntityConfigByType('knowledgeCenter');

await addOwnerInKCPanel(adminPage, user1.getUserDisplayName());
await overview.shouldShowOwner(user1.getUserDisplayName());
await expectOwnerInPanel(
adminPage,
getEntityDisplayName(knowledgeCenter.responseData),
user1.getUserDisplayName()
);

await overview.removeOwner([user1.getUserDisplayName()], 'Users');
await waitForAllLoadersToDisappear(adminPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
redirectToHomePage,
uuid,
visitGlossaryPage,
waitForAntdPopupToSettle,
} from '../../utils/common';
import {
addMultiOwner,
Expand Down Expand Up @@ -1391,7 +1392,7 @@
browser,
}) => {
// Create page and set up mocked WebSocket BEFORE navigation
const page = await browser.newPage();

Check warning on line 1395 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.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 setupMockedWebSocket(page);

// Login on this page (WebSocket is fully mocked, no real server connection)
Expand Down Expand Up @@ -1480,7 +1481,7 @@
test.slow(true);

// Create page and set up mocked WebSocket BEFORE navigation
const page = await browser.newPage();

Check warning on line 1484 in openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Glossary.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 setupMockedWebSocket(page);

// Login on this page
Expand Down Expand Up @@ -2194,10 +2195,12 @@
.filter({ hasText: 'EN' })
.first();
await languageDropdown.click();
await waitForAntdPopupToSettle(page);

const germanOption = page.getByRole('menuitem', {
name: 'Deutsch - DE',
});
await expect(germanOption).toBeVisible();
await germanOption.click();

await waitForAllLoadersToDisappear(page);
Expand Down Expand Up @@ -2230,10 +2233,12 @@
.filter({ hasText: 'DE' })
.first();
await languageDropdown.click();
await waitForAntdPopupToSettle(page);

const englishOption = page.getByRole('menuitem', {
name: 'English - EN',
});
await expect(englishOption).toBeVisible();
await englishOption.click();
});
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,19 @@ class ServiceBaseClass {
await waitForIngestionWorkflowForm(page);
await this.fillIngestionDetails(page);

await page.click('[data-testid="next-button"]');
// Creating the service triggers AutoPilot, whose success toast renders
// bottom-center — directly over the wizard footer — and auto-closes after 5s
// (showSuccessToast(..., 5000) in AddServicePage). A click landing inside
// that window is intercepted by the toast, and with no per-action timeout
// the retry loop runs to the end of the test instead.
//
// Bounding the click is what fixes it, not waiting the toast out: the toast
// is fired by the create call several steps earlier, so whether it is on
// screen when we get here depends on how fast those steps ran. Gating on it
// being gone is a no-op when it has not rendered yet and when it has already
// closed. A bounded click covers every ordering — Playwright retries the
// intercepted click for the whole timeout, which outlasts the toast.
await page.click('[data-testid="next-button"]', { timeout: 30_000 });

// Go back and data should persist
await page.click('[data-testid="previous-button"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export class AdminClass extends UserClass {
async login(
page: Page,
userName = DEFAULT_ADMIN_USER.userName,
password = DEFAULT_ADMIN_USER.password
password = DEFAULT_ADMIN_USER.password,
options: { suppressWelcomeScreen?: boolean } = {}
) {
await super.login(page, userName, password);
await super.login(page, userName, password, options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { okJson, withNotFoundRetry } from '../../utils/apiResponse';
import {
disableEtagConditionalReads,
generateRandomUsername,
suppressWelcomeScreen,
uuid,
} from '../../utils/common';
import { PolicyClass, PolicyRulesType } from '../access-control/PoliciesClass';
Expand Down Expand Up @@ -257,8 +258,22 @@ export class UserClass {
async login(
page: Page,
userName = this.data.email,
password = this.data.password
password = this.data.password,
options: { suppressWelcomeScreen?: boolean } = {}
) {
const { suppressWelcomeScreen: shouldSuppressWelcomeScreen = true } =
options;

// Seed `loggedInUsers` before the first navigation so the landing-page
// welcome banner never renders for this session. Prefer the authoritative
// entity name from create(); fall back to the login email's local-part
// (the server-assigned username) for a pure login such as admin. Tests that
// exercise the welcome banner itself (e.g. Tour) opt out with
// `suppressWelcomeScreen: false`.
if (shouldSuppressWelcomeScreen) {
await suppressWelcomeScreen(page, this.responseData?.name ?? userName);
}

await page.goto('/signin');
try {
await page.waitForURL('**/signin', { timeout: 5000 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/
import { expect, Locator, Page } from '@playwright/test';
import { descriptionBox, removeLandingBanner } from './common';
import { descriptionBox } from './common';
import { waitForAllLoadersToDisappear } from './entity';
import { waitForPageLoaded } from './polling';
import { TaskDetails } from './task';
Expand Down Expand Up @@ -149,7 +149,6 @@
const fetchFeedResponse = page.waitForResponse(
'/api/v1/feed?type=Conversation*'
);
await removeLandingBanner(page);
await fetchFeedResponse;
}

Expand Down Expand Up @@ -258,7 +257,7 @@
export const navigateToActivityFeedTab = async (page: Page) => {
await page.getByTestId('activity_feed').click();
await waitForPageLoaded(page);
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });

Check warning on line 260 in openmetadata-ui/src/main/resources/ui/playwright/utils/activityFeed.ts

View workflow job for this annotation

GitHub Actions / checkstyle

Unexpected use of page.waitForSelector()
};

/**
Expand Down
Loading
Loading