fix userdetails and personflow flaky test (#17753)

This commit is contained in:
Ashish Gupta 2024-09-06 19:53:26 +05:30 committed by GitHub
parent c309906a1b
commit 3164bc4803
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View File

@ -73,7 +73,12 @@ test.describe.serial('Persona operations', () => {
await page.getByTestId('displayName').fill(PERSONA_DETAILS.displayName);
await page.locator(descriptionBox).fill(PERSONA_DETAILS.description);
const userResponse = page.waitForResponse('/api/v1/users?*');
await page.getByTestId('add-users').click();
await userResponse;
await page.waitForSelector('[data-testid="selectable-list"]');
const searchUser = page.waitForResponse(
`/api/v1/search/query?q=*${encodeURIComponent(
@ -83,7 +88,9 @@ test.describe.serial('Persona operations', () => {
await page.getByTestId('searchbar').fill(user.responseData.displayName);
await searchUser;
await page.click(`.ant-popover [title="${user.responseData.displayName}"]`);
await page
.getByRole('listitem', { name: user.responseData.displayName })
.click();
await page.getByTestId('selectable-list-update-btn').click();
await page.getByRole('button', { name: 'Create' }).click();

View File

@ -181,8 +181,16 @@ test.describe('User with different Roles', () => {
// Checks for the admins
await redirectToHomePage(adminPage);
const fetchUserResponse = adminPage.waitForResponse('/api/v1/users?**');
await settingClick(adminPage, GlobalSettingOptions.USERS);
await fetchUserResponse;
await adminPage.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
const userSearchResponse = adminPage.waitForResponse(
'/api/v1/search/query?q=**&from=0&size=*&index=*'
);
@ -211,8 +219,16 @@ test.describe('User with different Roles', () => {
// Checks for the normal user
await redirectToHomePage(userPage);
const fetchUserResponse2 = userPage.waitForResponse('/api/v1/users?**');
await settingClick(userPage, GlobalSettingOptions.USERS);
await fetchUserResponse2;
await userPage.waitForSelector('[data-testid="loader"]', {
state: 'detached',
});
const userResponse = userPage.waitForResponse(
'/api/v1/search/query?q=**&from=0&size=*&index=*'
);