diff --git a/modules/oneVideoBidAdapter.js b/modules/oneVideoBidAdapter.js index 8ccdd4f9c56..26b0a7dccc2 100644 --- a/modules/oneVideoBidAdapter.js +++ b/modules/oneVideoBidAdapter.js @@ -6,6 +6,7 @@ export const spec = { code: 'oneVideo', VERSION: '3.0.3', ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=', + E2ETESTENDPOINT: 'https://ads-wc.v.ssp.yahoo.com/rtb/openrtb?ext_id=', SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc', SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}', SYNC_ENDPOINT3: 'https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1', @@ -53,11 +54,17 @@ export const spec = { let consentData = bidRequest ? bidRequest.gdprConsent : null; return bids.map(bid => { + let url = spec.ENDPOINT + let pubId = bid.params.pubId; + if (bid.params.video.e2etest) { + url = spec.E2ETESTENDPOINT; + pubId = 'HBExchange'; + } return { method: 'POST', /** removing adding local protocal since we * can get cookie data only if we call with https. */ - url: spec.ENDPOINT + bid.params.pubId, + url: url + pubId, data: getRequestData(bid, consentData, bidRequest), bidRequest: bid } @@ -290,7 +297,16 @@ function getRequestData(bid, consentData, bidRequest) { bidData.regs.ext.us_privacy = bidRequest.uspConsent } } - + if (bid.params.video.e2etest) { + bidData.imp[0].bidfloor = null; + bidData.imp[0].video.w = 300; + bidData.imp[0].video.h = 250; + bidData.imp[0].video.mimes = ['video/mp4', 'application/javascript']; + bidData.imp[0].video.api = [2]; + bidData.site.page = 'https://verizonmedia.com'; + bidData.site.ref = 'https://verizonmedia.com'; + bidData.tmax = 1000; + } return bidData; } diff --git a/modules/oneVideoBidAdapter.md b/modules/oneVideoBidAdapter.md index 1dbdc473294..72f251aac04 100644 --- a/modules/oneVideoBidAdapter.md +++ b/modules/oneVideoBidAdapter.md @@ -168,6 +168,38 @@ Connects to Verizon Media's Video SSP (AKA ONE Video / Adap.tv) demand source to ] ``` +# End 2 End Testing Mode +By passing bid.params.video.e2etest = true you will be able to receive a test creative when connecting via VPN location U.S West Coast. This will allow you to trubleshoot how your player/ad-server parses and uses the VAST XML response. +This automatically sets default values for the outbound bid-request to respond from our test exchange. +No need to override the site/ref urls or change your pubId +``` +var adUnits = [ + { + code: 'video-1', + mediaTypes: { + video: { + context: "instream", + playerSize: [480, 640] + } + }, + bids: [ + { + bidder: 'oneVideo', + params: { + video: { + playerWidth: 300, + playerHeight: 250, + mimes: ['video/mp4', 'application/javascript'], + e2etest: true + } + pubId: 'YOUR_PUBLISHER_ID' + } + } + ] + } +] +``` + # Supply Chain Object Support The oneVideoBidAdapter supports 2 methods for passing/creating an schain object. 1. By passing your Video SSP Org ID in the bid.video.params.sid - The adapter will create a new schain object and our ad-server will fill in the data for you. diff --git a/test/spec/modules/oneVideoBidAdapter_spec.js b/test/spec/modules/oneVideoBidAdapter_spec.js index 8d12ada9d32..a91e9ac27e8 100644 --- a/test/spec/modules/oneVideoBidAdapter_spec.js +++ b/test/spec/modules/oneVideoBidAdapter_spec.js @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { spec } from 'modules/oneVideoBidAdapter.js'; import * as utils from 'src/utils.js'; -import {config} from 'src/config.js'; describe('OneVideoBidAdapter', function () { let bidRequest; @@ -239,6 +238,27 @@ describe('OneVideoBidAdapter', function () { expect(data.imp[0].video.h).to.equal(height); }); + it('should set pubId to HBExchange when bid.params.video.e2etest = true', function () { + bidRequest.params.video.e2etest = true; + const requests = spec.buildRequests([ bidRequest ], bidderRequest); + expect(requests[0].method).to.equal('POST'); + expect(requests[0].url).to.equal(spec.E2ETESTENDPOINT + 'HBExchange'); + }); + + it('should attach End 2 End test data', function () { + bidRequest.params.video.e2etest = true; + const requests = spec.buildRequests([ bidRequest ], bidderRequest); + const data = requests[0].data; + expect(data.imp[0].bidfloor).to.not.exist; + expect(data.imp[0].video.w).to.equal(300); + expect(data.imp[0].video.h).to.equal(250); + expect(data.imp[0].video.mimes).to.eql(['video/mp4', 'application/javascript']); + expect(data.imp[0].video.api).to.eql([2]); + expect(data.site.page).to.equal('https://verizonmedia.com'); + expect(data.site.ref).to.equal('https://verizonmedia.com'); + expect(data.tmax).to.equal(1000); + }); + it('it should create new schain and send it if video.params.sid exists', function () { const requests = spec.buildRequests([ bidRequest ], bidderRequest); const data = requests[0].data;