Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenX test parameter is added in order to help publishers test video inventory #5516

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ function generateVideoParameters(bid, bidderRequest) {
queryParams.vmimes = oxVideoConfig.mimes;
}

if (bid.params.test) {
queryParams.vtest = 1;
}

return queryParams;
}

Expand Down
37 changes: 37 additions & 0 deletions test/spec/modules/openxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,38 @@ describe('OpenxAdapter', function () {
expect(spec.isBidRequestValid(videoBidWithMediaType)).to.equal(false);
});
});

describe('and request config uses test', () => {
const videoBidWithTest = {
bidder: 'openx',
params: {
unit: '12345678',
delDomain: 'test-del-domain',
test: true
},
adUnitCode: 'adunit-code',
mediaTypes: {
video: {
playerSize: [640, 480]
}
},
bidId: '30b31c1838de1e',
bidderRequestId: '22edbae2733bf6',
auctionId: '1d1a030790a475',
transactionId: '4008d88a-8137-410b-aa35-fbfdabcb478e'
};

let mockBidderRequest = {refererInfo: {}};

it('should return true when required params found', function () {
expect(spec.isBidRequestValid(videoBidWithTest)).to.equal(true);
});

it('should send video bid request to openx url via GET, with vtest=1 video parameter', function () {
const request = spec.buildRequests([videoBidWithTest], mockBidderRequest);
expect(request[0].data.vtest).to.equal(1);
});
});
});
});

Expand Down Expand Up @@ -1126,6 +1158,11 @@ describe('OpenxAdapter', function () {
expect(dataParams.vwd).to.equal(640);
});

it('shouldn\'t have the test parameter', function () {
const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
expect(request[0].data.vtest).to.be.undefined;
});

it('should send a bc parameter', function () {
const request = spec.buildRequests(bidRequestsWithMediaTypes, mockBidderRequest);
const dataParams = request[0].data;
Expand Down