Skip to content
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

test: update 'should work for canvas' test expectation #33685

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading