test: update 'should work for canvas' test expectation (#33685)
This commit is contained in:
parent
89f4d4ce4f
commit
6a32589330
|
|
@ -61,6 +61,7 @@ export const androidTest = baseTest.extend<PageTestFixtures & AndroidTestFixture
|
||||||
isElectron: [false, { scope: 'worker' }],
|
isElectron: [false, { scope: 'worker' }],
|
||||||
electronMajorVersion: [0, { scope: 'worker' }],
|
electronMajorVersion: [0, { scope: 'worker' }],
|
||||||
isWebView2: [false, { scope: 'worker' }],
|
isWebView2: [false, { scope: 'worker' }],
|
||||||
|
isHeadlessShell: [false, { scope: 'worker' }],
|
||||||
|
|
||||||
androidDevice: async ({ androidDeviceWorker }, use) => {
|
androidDevice: async ({ androidDeviceWorker }, use) => {
|
||||||
await closeAllActivities(androidDeviceWorker);
|
await closeAllActivities(androidDeviceWorker);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ export const electronTest = baseTest.extend<TraceViewerFixtures>(traceViewerFixt
|
||||||
isAndroid: [false, { scope: 'worker' }],
|
isAndroid: [false, { scope: 'worker' }],
|
||||||
isElectron: [true, { scope: 'worker' }],
|
isElectron: [true, { scope: 'worker' }],
|
||||||
isWebView2: [false, { scope: 'worker' }],
|
isWebView2: [false, { scope: 'worker' }],
|
||||||
|
isHeadlessShell: [false, { scope: 'worker' }],
|
||||||
|
|
||||||
launchElectronApp: async ({ playwright }, use) => {
|
launchElectronApp: async ({ playwright }, use) => {
|
||||||
// This env prevents 'Electron Security Policy' console message.
|
// This env prevents 'Electron Security Policy' console message.
|
||||||
|
|
|
||||||
|
|
@ -280,12 +280,12 @@ it.describe('page screenshot', () => {
|
||||||
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png');
|
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work for canvas', async ({ page, server, isElectron, isMac, isLinux, macVersion, browserName, headless }) => {
|
it('should work for canvas', async ({ page, server, isElectron, isMac, isLinux, macVersion, browserName, isHeadlessShell }) => {
|
||||||
it.fixme(isElectron && isMac, 'Fails on the bots');
|
it.fixme(isElectron && isMac, 'Fails on the bots');
|
||||||
await page.setViewportSize({ width: 500, height: 500 });
|
await page.setViewportSize({ width: 500, height: 500 });
|
||||||
await page.goto(server.PREFIX + '/screenshots/canvas.html');
|
await page.goto(server.PREFIX + '/screenshots/canvas.html');
|
||||||
const screenshot = await page.screenshot();
|
const screenshot = await page.screenshot();
|
||||||
if ((!headless && browserName === 'chromium' && isMac && os.arch() === 'arm64' && macVersion >= 14) ||
|
if ((!isHeadlessShell && browserName === 'chromium' && isMac && os.arch() === 'arm64' && macVersion >= 14) ||
|
||||||
(browserName === 'webkit' && isLinux && os.arch() === 'x64'))
|
(browserName === 'webkit' && isLinux && os.arch() === 'x64'))
|
||||||
expect(screenshot).toMatchSnapshot('screenshot-canvas-with-accurate-corners.png');
|
expect(screenshot).toMatchSnapshot('screenshot-canvas-with-accurate-corners.png');
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,5 @@ export type PageWorkerFixtures = {
|
||||||
isAndroid: boolean;
|
isAndroid: boolean;
|
||||||
isElectron: boolean;
|
isElectron: boolean;
|
||||||
isWebView2: boolean;
|
isWebView2: boolean;
|
||||||
|
isHeadlessShell: boolean;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ export const webView2Test = baseTest.extend<TraceViewerFixtures>(traceViewerFixt
|
||||||
isElectron: [false, { scope: 'worker' }],
|
isElectron: [false, { scope: 'worker' }],
|
||||||
electronMajorVersion: [0, { scope: 'worker' }],
|
electronMajorVersion: [0, { scope: 'worker' }],
|
||||||
isWebView2: [true, { scope: 'worker' }],
|
isWebView2: [true, { scope: 'worker' }],
|
||||||
|
isHeadlessShell: [false, { scope: 'worker' }],
|
||||||
|
|
||||||
browser: [async ({ playwright }, use, testInfo) => {
|
browser: [async ({ playwright }, use, testInfo) => {
|
||||||
const cdpPort = 10000 + testInfo.workerIndex;
|
const cdpPort = 10000 + testInfo.workerIndex;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue