Skip to content

Commit 6de4926

Browse files
committed
chore(bidi): add doctype to test html to eliminate browser style differences.
1 parent 0fc7059 commit 6de4926

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/page/elementhandle-screenshot.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ it.describe('element screenshot', () => {
168168

169169
it('should work with a rotated element', async ({ page }) => {
170170
await page.setViewportSize({ width: 500, height: 500 });
171-
await page.setContent(`<div style="position:absolute;
171+
await page.setContent(`<!DOCTYPE html>
172+
<div style="position:absolute;
172173
top: 100px;
173174
left: 100px;
174175
width: 100px;
@@ -222,7 +223,7 @@ it.describe('element screenshot', () => {
222223
});
223224

224225
it('should work for an element with an offset', async ({ page }) => {
225-
await page.setContent('<div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
226+
await page.setContent('<!DOCTYPE html><div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
226227
const elementHandle = await page.$('div');
227228
const screenshot = await elementHandle.screenshot();
228229
expect(screenshot).toMatchSnapshot('screenshot-element-fractional-offset.png');

0 commit comments

Comments
 (0)