Browse Source

test(playwright): wait until meta api call completes

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
9f249d06e5
  1. 4
      tests/playwright/pages/Account/Settings.ts
  2. 4
      tests/playwright/tests/accountUserSettings.spec.ts

4
tests/playwright/pages/Account/Settings.ts

@ -14,6 +14,10 @@ export class AccountSettingsPage extends BasePage {
await this.rootPage.goto('/#/account/users/settings', { waitUntil: 'networkidle' });
}
async waitUntilContentLoads() {
return this.rootPage.waitForResponse(resp => resp.url().includes('api/v1/app-settings') && resp.status() === 200);
}
get() {
return this.accountPage.get().locator(`[data-testid="nc-app-settings"]`);
}

4
tests/playwright/tests/accountUserSettings.spec.ts

@ -24,6 +24,8 @@ test.describe('App settings', () => {
// todo: remove after route navigation issue resolved
await accountSettingsPage.rootPage.reload({ waitUntil: 'networkidle' });
await accountSettingsPage.waitUntilContentLoads();
// enable invite only signup
if (!(await accountSettingsPage.getInviteOnlyCheckboxValue())) {
await accountSettingsPage.toggleInviteOnlyCheckbox();
@ -45,6 +47,8 @@ test.describe('App settings', () => {
await accountSettingsPage.goto();
await accountSettingsPage.waitUntilContentLoads();
await accountSettingsPage.checkInviteOnlySignupCheckbox(true);
await accountSettingsPage.toggleInviteOnlyCheckbox();
await accountSettingsPage.checkInviteOnlySignupCheckbox(false);

Loading…
Cancel
Save