Browse Source

test: skip wait for response on user page access

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5903/head
Raju Udava 1 year ago
parent
commit
677b065f28
  1. 17
      tests/playwright/pages/Account/Users.ts
  2. 6
      tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts

17
tests/playwright/pages/Account/Users.ts

@ -17,12 +17,17 @@ export class AccountUsersPage extends BasePage {
this.changePasswordPage = new ChangePasswordPage(this.rootPage); this.changePasswordPage = new ChangePasswordPage(this.rootPage);
} }
async goto() { async goto({ waitForResponse = true }: { waitForResponse?: boolean }) {
return this.waitForResponse({ if (waitForResponse) {
uiAction: async () => await this.rootPage.goto('/#/account/users/list'), return this.waitForResponse({
httpMethodsToMatch: ['GET'], uiAction: async () => await this.rootPage.goto('/#/account/users'),
requestUrlPathToMatch: `api/v1/users`, httpMethodsToMatch: ['GET'],
}); requestUrlPathToMatch: `api/v1/users`,
});
} else {
await this.rootPage.waitForTimeout(1000);
return this.rootPage.goto('/#/account/users');
}
} }
async waitUntilContentLoads() { async waitUntilContentLoads() {

6
tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts

@ -65,7 +65,7 @@ test.describe('User roles', () => {
test('Invite user, update role and delete user', async () => { test('Invite user, update role and delete user', async () => {
test.slow(); test.slow();
await accountUsersPage.goto(); await accountUsersPage.goto({ waitForResponse: false });
// invite user // invite user
for (let i = 0; i < roleDb.length; i++) { for (let i = 0; i < roleDb.length; i++) {
@ -77,7 +77,7 @@ test.describe('User roles', () => {
} }
await signupAndVerify(0); await signupAndVerify(0);
await accountUsersPage.goto(); await accountUsersPage.goto({ waitForResponse: false });
await signupAndVerify(1); await signupAndVerify(1);
await dashboard.signOut(); await dashboard.signOut();
@ -87,7 +87,7 @@ test.describe('User roles', () => {
withoutPrefix: true, withoutPrefix: true,
}); });
await accountUsersPage.goto(); await accountUsersPage.goto({ waitForResponse: false });
// change role // change role
for (let i = 0; i < roleDb.length; i++) { for (let i = 0; i < roleDb.length; i++) {
await accountUsersPage.updateRole({ await accountUsersPage.updateRole({

Loading…
Cancel
Save