You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
postscribe actually kept the document stream open and replaced document.write calls in the async scripts so that the content is appended to the document, not overwriting it - this allowed such dynamically added scripts render nested content properly
thus for now we need to restore postscribe as part of Restore Postscribe #278 but an automated test would be good to justify that the ads are rendering on iOS in the future when we try to replace it again :)
Essential Components
You need to build and serve (or proxy-replace) a locally built PUC
You need to serve (or proxy-replace) a cache response (mobile uses cache)
Serve this script using caddy or other server with tls (iOS wants https:// otherwise won't load) Caddyfile:
example.com {
root * .
file_server
tls internal
}
you must serve this as a test-creative.js: (a distilled version):
document.write("<h1>Test</h1>")
Once you are able to render this injected PUC and injected adm on mobile as part of the iOS Mobile Demo App - you can setup an automation via XCUITest
testing should be done on macos-latest (arm64) github runner (ask ChatGPT how to set it up)
Objectives
Setup a creative on a GAM account used for Prebid Mobile Apps testing that would point at a localhost URL for PUC and a localhost URL for cache response - you can hardcode those - you will be serving them.
Write a XCUITest that would verify the creative rendered.
Implement a script that starts all the localhost servers and starts an xcuitest.
Create a github action that would setup the environment and run the script on a macos-latest github runner.
Motivation
Introduce regression testing PUC not rendering certain creatives (uncovered as part of #275)
Background
Detailed postmortem doc is shared in the Slack channel (let me know if you want a link either via slack or email), but it comes down to this:
document.writebecause they expect to be rendered in an iframe not plainly output into the documentEssential Components
admfor the cache responseexample.comto127.0.0.1via /etc/hoststest-creative.js: (a distilled version):XCUITestObjectives