Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Discouraged 'networkidle' Calls #265

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Remove discouraged 'networkidle'",
"packageName": "@itwin/oidc-signin-tool",
"email": "[email protected]",
"dependentChangeType": "patch"
}
5 changes: 1 addition & 4 deletions packages/oidc-signin-tool/src/SignInAutomation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export async function automatedSignOut<T>(
}

async function handleErrorPage<T>({ page }: AutomatedContextBase<T>): Promise<void> {
await page.waitForLoadState("networkidle");
const pageTitle = await page.title();
let errMsgText;

Expand Down Expand Up @@ -166,7 +165,6 @@ async function handlePingLoginPage<T>(context: AutomatedSignInContext<T>): 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.",
);
Expand All @@ -187,10 +185,10 @@ async function handlePingLoginPage<T>(context: AutomatedSignInContext<T>): Promi
async function handleFederatedSignin<T>(context: AutomatedSignInContext<T>): Promise<void> {
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);
Expand Down Expand Up @@ -270,7 +268,6 @@ async function checkSelectorExists(
}

async function checkErrorOnPage(page: Page, selector: string): Promise<void> {
await page.waitForLoadState("networkidle");
const errMsgElement = await page.$(selector);
if (errMsgElement) {
const errMsgText = await errMsgElement.textContent();
Expand Down
Loading