← Back to microsoft/playwright
microsoft / playwright · Issue No. 42379
1.60.0
--enable-automation fixes regressionRegression starts with Playwright 1.60.0.
1.59.1 — ✅ works1.60.0 — ❌ fails@next / canary — ❌ fails1.60.0 with --enable-automation explicitly added — ✅ workschannel: 'msedge'login.microsoftonline.com SAML flowAfter upgrading from Playwright 1.59.1 to 1.60.0, our Microsoft SAML authentication flow started closing the Playwright page immediately after the final Sign in action.
The application, machine and browser environment are unchanged.
The important finding is that explicitly restoring the Chromium/Edge launch argument:
--enable-automation
makes the authentication flow work again with Playwright 1.60.0.
This appears significant because --enable-automation was present in Playwright's Chromium launch arguments in 1.59.1 but is no longer present starting with 1.60.0.
Our Playwright configuration normally contains:
use: {
channel: 'msedge',
}
The test navigates through our application authentication flow to:
https://login.microsoftonline.com/...
and performs the Microsoft login.
Simplified example:
await page.getByLabel('Password').fill(password);
await page
.getByRole('button', { name: 'Sign in' })
.click();
With Playwright 1.59.1, Microsoft completes the SAML redirect back to the application normally.
With Playwright 1.60.0 and every newer version tested, the click itself succeeds, but shortly afterwards Playwright reports that the page has been closed.
For diagnostics I added:
page.on('close', () => {
console.log('PAGE CLOSED');
});
page.on('crash', () => {
console.log('PAGE CRASHED');
});
browser?.on('disconnected', () => {
console.log('BROWSER DISCONNECTED');
});
The observed event is:
PAGE CLOSED
The failure can subsequently surface as:
Target page, context or browser has been closed
depending on which Playwright operation is awaiting the page at that moment.
Originally this surfaced from waitForResponse(), but removing all response/token handling did not change the behavior. The page still closes after the Microsoft Sign in action.
With Playwright 1.60.0, changing only the launch configuration to:
use: {
channel: 'msedge',
launchOptions: {
args: ['--enable-automation'],
},
}
fixes the issue.
The Microsoft SAML login and redirect then complete successfully.
Therefore the comparison is:
Same machine
Same managed Edge
Same Edge version
Same application
Same authentication flow
Playwright 1.59.1 PASS
Playwright 1.60.0 FAIL
Playwright > 1.60 FAIL
Playwright @next FAIL
Playwright 1.60.0 + --enable-automation PASS
I also tested whether the Edge-specific msForceBrowserSignIn feature was responsible by changing the corresponding --disable-features configuration.
That did not fix the issue.
Only restoring:
--enable-automation
has fixed it so far.
Microsoft SAML authentication should complete successfully after clicking Sign in, and the existing Edge page should continue the redirect back to the application without being closed.
This is the behavior observed with Playwright 1.59.1 and also with Playwright 1.60.0 when --enable-automation is explicitly restored.
Starting with Playwright 1.60.0, the page is closed during/after the Microsoft authentication redirect.
Adding --enable-automation restores the previous working behavior.
The Microsoft Edge installation is controlled by organization enterprise policies, so changing the browser version is not possible.
However, this makes the regression comparison quite controlled: all Playwright versions are tested against the same Edge installation and version.
This seems potentially related to #41348, which reports a Playwright 1.60 regression around Microsoft Entra/OAuth cross-origin navigation and TargetClosedException.
The additional observation here is that the regression can be deterministically avoided by restoring --enable-automation.
It may be worth investigating whether removing --enable-automation in Playwright 1.60 changes Microsoft Edge behavior under enterprise policies during Entra/SAML authentication.
No response
System:
OS: Windows 11 10.0.26100
CPU: (8) x64 Intel Xeon Processor (Cascadelake)
Memory: 16.48 GB / 31.88 GB
Binaries:
Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
IDEs:
VSCode: 1.100.0 - C:\Program Files\Microsoft VS Code\bin\code.CMD
npmPackages:
@playwright/test: ^1.60.0 => 1.60.0
playwright-bdd: ^9.2.0 => 9.2.0
playwright-mail-reporter: ^0.0.10 => 0.0.10
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.