Skip to content

Commit

Permalink
fix playwright redshift delete entity failure (#17743)
Browse files Browse the repository at this point in the history
* fix playwright redshift delete entity failure

* fix landing page kpi failure

* fix delete service issue

* fix flaky for AddRoleAndAssignToUSer
  • Loading branch information
chirag-madlani committed Sep 6, 2024
1 parent dcad829 commit b9ef8ca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ test.describe.serial('Add role and assign it to the user', () => {
test('Verify assigned role to new user', async ({ page }) => {
await settingClick(page, GlobalSettingOptions.USERS);

const searchUser = page.waitForResponse(
`/api/v1/search/query?q=*${encodeURIComponent(userDisplayName)}*`
);
await page.waitForSelector('[data-testid="searchbar"]');
await page.fill('[data-testid="searchbar"]', userDisplayName);

await searchUser;
await page.waitForSelector(`[data-testid="${userName}"]`);
await page.click(`[data-testid="${userName}"]`);
await page.waitForSelector('[data-testid="user-profile"]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ test.describe('Data Insight Page', { tag: '@data-insight' }, () => {
await redirectToHomePage(page);

await kpiResponse;

await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });

expect(page.locator('[data-testid="kpi-widget"]')).toBeVisible();

// description and owner data to be visible
expect(page.getByTestId(DESCRIPTION_WITH_PERCENTAGE)).toBeVisible();
expect(page.getByTestId(DESCRIPTION_WITH_OWNER)).toBeVisible();
await expect(page.getByTestId(DESCRIPTION_WITH_PERCENTAGE)).toBeVisible();
await expect(page.getByTestId(DESCRIPTION_WITH_OWNER)).toBeVisible();
});

test('Delete Kpi', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,18 @@ export const deleteService = async (

await page.fill('[data-testid="confirmation-text-input"]', 'DELETE');

const deleteResponse = page.waitForResponse((response) =>
response
.url()
.includes(
`/api/v1/services/${getServiceCategoryFromService(typeOfService)}`
)
);

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

await deleteResponse;

// Closing the toast notification
await toastNotification(page, `"${serviceName}" deleted successfully!`);

Expand Down

0 comments on commit b9ef8ca

Please sign in to comment.