chore: try the new CDPScreenshotNewSurface feature on cr-tot (#36092)

This commit is contained in:
Dmitry Gozman 2025-05-28 14:22:59 +00:00 committed by GitHub
parent 4cb2431c33
commit 14dfb291ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View File

@ -295,7 +295,7 @@ export class Chromium extends BrowserType {
throw new Error('Playwright manages remote debugging connection itself.');
if (args.find(arg => !arg.startsWith('-')))
throw new Error('Arguments can not specify page to be opened');
const chromeArguments = [...chromiumSwitches(options.assistantMode)];
const chromeArguments = [...chromiumSwitches(options.assistantMode, options.channel)];
if (os.platform() === 'darwin') {
// See https://github.com/microsoft/playwright/issues/7362

View File

@ -50,7 +50,7 @@ const disabledFeatures = (assistantMode?: boolean) => [
assistantMode ? 'AutomationControlled' : '',
].filter(Boolean);
export const chromiumSwitches = (assistantMode?: boolean) => [
export const chromiumSwitches = (assistantMode?: boolean, channel?: string) => [
'--disable-field-trial-config', // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
'--disable-background-networking',
'--disable-background-timer-throttling',
@ -65,6 +65,7 @@ export const chromiumSwitches = (assistantMode?: boolean) => [
'--disable-dev-shm-usage',
'--disable-extensions',
'--disable-features=' + disabledFeatures(assistantMode).join(','),
channel === 'chromium-tip-of-tree' ? '--enable-features=CDPScreenshotNewSurface' : '',
'--allow-pre-commit-input',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',

View File

@ -101,11 +101,11 @@ it('should change document.activeElement', async ({ page, server }) => {
expect(active).toEqual(['INPUT', 'TEXTAREA']);
});
it('should not affect screenshots', async ({ page, server, browserName, headless, isWindows, isLinux, isHeadlessShell }) => {
it('should not affect screenshots', async ({ page, server, browserName, headless, isWindows, isLinux, isHeadlessShell, channel }) => {
it.skip(browserName === 'webkit' && isWindows && !headless, 'WebKit/Windows/headed has a larger minimal viewport. See https://github.com/microsoft/playwright/issues/22616');
it.skip(browserName === 'webkit' && isLinux && !headless, 'WebKit headed has a larger minimal viewport on gtk4.');
it.skip(browserName === 'firefox' && !headless, 'Firefox headed produces a different image');
it.fixme(browserName === 'chromium' && !isHeadlessShell, 'https://github.com/microsoft/playwright/issues/33330');
it.fixme(browserName === 'chromium' && !isHeadlessShell && channel !== 'chromium-tip-of-tree', 'https://github.com/microsoft/playwright/issues/33330');
const page2 = await page.context().newPage();
await Promise.all([

View File

@ -22,8 +22,8 @@ import { verifyViewport } from '../config/utils';
browserTest.describe('page screenshot', () => {
browserTest.skip(({ browserName, headless }) => browserName === 'firefox' && !headless, 'Firefox headed produces a different image.');
browserTest('should run in parallel in multiple pages', async ({ server, contextFactory, browserName, isHeadlessShell }) => {
browserTest.fixme(browserName === 'chromium' && !isHeadlessShell, 'https://github.com/microsoft/playwright/issues/33330');
browserTest('should run in parallel in multiple pages', async ({ server, contextFactory, browserName, isHeadlessShell, channel }) => {
browserTest.fixme(browserName === 'chromium' && !isHeadlessShell && channel !== 'chromium-tip-of-tree', 'https://github.com/microsoft/playwright/issues/33330');
const context = await contextFactory();
const N = 5;