fix myData and ActivityFeed playwright test 1.5.5 (#17886)

This commit is contained in:
Ashish Gupta 2024-09-18 17:09:11 +05:30 committed by GitHub
parent 33c50efdbf
commit a679625f7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View File

@ -209,7 +209,9 @@ test.describe('Activity feed', () => {
await page.getByText('Accept Suggestion').click();
const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**');
await toastNotification(page, /Task resolved successfully/);
await waitForCountFetch;
await checkTaskCount(page, 0, 2);
});
@ -366,7 +368,9 @@ test.describe('Activity feed', () => {
await page.getByText('Accept Suggestion').click();
const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**');
await toastNotification(page, /Task resolved successfully/);
await waitForCountFetch;
await checkTaskCount(page, 0, 2);
});
@ -428,7 +432,9 @@ test.describe('Activity feed', () => {
await page.getByRole('menuitem', { name: 'close' }).click();
await commentWithCloseTask;
const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**');
await toastNotification(page, 'Task closed successfully.');
await waitForCountFetch;
await checkTaskCount(page, 0, 1);
});
@ -460,9 +466,11 @@ test.describe('Activity feed', () => {
await page.getByTestId('request-entity-tags').click();
// create tag task
const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**');
const openTaskAfterTagResponse = page.waitForResponse(TASK_OPEN_FETCH_LINK);
await createTagTask(page, { ...value, tag: 'PII.None' });
await openTaskAfterTagResponse;
await waitForCountFetch;
// open task count after description
await checkTaskCount(page, 2, 0);
@ -482,11 +490,9 @@ test.describe('Activity feed', () => {
await page.getByRole('menuitem', { name: 'close' }).click();
await commentWithCloseTask;
const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?*');
const waitForCountFetch2 = page.waitForResponse('/api/v1/feed/count?**');
await toastNotification(page, 'Task closed successfully.');
await waitForCountFetch;
await waitForCountFetch2;
// open task count after closing one task
await checkTaskCount(page, 1, 1);
@ -758,7 +764,9 @@ base.describe('Activity feed with Data Consumer User', () => {
await page2.getByText('Accept Suggestion').click();
const waitForCountFetch = page2.waitForResponse('/api/v1/feed/count?**');
await toastNotification(page2, /Task resolved successfully/);
await waitForCountFetch;
// TODO: Ashish - Enable them once issue is resolved from Backend https://github.com/open-metadata/OpenMetadata/issues/17059
// const openTask = await page2.getByTestId('open-task').textContent();

View File

@ -31,11 +31,11 @@ const test = base.extend<{ page: Page }>({
},
});
test.describe('My Data page', () => {
test.describe.serial('My Data page', () => {
test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await performAdminLogin(browser);
await user.create(apiContext);
for (const table of TableEntities) {
const tablePromises = TableEntities.map(async (table) => {
await table.create(apiContext);
await table.patch({
apiContext,
@ -56,16 +56,18 @@ test.describe('My Data page', () => {
],
});
await table.followTable(apiContext, user.responseData.id);
}
});
await Promise.all(tablePromises);
await afterAction();
});
test.afterAll('Cleanup', async ({ browser }) => {
const { apiContext, afterAction } = await performAdminLogin(browser);
await user.delete(apiContext);
for (const table of TableEntities) {
await table.delete(apiContext);
}
await Promise.all(TableEntities.map((table) => table.delete(apiContext)));
await afterAction();
});