-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
SSO Login Question: (Refer Issue #5053) #5061
Comments
The reason I closed it was that it did not look like a description of the issue with Playwright. I guess stack overflow or our Slack would be a better place to ask a question so that community could help answering it. What I did: npx playwright-cli codegen microsoft.com Then I logged in and looked at the snippet it produced. I distilled it a bit to remove redirects and here is what I've got: const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
headless: false
});
const context = await browser.newContext();
// Open new page
const page = await context.newPage();
await page.goto('https://www.microsoft.com');
// Click a[aria-label="Sign in to your account"]
await Promise.all([
page.waitForNavigation(),
page.click('a[aria-label="Sign in to your account"]')
]);
// Fill input[aria-label="Enter your email, phone, or Skype."]
await page.fill('input[aria-label="Enter your email, phone, or Skype."]', 'john.smith@gmail.com');
// Click input[type="submit"]
await Promise.all([
page.waitForNavigation(),
page.click('input[type="submit"]')
]);
// Fill input[name="passwd"]
await page.fill('input[name="passwd"]', 'foobar');
// Click input[type="submit"]
await Promise.all([
page.waitForNavigation(),
page.click('input[type="submit"]')
]);
// Close page
await page.close();
})(); |
Thanks for sharing this, however page.fill will not work for this authentication popup as there is no Dom Content yet. This is similar to a Basic Auth popup window. |
OK I got around this issue setting the HTTP headers before submit.
However not sure if this is the best solution out there and looking for other suggestions or improvements for this. |
|
I think another related issue is that Microsoft keeps changing the login behavior for example they add an intermediate step for KMSI(Keep Me Signed in) which comes occasionally. |
We should do something similar to this https://medium.com/version-1/using-cypress-to-test-azure-active-directory-protected-spas-47d04f5add9 |
Hey, |
Hi Contributors
I had posted this question already which was closed and it seems the question wasn't answered accurately, hence posting this again.
Step 1: When I load application URL, a popup window opes.
Step 2: After user enters the email, another Login Prompt is shown.
I have been able to get through Step 1, but now how do I handle step 2, where the Login Prompt is being shown.
The text was updated successfully, but these errors were encountered: