Browse Source

test: wait until network idle on reload

pull/7569/head
Pranav C 8 months ago
parent
commit
ff7dbe3c7e
  1. 4
      tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts
  2. 4
      tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts
  3. 2
      tests/playwright/setup/index.ts

4
tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts

@ -12,9 +12,7 @@ export class OpenIDLoginPage extends BasePage {
async goto(title = 'test') {
// reload page to get latest app info
await this.rootPage.reload();
await this.rootPage.waitForTimeout(1000);
await this.rootPage.goto('/#/signin/');
await this.rootPage.reload({ waitUntil: 'networkidle' });
// click sign in with SAML
await this.rootPage.locator(`button:has-text("Sign in with ${title}")`).click();
}

4
tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts

@ -13,9 +13,7 @@ export class SAMLLoginPage extends BasePage {
async goto(title = 'test') {
// reload page to get latest app info
await this.rootPage.reload();
await this.rootPage.waitForTimeout(1000);
await this.rootPage.goto('/#/signin/');
await this.rootPage.reload({ waitUntil: 'networkidle' });
// click sign in with SAML
await this.rootPage.locator(`button:has-text("Sign in with ${title}")`).click();
}

2
tests/playwright/setup/index.ts

@ -412,7 +412,7 @@ const setup = async ({
}
await page.addInitScript(
async ({ token }) => {
if (location.search?.match(/code=|short-token=/)) return;
if (location.search?.match(/code=|short-token=|skip-init-script=/)) return;
try {
let initialLocalStorage = {};
try {

Loading…
Cancel
Save