mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 00:22:23 +00:00
chore: fix flaky Entity playwright tests (#21162)
* chore: fix flaky Entity playwright tests * refactor: remove extra await statements
This commit is contained in:
parent
6ad8508166
commit
48ac501177
@ -58,6 +58,7 @@ export const getAuthContext = async (token: string) => {
|
||||
|
||||
export const redirectToHomePage = async (page: Page) => {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForURL('**/my-data');
|
||||
};
|
||||
|
||||
@ -120,6 +121,10 @@ export const toastNotification = async (
|
||||
message: string | RegExp,
|
||||
timeout?: number
|
||||
) => {
|
||||
await page.waitForSelector('[data-testid="alert-bar"]', {
|
||||
state: 'visible',
|
||||
});
|
||||
|
||||
await expect(page.getByTestId('alert-bar')).toHaveText(message, { timeout });
|
||||
|
||||
await expect(page.getByTestId('alert-icon')).toBeVisible();
|
||||
|
||||
@ -41,6 +41,7 @@ export const visitEntityPage = async (data: {
|
||||
const waitForSearchResponse = page.waitForResponse(
|
||||
'/api/v1/search/query?q=*index=dataAsset*'
|
||||
);
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.getByTestId('searchBox').fill(searchTerm);
|
||||
await waitForSearchResponse;
|
||||
await page.getByTestId(dataTestId).getByTestId('data-name').click();
|
||||
@ -1301,7 +1302,8 @@ export const hardDeleteEntity = async (
|
||||
endPoint: EntityTypeEndpoint
|
||||
) => {
|
||||
await page.click('[data-testid="manage-button"]');
|
||||
await page.getByTestId('delete-button').click();
|
||||
await page.waitForSelector('[data-testid="delete-button"]');
|
||||
await page.click('[data-testid="delete-button"]');
|
||||
|
||||
await page.waitForSelector('[role="dialog"].ant-modal');
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user