Skip to content

Commit

Permalink
chore(bidi): add doctype to test html to eliminate browser style diff…
Browse files Browse the repository at this point in the history
…erences.
  • Loading branch information
lutien committed Jan 10, 2025
1 parent 0fc7059 commit 6de4926
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/page/elementhandle-screenshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ it.describe('element screenshot', () => {

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

it('should work for an element with an offset', async ({ page }) => {
await page.setContent('<div style="position:absolute; top: 10.3px; left: 20.4px;width:50.3px;height:20.2px;border:1px solid black;"></div>');
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>');
const elementHandle = await page.$('div');
const screenshot = await elementHandle.screenshot();
expect(screenshot).toMatchSnapshot('screenshot-element-fractional-offset.png');
Expand Down

0 comments on commit 6de4926

Please sign in to comment.