prebid-universal-creative 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.circleci/config.yml +44 -30
  2. package/.github/workflows/codeql.yml +98 -0
  3. package/README.md +2 -2
  4. package/dist/amp.js +3 -3
  5. package/dist/banner.js +3 -3
  6. package/dist/caf7688498213fb0c19f.max.js +1046 -0
  7. package/dist/creative.js +3 -3
  8. package/dist/load-cookie-with-consent.html +1 -1
  9. package/dist/load-cookie.html +1 -1
  10. package/dist/mobile.js +3 -3
  11. package/dist/native-render.js +3 -3
  12. package/dist/native-trk.js +3 -3
  13. package/dist/native.js +3 -3
  14. package/dist/uid.js +2 -2
  15. package/dist/video.js +3 -3
  16. package/gulpfile.js +12 -24
  17. package/integ-test/fixtures/test.js +79 -0
  18. package/integ-test/pages/amp.html +80 -0
  19. package/integ-test/pages/banner.html +96 -0
  20. package/integ-test/pages/native_legacy.html +107 -0
  21. package/integ-test/spec/amp_spec.js +111 -0
  22. package/integ-test/spec/banner_spec.js +85 -0
  23. package/integ-test/spec/native_legacy_spec.js +213 -0
  24. package/package.json +7 -13
  25. package/playwright.config.js +108 -0
  26. package/src/adHtmlRender.js +11 -0
  27. package/src/cookieSync.js +3 -0
  28. package/src/cookieSyncWithConsent.js +3 -0
  29. package/src/domHelper.js +25 -15
  30. package/src/dynamicRenderer.js +56 -0
  31. package/src/messaging.js +23 -2
  32. package/src/mobileAndAmpRender.js +17 -20
  33. package/src/nativeAssetManager.js +98 -79
  34. package/src/nativeORTBTrackerManager.js +1 -1
  35. package/src/nativeRenderManager.js +7 -12
  36. package/src/nativeTrackerManager.js +2 -2
  37. package/src/renderingManager.js +13 -19
  38. package/test/helpers/mocks.js +1 -0
  39. package/test/spec/dynamicRenderer_spec.js +167 -0
  40. package/test/spec/messaging_spec.js +98 -3
  41. package/test/spec/mobileAndAmpRender_spec.js +47 -65
  42. package/test/spec/nativeAssetManager_spec.js +73 -23
  43. package/test/spec/renderingManager_spec.js +20 -6
  44. package/webpack.conf.js +0 -1
  45. package/.nvmrc +0 -1
  46. package/dist/creative.max.js +0 -3102
  47. package/src/postscribeRender.js +0 -10
  48. package/test/e2e/specs/hello_world_banner_non_sf.spec.js +0 -14
  49. package/test/e2e/specs/outstream_non_sf.spec.js +0 -14
  50. package/test/e2e/specs/outstream_sf.spec.js +0 -14
  51. package/wdio.conf.js +0 -50
@@ -1,10 +0,0 @@
1
- import postscribe from 'postscribe';
2
-
3
- export function writeAdHtml(markup, ps = postscribe) {
4
- // remove <?xml> and <!doctype> tags
5
- // https://github.com/prebid/prebid-universal-creative/issues/134
6
- markup = markup.replace(/\<(\?xml|(\!DOCTYPE[^\>\[]+(\[[^\]]+)?))+[^>]+\>/g, '');
7
- ps(document.body, markup, {
8
- error: console.error
9
- });
10
- }
@@ -1,14 +0,0 @@
1
- const assert = require('assert');
2
-
3
- describe('banner', function() {
4
- it('should load the creative', function() {
5
- browser
6
- .url('http://test.localhost:9990/testpages/hello_world_banner_non-sf.html')
7
- .pause(4000);
8
-
9
- browser.waitForExist('iframe[id="google_ads_iframe_/19968336/puc_test_banner_nonsf_0"]');
10
- let creativeIframe = $('iframe[id="google_ads_iframe_/19968336/puc_test_banner_nonsf_0"]').value;
11
- browser.frame(creativeIframe);
12
- assert.equal(browser.isVisible('body > div[class="GoogleActiveViewElement"] > a > img'), true);
13
- }, 2);
14
- })
@@ -1,14 +0,0 @@
1
- const assert = require('assert');
2
-
3
- describe('outstream', function() {
4
- it('should load outstream non-sf creative', function() {
5
- browser
6
- .url('http://test.localhost:9990/testpages/outstream_non-sf.html')
7
- .scroll(0, 300)
8
- .pause(6000);
9
-
10
- // outstream will create two iframes when loaded
11
- let iframes = browser.elements('div[id="div-gpt-ad-1536590534855-0"] > div:nth-child(2) > iframe')
12
- assert.equal(iframes.value.length, 2);
13
- }, 2);
14
- });
@@ -1,14 +0,0 @@
1
- const assert = require('assert');
2
-
3
- describe('outstream', function() {
4
- it('should load outstream safeframe creative', function() {
5
- browser
6
- .url('http://test.localhost:9990/testpages/outstream_sf.html')
7
- .scroll(0, 300)
8
- .pause(6000);
9
-
10
- // outstream will create two iframes when loaded
11
- let iframes = browser.elements('div[id="div-gpt-ad-1536590946408-0"] > div:nth-child(2) > iframe')
12
- assert.equal(iframes.value.length, 2);
13
- }, 2);
14
- });
package/wdio.conf.js DELETED
@@ -1,50 +0,0 @@
1
- const browsers = require('./browsers.json');
2
-
3
- function getCapabilities() {
4
- function getPlatform(os) {
5
- const platformMap = {
6
- 'Windows': 'WINDOWS',
7
- 'OS X': 'MAC',
8
- }
9
- return platformMap[os];
10
- }
11
-
12
- let capabilities = []
13
- Object.keys(browsers).forEach(key => {
14
- let browser = browsers[key];
15
- capabilities.push({
16
- browserName: browser.browser,
17
- platform: getPlatform(browser.os),
18
- version: browser.browser_version,
19
- acceptSslCerts: true,
20
- build: 'UC ' + new Date().toLocaleString()
21
- });
22
- });
23
- return capabilities;
24
- }
25
-
26
- exports.config = {
27
- specs: [
28
- './test/e2e/specs/*.js'
29
- ],
30
- services: ['browserstack'],
31
- user: process.env.BROWSERSTACK_USERNAME,
32
- key: process.env.BROWSERSTACK_ACCESS_KEY,
33
- browserstackLocal: true,
34
- // Do not increase this, since we have only 5 parallel tests in browserstack account
35
- maxInstances: 5,
36
- capabilities: getCapabilities(),
37
- logLevel: 'silent', // Level of logging verbosity: silent | verbose | command | data | result | error
38
- coloredLogs: true,
39
- waitforTimeout: 90000, // Default timeout for all waitFor* commands.
40
- connectionRetryTimeout: 90000, // Default timeout in milliseconds for request if Selenium Grid doesn't send response
41
- connectionRetryCount: 3, // Default request retries count
42
- framework: 'mocha',
43
- mochaOpts: {
44
- ui: 'bdd',
45
- timeout: 90000,
46
- compilers: ['@babel/register'],
47
- },
48
- // if you see error, update this to spec reporter and logLevel above to get detailed report.
49
- reporters: ['concise']
50
- };