Skip to content
Merged
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 @@ -216,7 +216,7 @@ test.describe(

await waitForAllLoadersToDisappear(page);

await hardDeleteTeam(page);
await hardDeleteTeam(page, teamName);

// Validate the deleted team
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ test.describe('Teams Page', () => {
teamDetails?.updatedName ?? ''
);

await hardDeleteTeam(page);
await hardDeleteTeam(page, teamDetails?.updatedName ?? teamDetails.name);
});
});

Expand Down Expand Up @@ -501,7 +501,10 @@ test.describe('Teams Page', () => {
team.responseData?.['displayName']
);

await hardDeleteTeam(page);
await hardDeleteTeam(
page,
team.responseData?.['displayName'] ?? team.data.name
);
await afterAction();
});

Expand Down Expand Up @@ -765,7 +768,7 @@ test.describe('Teams Page', () => {
page.getByTestId('team-hierarchy-table').getByRole('link')
).toContainText(team2Details.displayName);

await hardDeleteTeam(page);
await hardDeleteTeam(page, team1Details.name);
});

test('Total User Count should be rendered', async ({ page }) => {
Expand Down
13 changes: 6 additions & 7 deletions openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
assignDomain,
descriptionBox,
redirectToHomePage,
toastNotification,
uuid,
} from './common';
import {
Expand Down Expand Up @@ -133,12 +132,11 @@ export const softDeleteTeam = async (page: Page) => {

await page.click('[data-testid="confirm-button"]');

await deleteResponse;

await toastNotification(page, /deleted successfully!/);
const response = await deleteResponse;
expect(response.status()).toBe(200);
};

export const hardDeleteTeam = async (page: Page) => {
export const hardDeleteTeam = async (page: Page, teamName: string) => {
await page
.getByTestId('team-details-collapse')
.getByTestId('manage-button')
Expand All @@ -159,9 +157,10 @@ export const hardDeleteTeam = async (page: Page) => {

await page.click('[data-testid="confirm-button"]');

await deleteResponse;
const response = await deleteResponse;
expect(response.status()).toBe(200);

await toastNotification(page, /deleted successfully!/);
await searchTeam(page, teamName, { expectEmptyResults: true });
};

export const getNewTeamDetails = (teamName: string) => {
Expand Down
Loading