diff --git a/change/@itwin-oidc-signin-tool-3c9c072f-ae0a-4ffc-a7fc-06d6c9871fe3.json b/change/@itwin-oidc-signin-tool-3c9c072f-ae0a-4ffc-a7fc-06d6c9871fe3.json new file mode 100644 index 00000000..2a243634 --- /dev/null +++ b/change/@itwin-oidc-signin-tool-3c9c072f-ae0a-4ffc-a7fc-06d6c9871fe3.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Remove discouraged 'networkidle'", + "packageName": "@itwin/oidc-signin-tool", + "email": "108895074+MichaelSwigerAtBentley@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/oidc-signin-tool/src/SignInAutomation.ts b/packages/oidc-signin-tool/src/SignInAutomation.ts index b702b820..212635a2 100644 --- a/packages/oidc-signin-tool/src/SignInAutomation.ts +++ b/packages/oidc-signin-tool/src/SignInAutomation.ts @@ -111,7 +111,6 @@ export async function automatedSignOut( } async function handleErrorPage({ page }: AutomatedContextBase): Promise { - await page.waitForLoadState("networkidle"); const pageTitle = await page.title(); let errMsgText; @@ -166,7 +165,6 @@ async function handlePingLoginPage(context: AutomatedSignInContext): Promi allow = page.locator(testSelectors.pingAllowSubmit); await allow.click(); - await page.waitForLoadState("networkidle"); const error = page.getByText( "We didn't recognize the email address or password you entered. Please try again.", ); @@ -187,10 +185,10 @@ async function handlePingLoginPage(context: AutomatedSignInContext): Promi async function handleFederatedSignin(context: AutomatedSignInContext): Promise { const { page } = context; - await page.waitForLoadState("networkidle"); if (-1 === page.url().indexOf("microsoftonline")) return; + await page.waitForLoadState("load"); if (await checkSelectorExists(page, testSelectors.msUserNameField)) { await page.locator(testSelectors.msUserNameField).fill(context.user.email); const msSubmit = await page.waitForSelector(testSelectors.msSubmit); @@ -270,7 +268,6 @@ async function checkSelectorExists( } async function checkErrorOnPage(page: Page, selector: string): Promise { - await page.waitForLoadState("networkidle"); const errMsgElement = await page.$(selector); if (errMsgElement) { const errMsgText = await errMsgElement.textContent();