From d6741eca083cf20a2debd78ed43e7c257b217b0e Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 26 Jun 2018 18:03:00 -0700 Subject: [PATCH] test: add test that verifies pptr works with SVG nodes (#2805) References #1247 --- test/elementhandle.spec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/elementhandle.spec.js b/test/elementhandle.spec.js index 090e620e6ed..8ddb3a60325 100644 --- a/test/elementhandle.spec.js +++ b/test/elementhandle.spec.js @@ -50,6 +50,20 @@ module.exports.addTests = function({testRunner, expect}) { const box = await elementHandle.boundingBox(); expect(box).toEqual({ x: 8, y: 8, width: 100, height: 200 }); }); + xit('should work with SVG nodes', async({page, server}) => { + await page.setContent(` + + + + `); + const element = await page.$('#therect'); + const pptrBoundingBox = await element.boundingBox(); + const webBoundingBox = await page.evaluate(e => { + const rect = e.getBoundingClientRect(); + return {x: rect.x, y: rect.y, width: rect.width, height: rect.height}; + }, element); + expect(pptrBoundingBox).toEqual(webBoundingBox); + }); }); describe('ElementHandle.boxModel', function() {