Skip to content

Commit

Permalink
test: update 'should work for canvas' test expectation (#33685)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Nov 20, 2024
1 parent 89f4d4c commit 6a32589
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/android/androidTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const androidTest = baseTest.extend<PageTestFixtures & AndroidTestFixture
isElectron: [false, { scope: 'worker' }],
electronMajorVersion: [0, { scope: 'worker' }],
isWebView2: [false, { scope: 'worker' }],
isHeadlessShell: [false, { scope: 'worker' }],

androidDevice: async ({ androidDeviceWorker }, use) => {
await closeAllActivities(androidDeviceWorker);
Expand Down
1 change: 1 addition & 0 deletions tests/electron/electronTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const electronTest = baseTest.extend<TraceViewerFixtures>(traceViewerFixt
isAndroid: [false, { scope: 'worker' }],
isElectron: [true, { scope: 'worker' }],
isWebView2: [false, { scope: 'worker' }],
isHeadlessShell: [false, { scope: 'worker' }],

launchElectronApp: async ({ playwright }, use) => {
// This env prevents 'Electron Security Policy' console message.
Expand Down
4 changes: 2 additions & 2 deletions tests/page/page-screenshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ it.describe('page screenshot', () => {
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');
await page.setViewportSize({ width: 500, height: 500 });
await page.goto(server.PREFIX + '/screenshots/canvas.html');
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'))
expect(screenshot).toMatchSnapshot('screenshot-canvas-with-accurate-corners.png');
else
Expand Down
1 change: 1 addition & 0 deletions tests/page/pageTestApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ export type PageWorkerFixtures = {
isAndroid: boolean;
isElectron: boolean;
isWebView2: boolean;
isHeadlessShell: boolean;
};
1 change: 1 addition & 0 deletions tests/webview2/webView2Test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const webView2Test = baseTest.extend<TraceViewerFixtures>(traceViewerFixt
isElectron: [false, { scope: 'worker' }],
electronMajorVersion: [0, { scope: 'worker' }],
isWebView2: [true, { scope: 'worker' }],
isHeadlessShell: [false, { scope: 'worker' }],

browser: [async ({ playwright }, use, testInfo) => {
const cdpPort = 10000 + testInfo.workerIndex;
Expand Down

0 comments on commit 6a32589

Please sign in to comment.