google / fledge-shim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test positioning of creative

taymonbeal opened this issue · comments

In particular we want to make sure that there aren't any undesirable borders or margins or anything and that the inner iframe's width and height are the same as the outer one's.

I tried Intersection Observer but that doesn't seem to be able to look through the iframe viewport to see the position relative to the actual browser window. I looked at the WebDriver documentation but didn't see any way to do this. I suppose I could try just measuring each iframe relative to its parent but that seems like a place where mistakes could get in. Still trying to think of other options.

Using a same-origin ad creative might be necessary or at least convenient. The API doesn't currently allow srcdoc and data: URIs are cross-origin, so this might require a change on the build-tooling side.

Does the test framework support screenshot goldens?

Basically no. WebDriver does, although I would still need to figure out how to set up comparisons against goldens.

Currently inclined to just measure each iframe relative to its parent and hope I don't screw it up.

That, plus an initial manual test, SGTM