Skip to content

Commit 3a02f09

Browse files
Chore(UI): Fix flakiness in AutoPilot and ServiceEntity (#27226)
* Fix flakiness in tests * fix(playwright): Ensure waitForURL uses 'domcontentloaded' in redirectToHomePage
1 parent c2a75de commit 3a02f09

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • openmetadata-ui/src/main/resources/ui/playwright/utils

openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ export const redirectToHomePage = async (
6060
page: Page,
6161
_waitForLoaders = true
6262
) => {
63-
await page.goto('/');
64-
await page.waitForURL('**/my-data');
63+
await page.goto('/', {
64+
waitUntil: 'domcontentloaded',
65+
});
66+
await page.waitForURL('**/my-data', {
67+
waitUntil: 'domcontentloaded',
68+
});
6569

6670
if (_waitForLoaders) {
6771
await waitForAllLoadersToDisappear(page);
@@ -176,12 +180,11 @@ export const toastNotification = async (
176180
message: string | RegExp,
177181
timeout?: number
178182
) => {
179-
await page.getByTestId('alert-bar').waitFor({
183+
await page.getByTestId('alert-bar').getByText(message).waitFor({
180184
state: 'visible',
185+
timeout,
181186
});
182187

183-
await expect(page.getByTestId('alert-bar')).toHaveText(message, { timeout });
184-
185188
await expect(page.getByTestId('alert-icon')).toBeVisible();
186189
};
187190

0 commit comments

Comments
 (0)