Chore(ui): Increase timeout for delete toast verification (#20827)

* Increase timeout for delete toast verification for entities which might take more time

* Remove the redundancy
This commit is contained in:
Aniket Katkar 2025-04-15 14:00:33 +05:30 committed by GitHub
parent 3e4b8f5293
commit 2197c00984
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 41 additions and 6 deletions

View File

@ -67,3 +67,9 @@ export const ENTITIES_WITHOUT_FOLLOWING_BUTTON = [
'services/searchServices',
'apiCollections',
];
/**
* Timeout for deleting big entities
* 5 minutes
*/
export const BIG_ENTITY_DELETE_TIMEOUT = 5 * 60 * 1000;

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import { expect, test } from '@playwright/test';
import { BIG_ENTITY_DELETE_TIMEOUT } from '../../constant/delete';
import { GlobalSettingOptions } from '../../constant/settings';
import {
descriptionBox,
@ -102,6 +103,10 @@ test.describe('API service', () => {
await deleteResponse;
await toastNotification(page, /deleted successfully!/);
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
);
});
});

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import test, { expect } from '@playwright/test';
import { BIG_ENTITY_DELETE_TIMEOUT } from '../../constant/delete';
import { EntityDataClass } from '../../support/entity/EntityDataClass';
import { EntityDataClassCreationConfig } from '../../support/entity/EntityDataClass.interface';
import { TableClass } from '../../support/entity/TableClass';
@ -257,7 +258,11 @@ test.describe('Entity Version pages', () => {
await deleteResponse;
await toastNotification(page, /deleted successfully!/);
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
);
await page.reload();

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import test, { expect } from '@playwright/test';
import { BIG_ENTITY_DELETE_TIMEOUT } from '../../constant/delete';
import { EntityDataClass } from '../../support/entity/EntityDataClass';
import { EntityDataClassCreationConfig } from '../../support/entity/EntityDataClass.interface';
import {
@ -215,7 +216,11 @@ test.describe('Service Version pages', () => {
await deleteResponse;
await toastNotification(page, /deleted successfully!/);
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
);
await page.reload();

View File

@ -13,6 +13,7 @@
import { expect, Page } from '@playwright/test';
import { isEmpty, lowerCase } from 'lodash';
import {
BIG_ENTITY_DELETE_TIMEOUT,
ENTITIES_WITHOUT_FOLLOWING_BUTTON,
LIST_OF_FIELDS_TO_EDIT_NOT_TO_BE_PRESENT,
LIST_OF_FIELDS_TO_EDIT_TO_BE_DISABLED,
@ -1248,7 +1249,11 @@ export const softDeleteEntity = async (
await deleteResponse;
await toastNotification(page, /deleted successfully!/);
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
);
await page.reload();
@ -1313,7 +1318,11 @@ export const hardDeleteEntity = async (
await page.click('[data-testid="confirm-button"]');
await deleteResponse;
await toastNotification(page, /deleted successfully!/);
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
);
};
export const checkDataAssetWidget = async (page: Page, serviceType: string) => {

View File

@ -12,6 +12,7 @@
*/
import { expect, Page } from '@playwright/test';
import { BIG_ENTITY_DELETE_TIMEOUT } from '../constant/delete';
import { GlobalSettingOptions } from '../constant/settings';
import { EntityTypeEndpoint } from '../support/entity/Entity.interface';
import { getApiContext, toastNotification } from './common';
@ -120,7 +121,11 @@ export const deleteService = async (
await deleteResponse;
// Closing the toast notification
await toastNotification(page, /deleted successfully!/, 5 * 60 * 1000); // Wait for up to 5 minutes for the toast notification to appear
await toastNotification(
page,
/deleted successfully!/,
BIG_ENTITY_DELETE_TIMEOUT
); // Wait for up to 5 minutes for the toast notification to appear
await page.reload();
await page.waitForLoadState('networkidle');