mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-01 08:34:02 +03:00
test: screenshot of css transformation (#26533)
Failing tests for #26447.
This commit is contained in:
parent
22dacdb75f
commit
14a57a788b
@ -444,4 +444,53 @@ browserTest.describe('element screenshot', () => {
|
||||
expect(screenshot).toMatchSnapshot('element-larger-than-viewport-dsf-css-size.png');
|
||||
await context.close();
|
||||
});
|
||||
|
||||
browserTest('page screenshot should capture css transform with device pixels', async function({ browser, browserName }) {
|
||||
browserTest.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26447' });
|
||||
browserTest.fixme(browserName === 'webkit');
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: 500, height: 500 },
|
||||
deviceScaleFactor: 3,
|
||||
});
|
||||
const page = await context.newPage();
|
||||
await page.setContent(`
|
||||
<style>
|
||||
.container {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: 75px 0 0 75px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.cube {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
perspective: 550px;
|
||||
perspective-origin: 150% 150%;
|
||||
}
|
||||
|
||||
.face {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.right {
|
||||
background: rgba(196, 0, 0, 0.7);
|
||||
transform: rotateY(70deg);
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="cube showbf">
|
||||
<div class="face right"></div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
await expect(page).toHaveScreenshot({ scale: 'device' });
|
||||
await context.close();
|
||||
});
|
||||
});
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
@ -840,3 +840,47 @@ it('should throw if screenshot size is too large', async ({ page, browserName, i
|
||||
expect(exception.message).toContain('Cannot take screenshot larger than 32767');
|
||||
}
|
||||
});
|
||||
|
||||
it('page screenshot should capture css transform', async function({ page, browserName, isElectron }) {
|
||||
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/26447' });
|
||||
it.fixme(browserName === 'webkit');
|
||||
it.fixme(isElectron, 'Returns screenshot of a different size.');
|
||||
await page.setContent(`
|
||||
<style>
|
||||
.container {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
margin: 75px 0 0 75px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.cube {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
perspective: 550px;
|
||||
perspective-origin: 150% 150%;
|
||||
}
|
||||
|
||||
.face {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.right {
|
||||
background: rgba(196, 0, 0, 0.7);
|
||||
transform: rotateY(70deg);
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="container">
|
||||
<div class="cube showbf">
|
||||
<div class="face right"></div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
Loading…
Reference in New Issue
Block a user