prebid.js 5.19.0 → 6.2.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.
- package/.babelrc.js +1 -10
- package/README.md +4 -2
- package/browsers.json +13 -37
- package/gulpfile.js +1 -0
- package/karma.conf.maker.js +1 -1
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +1 -0
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/admixerBidAdapter.js +2 -1
- package/modules/adnuntiusBidAdapter.js +2 -1
- package/modules/adomikAnalyticsAdapter.js +10 -4
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adyoulikeBidAdapter.js +7 -2
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/appnexusBidAdapter.js +28 -5
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/betweenBidAdapter.js +2 -1
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/craftBidAdapter.js +5 -3
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/glimpseBidAdapter.js +31 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +5 -1
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +15 -9
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +173 -22
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedAnalyticsAdapter.js +5 -0
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +32 -2
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +7 -2
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/prebidServerBidAdapter/index.js +3 -3
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +2 -2
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/trustxBidAdapter.js +18 -7
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +410 -0
- package/modules/ventesBidAdapter.md +93 -0
- package/modules/vidoomyBidAdapter.js +51 -100
- package/modules/visxBidAdapter.js +20 -3
- package/modules/visxBidAdapter.md +4 -6
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/package.json +6 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +14 -13
- package/src/targeting.js +2 -2
- package/src/utils.js +7 -0
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +18 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +3 -1
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +65 -2
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +29 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +288 -5
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +23 -4
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -26
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +19 -2
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +45 -3
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/unit/core/adapterManager_spec.js +26 -7
- package/test/spec/unit/core/targeting_spec.js +44 -0
- package/wdio.conf.js +1 -1
|
@@ -7,6 +7,8 @@ const ENDPOINT = 'https://y.one.impact-ad.jp/h_bid';
|
|
|
7
7
|
const USER_SYNC_URL = 'https://y.one.impact-ad.jp/push_sync';
|
|
8
8
|
const VIDEO_PLAYER_URL = 'https://img.ak.impact-ad.jp/ic/pone/ivt/firstview/js/dac-video-prebid.min.js';
|
|
9
9
|
|
|
10
|
+
const DEFAULT_VIDEO_SIZE = {w: 640, h: 360};
|
|
11
|
+
|
|
10
12
|
describe('yieldoneBidAdapter', function() {
|
|
11
13
|
const adapter = newBidder(spec);
|
|
12
14
|
|
|
@@ -40,32 +42,7 @@ describe('yieldoneBidAdapter', function() {
|
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
describe('buildRequests', function () {
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
'bidder': 'yieldone',
|
|
46
|
-
'params': {
|
|
47
|
-
placementId: '36891'
|
|
48
|
-
},
|
|
49
|
-
'adUnitCode': 'adunit-code1',
|
|
50
|
-
'sizes': [[300, 250], [336, 280]],
|
|
51
|
-
'bidId': '23beaa6af6cdde',
|
|
52
|
-
'bidderRequestId': '19c0c1efdf37e7',
|
|
53
|
-
'auctionId': '61466567-d482-4a16-96f0-fe5f25ffbdf1',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
'bidder': 'yieldone',
|
|
57
|
-
'params': {
|
|
58
|
-
placementId: '47919'
|
|
59
|
-
},
|
|
60
|
-
'adUnitCode': 'adunit-code2',
|
|
61
|
-
'sizes': [[300, 250]],
|
|
62
|
-
'bidId': '382091349b149f"',
|
|
63
|
-
'bidderRequestId': '"1f9c98192de251"',
|
|
64
|
-
'auctionId': '61466567-d482-4a16-96f0-fe5f25ffbdf1',
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
let bidderRequest = {
|
|
45
|
+
const bidderRequest = {
|
|
69
46
|
refererInfo: {
|
|
70
47
|
numIframes: 0,
|
|
71
48
|
reachedTop: true,
|
|
@@ -74,49 +51,318 @@ describe('yieldoneBidAdapter', function() {
|
|
|
74
51
|
}
|
|
75
52
|
};
|
|
76
53
|
|
|
77
|
-
|
|
54
|
+
describe('Basic', function () {
|
|
55
|
+
const bidRequests = [
|
|
56
|
+
{
|
|
57
|
+
'bidder': 'yieldone',
|
|
58
|
+
'params': {placementId: '36891'},
|
|
59
|
+
'adUnitCode': 'adunit-code1',
|
|
60
|
+
'bidId': '23beaa6af6cdde',
|
|
61
|
+
'bidderRequestId': '19c0c1efdf37e7',
|
|
62
|
+
'auctionId': '61466567-d482-4a16-96f0-fe5f25ffbdf1',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
'bidder': 'yieldone',
|
|
66
|
+
'params': {placementId: '47919'},
|
|
67
|
+
'adUnitCode': 'adunit-code2',
|
|
68
|
+
'bidId': '382091349b149f"',
|
|
69
|
+
'bidderRequestId': '"1f9c98192de251"',
|
|
70
|
+
'auctionId': '61466567-d482-4a16-96f0-fe5f25ffbdf1',
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
78
74
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
it('sends bid request to our endpoint via GET', function () {
|
|
76
|
+
expect(request[0].method).to.equal('GET');
|
|
77
|
+
expect(request[1].method).to.equal('GET');
|
|
78
|
+
});
|
|
79
|
+
it('attaches source and version to endpoint URL as query params', function () {
|
|
80
|
+
expect(request[0].url).to.equal(ENDPOINT);
|
|
81
|
+
expect(request[1].url).to.equal(ENDPOINT);
|
|
82
|
+
});
|
|
83
|
+
it('adUnitCode should be sent as uc parameters on any requests', function () {
|
|
84
|
+
expect(request[0].data.uc).to.equal('adunit-code1');
|
|
85
|
+
expect(request[1].data.uc).to.equal('adunit-code2');
|
|
86
|
+
});
|
|
82
87
|
});
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
describe('Old Format', function () {
|
|
90
|
+
const bidRequests = [
|
|
91
|
+
{
|
|
92
|
+
params: {placementId: '0'},
|
|
93
|
+
mediaType: 'banner',
|
|
94
|
+
sizes: [[300, 250], [336, 280]],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
params: {placementId: '1'},
|
|
98
|
+
mediaType: 'banner',
|
|
99
|
+
sizes: [[336, 280]],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
// It doesn't actually exist.
|
|
103
|
+
params: {placementId: '2'},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
params: {placementId: '3'},
|
|
107
|
+
mediaType: 'video',
|
|
108
|
+
sizes: [[1280, 720], [1920, 1080]],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
params: {placementId: '4'},
|
|
112
|
+
mediaType: 'video',
|
|
113
|
+
sizes: [[1920, 1080]],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
params: {placementId: '5'},
|
|
117
|
+
mediaType: 'video',
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
88
121
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
122
|
+
it('parameter sz has more than one size on banner requests', function () {
|
|
123
|
+
expect(request[0].data.sz).to.equal('300x250,336x280');
|
|
124
|
+
expect(request[1].data.sz).to.equal('336x280');
|
|
125
|
+
expect(request[2].data.sz).to.equal('');
|
|
126
|
+
expect(request[3].data).to.not.have.property('sz');
|
|
127
|
+
expect(request[4].data).to.not.have.property('sz');
|
|
128
|
+
expect(request[5].data).to.not.have.property('sz');
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('width and height should be set as separate parameters on outstream requests', function () {
|
|
132
|
+
expect(request[0].data).to.not.have.property('w');
|
|
133
|
+
expect(request[1].data).to.not.have.property('w');
|
|
134
|
+
expect(request[2].data).to.not.have.property('w');
|
|
135
|
+
expect(request[3].data.w).to.equal(1280);
|
|
136
|
+
expect(request[3].data.h).to.equal(720);
|
|
137
|
+
expect(request[4].data.w).to.equal(1920);
|
|
138
|
+
expect(request[4].data.h).to.equal(1080);
|
|
139
|
+
expect(request[5].data.w).to.equal(DEFAULT_VIDEO_SIZE.w);
|
|
140
|
+
expect(request[5].data.h).to.equal(DEFAULT_VIDEO_SIZE.h);
|
|
141
|
+
});
|
|
92
142
|
});
|
|
93
143
|
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
144
|
+
describe('New Format', function () {
|
|
145
|
+
const bidRequests = [
|
|
146
|
+
{
|
|
147
|
+
params: {placementId: '0'},
|
|
148
|
+
mediaTypes: {
|
|
149
|
+
banner: {
|
|
150
|
+
sizes: [[300, 250], [336, 280]],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
params: {placementId: '1'},
|
|
156
|
+
mediaTypes: {
|
|
157
|
+
banner: {
|
|
158
|
+
sizes: [[336, 280]],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
// It doesn't actually exist.
|
|
164
|
+
params: {placementId: '2'},
|
|
165
|
+
mediaTypes: {
|
|
166
|
+
banner: {
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
params: {placementId: '3'},
|
|
172
|
+
mediaTypes: {
|
|
173
|
+
video: {
|
|
174
|
+
context: 'outstream',
|
|
175
|
+
playerSize: [[1280, 720], [1920, 1080]],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
params: {placementId: '4'},
|
|
181
|
+
mediaTypes: {
|
|
182
|
+
video: {
|
|
183
|
+
context: 'outstream',
|
|
184
|
+
playerSize: [1920, 1080],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
params: {placementId: '5'},
|
|
190
|
+
mediaTypes: {
|
|
191
|
+
video: {
|
|
192
|
+
context: 'outstream',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
];
|
|
197
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
198
|
+
|
|
199
|
+
it('parameter sz has more than one size on banner requests', function () {
|
|
200
|
+
expect(request[0].data.sz).to.equal('300x250,336x280');
|
|
201
|
+
expect(request[1].data.sz).to.equal('336x280');
|
|
202
|
+
expect(request[2].data.sz).to.equal('');
|
|
203
|
+
expect(request[3].data).to.not.have.property('sz');
|
|
204
|
+
expect(request[4].data).to.not.have.property('sz');
|
|
205
|
+
expect(request[5].data).to.not.have.property('sz');
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('width and height should be set as separate parameters on outstream requests', function () {
|
|
209
|
+
expect(request[0].data).to.not.have.property('w');
|
|
210
|
+
expect(request[1].data).to.not.have.property('w');
|
|
211
|
+
expect(request[2].data).to.not.have.property('w');
|
|
212
|
+
expect(request[3].data.w).to.equal(1280);
|
|
213
|
+
expect(request[3].data.h).to.equal(720);
|
|
214
|
+
expect(request[4].data.w).to.equal(1920);
|
|
215
|
+
expect(request[4].data.h).to.equal(1080);
|
|
216
|
+
expect(request[5].data.w).to.equal(DEFAULT_VIDEO_SIZE.w);
|
|
217
|
+
expect(request[5].data.h).to.equal(DEFAULT_VIDEO_SIZE.h);
|
|
218
|
+
});
|
|
101
219
|
});
|
|
102
220
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
221
|
+
describe('Multiple Format', function () {
|
|
222
|
+
const bidRequests = [
|
|
223
|
+
{
|
|
224
|
+
// It will be treated as a banner.
|
|
225
|
+
params: {
|
|
226
|
+
placementId: '0',
|
|
227
|
+
},
|
|
228
|
+
mediaTypes: {
|
|
229
|
+
banner: {
|
|
230
|
+
sizes: [[300, 250], [336, 280]],
|
|
231
|
+
},
|
|
232
|
+
video: {
|
|
233
|
+
context: 'outstream',
|
|
234
|
+
playerSize: [1920, 1080],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
// It will be treated as a video.
|
|
240
|
+
params: {
|
|
241
|
+
placementId: '1',
|
|
242
|
+
playerParams: {},
|
|
243
|
+
},
|
|
244
|
+
mediaTypes: {
|
|
245
|
+
banner: {
|
|
246
|
+
sizes: [[300, 250], [336, 280]],
|
|
247
|
+
},
|
|
248
|
+
video: {
|
|
249
|
+
context: 'outstream',
|
|
250
|
+
playerSize: [1920, 1080],
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
];
|
|
255
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
256
|
+
|
|
257
|
+
it('parameter sz has more than one size on banner requests', function () {
|
|
258
|
+
expect(request[0].data.sz).to.equal('300x250,336x280');
|
|
259
|
+
expect(request[1].data).to.not.have.property('sz');
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('width and height should be set as separate parameters on outstream requests', function () {
|
|
263
|
+
expect(request[0].data).to.not.have.property('w');
|
|
264
|
+
expect(request[1].data.w).to.equal(1920);
|
|
265
|
+
expect(request[1].data.h).to.equal(1080);
|
|
266
|
+
});
|
|
106
267
|
});
|
|
107
268
|
|
|
108
|
-
describe('
|
|
109
|
-
const
|
|
269
|
+
describe('FLUX Format', function () {
|
|
270
|
+
const bidRequests = [
|
|
271
|
+
{
|
|
272
|
+
// It will be treated as a banner.
|
|
273
|
+
params: {
|
|
274
|
+
placementId: '0',
|
|
275
|
+
},
|
|
276
|
+
mediaTypes: {
|
|
277
|
+
banner: {
|
|
278
|
+
sizes: [[300, 250], [336, 280]],
|
|
279
|
+
},
|
|
280
|
+
video: {
|
|
281
|
+
context: 'outstream',
|
|
282
|
+
playerSize: [[1, 1]],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
// It will be treated as a video.
|
|
288
|
+
params: {
|
|
289
|
+
placementId: '1',
|
|
290
|
+
playerParams: {},
|
|
291
|
+
playerSize: [1920, 1080],
|
|
292
|
+
},
|
|
293
|
+
mediaTypes: {
|
|
294
|
+
banner: {
|
|
295
|
+
sizes: [[300, 250], [336, 280]],
|
|
296
|
+
},
|
|
297
|
+
video: {
|
|
298
|
+
context: 'outstream',
|
|
299
|
+
playerSize: [[1, 1]],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
// It will be treated as a video.
|
|
305
|
+
params: {
|
|
306
|
+
placementId: '2',
|
|
307
|
+
playerParams: {},
|
|
308
|
+
},
|
|
309
|
+
mediaTypes: {
|
|
310
|
+
banner: {
|
|
311
|
+
sizes: [[300, 250], [336, 280]],
|
|
312
|
+
},
|
|
313
|
+
video: {
|
|
314
|
+
context: 'outstream',
|
|
315
|
+
playerSize: [[1, 1]],
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
];
|
|
320
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
321
|
+
|
|
322
|
+
it('parameter sz has more than one size on banner requests', function () {
|
|
323
|
+
expect(request[0].data.sz).to.equal('300x250,336x280');
|
|
324
|
+
expect(request[1].data).to.not.have.property('sz');
|
|
325
|
+
expect(request[2].data).to.not.have.property('sz');
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('width and height should be set as separate parameters on outstream requests', function () {
|
|
329
|
+
expect(request[0].data).to.not.have.property('w');
|
|
330
|
+
expect(request[1].data.w).to.equal(1920);
|
|
331
|
+
expect(request[1].data.h).to.equal(1080);
|
|
332
|
+
expect(request[2].data.w).to.equal(DEFAULT_VIDEO_SIZE.w);
|
|
333
|
+
expect(request[2].data.h).to.equal(DEFAULT_VIDEO_SIZE.h);
|
|
334
|
+
});
|
|
335
|
+
});
|
|
110
336
|
|
|
337
|
+
describe('LiveRampID', function () {
|
|
111
338
|
it('dont send LiveRampID if undefined', function () {
|
|
112
|
-
|
|
113
|
-
|
|
339
|
+
const bidRequests = [
|
|
340
|
+
{
|
|
341
|
+
params: {placementId: '0'},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
params: {placementId: '1'},
|
|
345
|
+
userId: {},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
params: {placementId: '2'},
|
|
349
|
+
userId: undefined,
|
|
350
|
+
},
|
|
351
|
+
];
|
|
352
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
114
353
|
expect(request[0].data).to.not.have.property('lr_env');
|
|
354
|
+
expect(request[1].data).to.not.have.property('lr_env');
|
|
355
|
+
expect(request[2].data).to.not.have.property('lr_env');
|
|
115
356
|
});
|
|
116
357
|
|
|
117
358
|
it('should send LiveRampID if available', function () {
|
|
118
|
-
|
|
119
|
-
|
|
359
|
+
const bidRequests = [
|
|
360
|
+
{
|
|
361
|
+
params: {placementId: '0'},
|
|
362
|
+
userId: {idl_env: 'idl_env_sample'},
|
|
363
|
+
},
|
|
364
|
+
];
|
|
365
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
120
366
|
expect(request[0].data.lr_env).to.equal('idl_env_sample');
|
|
121
367
|
});
|
|
122
368
|
});
|
|
@@ -162,7 +162,7 @@ describe('adapterManager tests', function () {
|
|
|
162
162
|
'bidderCode': 'appnexus',
|
|
163
163
|
'auctionId': '1863e370099523',
|
|
164
164
|
'bidderRequestId': '2946b569352ef2',
|
|
165
|
-
'
|
|
165
|
+
'uniquePbsTid': '34566b569352ef2',
|
|
166
166
|
'bids': [
|
|
167
167
|
{
|
|
168
168
|
'bidder': 'appnexus',
|
|
@@ -456,7 +456,8 @@ describe('adapterManager tests', function () {
|
|
|
456
456
|
});
|
|
457
457
|
|
|
458
458
|
it('should call spec\'s onBidderError callback when callBidderError is called', function () {
|
|
459
|
-
const
|
|
459
|
+
const bidRequests = getBidRequests();
|
|
460
|
+
const bidderRequest = find(bidRequests, bidRequest => bidRequest.bidderCode === bidder);
|
|
460
461
|
const xhrErrorMock = {
|
|
461
462
|
status: 500,
|
|
462
463
|
statusText: 'Internal Server Error'
|
|
@@ -478,7 +479,7 @@ describe('adapterManager tests', function () {
|
|
|
478
479
|
'bidderCode': 'appnexus',
|
|
479
480
|
'auctionId': '1863e370099523',
|
|
480
481
|
'bidderRequestId': '2946b569352ef2',
|
|
481
|
-
'
|
|
482
|
+
'uniquePbsTid': '34566b569352ef2',
|
|
482
483
|
'timeout': 1000,
|
|
483
484
|
'src': 's2s',
|
|
484
485
|
'adUnitsS2SCopy': [
|
|
@@ -707,7 +708,7 @@ describe('adapterManager tests', function () {
|
|
|
707
708
|
'bidderCode': 'appnexus',
|
|
708
709
|
'auctionId': '1863e370099523',
|
|
709
710
|
'bidderRequestId': '2946b569352ef2',
|
|
710
|
-
'
|
|
711
|
+
'uniquePbsTid': '34566b569352ef2',
|
|
711
712
|
'timeout': 1000,
|
|
712
713
|
'src': 's2s',
|
|
713
714
|
'adUnitsS2SCopy': [
|
|
@@ -843,7 +844,7 @@ describe('adapterManager tests', function () {
|
|
|
843
844
|
'bidderCode': 'pubmatic',
|
|
844
845
|
'auctionId': '1863e370099523',
|
|
845
846
|
'bidderRequestId': '2946b569352ef2',
|
|
846
|
-
'
|
|
847
|
+
'uniquePbsTid': '2342342342lfi23',
|
|
847
848
|
'timeout': 1000,
|
|
848
849
|
'src': 's2s',
|
|
849
850
|
'adUnitsS2SCopy': [
|
|
@@ -1040,6 +1041,21 @@ describe('adapterManager tests', function () {
|
|
|
1040
1041
|
sinon.assert.calledTwice(prebidServerAdapterMock.callBids);
|
|
1041
1042
|
});
|
|
1042
1043
|
|
|
1044
|
+
it('should have one tid for ALL s2s bidRequests', function () {
|
|
1045
|
+
let adUnits = utils.deepClone(getAdUnits()).map(adUnit => {
|
|
1046
|
+
adUnit.bids = adUnit.bids.filter(bid => includes(['appnexus', 'pubmatic'], bid.bidder));
|
|
1047
|
+
return adUnit;
|
|
1048
|
+
})
|
|
1049
|
+
let bidRequests = adapterManager.makeBidRequests(adUnits, 1111, 2222, 1000);
|
|
1050
|
+
adapterManager.callBids(adUnits, bidRequests, () => {}, () => {});
|
|
1051
|
+
sinon.assert.calledTwice(prebidServerAdapterMock.callBids);
|
|
1052
|
+
const firstBid = prebidServerAdapterMock.callBids.firstCall.args[0];
|
|
1053
|
+
const secondBid = prebidServerAdapterMock.callBids.secondCall.args[0];
|
|
1054
|
+
|
|
1055
|
+
// TIDS should be the same
|
|
1056
|
+
expect(firstBid.tid).to.equal(secondBid.tid);
|
|
1057
|
+
});
|
|
1058
|
+
|
|
1043
1059
|
it('should fire for simultaneous s2s and client requests', function () {
|
|
1044
1060
|
adapterManager.bidderRegistry['adequant'] = adequantAdapterMock;
|
|
1045
1061
|
let adUnits = utils.deepClone(getAdUnits()).map(adUnit => {
|
|
@@ -1696,14 +1712,17 @@ describe('adapterManager tests', function () {
|
|
|
1696
1712
|
});
|
|
1697
1713
|
|
|
1698
1714
|
describe('sizeMapping', function () {
|
|
1715
|
+
let sandbox;
|
|
1699
1716
|
beforeEach(function () {
|
|
1717
|
+
sandbox = sinon.sandbox.create();
|
|
1700
1718
|
allS2SBidders.length = 0;
|
|
1701
1719
|
clientTestAdapters.length = 0;
|
|
1702
|
-
|
|
1720
|
+
// always have matchMedia return true for us
|
|
1721
|
+
sandbox.stub(utils.getWindowTop(), 'matchMedia').callsFake(() => ({matches: true}));
|
|
1703
1722
|
});
|
|
1704
1723
|
|
|
1705
1724
|
afterEach(function () {
|
|
1706
|
-
|
|
1725
|
+
sandbox.restore();
|
|
1707
1726
|
config.resetConfig();
|
|
1708
1727
|
setSizeConfig([]);
|
|
1709
1728
|
});
|
|
@@ -461,6 +461,50 @@ describe('targeting tests', function () {
|
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
+
describe('targetingControls.allowZeroCpmBids', function () {
|
|
465
|
+
let bid4;
|
|
466
|
+
let bidderSettingsStorage;
|
|
467
|
+
|
|
468
|
+
before(function() {
|
|
469
|
+
bidderSettingsStorage = $$PREBID_GLOBAL$$.bidderSettings;
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
beforeEach(function () {
|
|
473
|
+
bid4 = utils.deepClone(bid1);
|
|
474
|
+
bid4.adserverTargeting = {
|
|
475
|
+
hb_pb: '0.0',
|
|
476
|
+
hb_adid: '567891011',
|
|
477
|
+
hb_bidder: 'appnexus',
|
|
478
|
+
};
|
|
479
|
+
bid4.bidder = bid4.bidderCode = 'appnexus';
|
|
480
|
+
bid4.cpm = 0;
|
|
481
|
+
bidsReceived = [bid4];
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
after(function() {
|
|
485
|
+
bidsReceived = [bid1, bid2, bid3];
|
|
486
|
+
$$PREBID_GLOBAL$$.bidderSettings = bidderSettingsStorage;
|
|
487
|
+
})
|
|
488
|
+
|
|
489
|
+
it('targeting should not include a 0 cpm by default', function() {
|
|
490
|
+
bid4.adserverTargeting = {};
|
|
491
|
+
const targeting = targetingInstance.getAllTargeting(['/123456/header-bid-tag-0']);
|
|
492
|
+
expect(targeting['/123456/header-bid-tag-0']).to.deep.equal({});
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
it('targeting should allow a 0 cpm with targetingControls.allowZeroCpmBids set to true', function () {
|
|
496
|
+
$$PREBID_GLOBAL$$.bidderSettings = {
|
|
497
|
+
standard: {
|
|
498
|
+
allowZeroCpmBids: true
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
const targeting = targetingInstance.getAllTargeting(['/123456/header-bid-tag-0']);
|
|
503
|
+
expect(targeting['/123456/header-bid-tag-0']).to.include.all.keys('hb_pb', 'hb_bidder', 'hb_adid', 'hb_bidder_appnexus', 'hb_adid_appnexus', 'hb_pb_appnexus');
|
|
504
|
+
expect(targeting['/123456/header-bid-tag-0']['hb_pb']).to.equal('0.0')
|
|
505
|
+
});
|
|
506
|
+
});
|
|
507
|
+
|
|
464
508
|
describe('targetingControls.allowTargetingKeys', function () {
|
|
465
509
|
let bid4;
|
|
466
510
|
|
package/wdio.conf.js
CHANGED
|
@@ -9,7 +9,7 @@ function getCapabilities() {
|
|
|
9
9
|
return platformMap[os];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
// only
|
|
12
|
+
// only Chrome 80 & Firefox 73 run as part of functional tests
|
|
13
13
|
// rest of the browsers are discarded.
|
|
14
14
|
delete browsers['bs_chrome_79_windows_10'];
|
|
15
15
|
delete browsers['bs_firefox_72_windows_10'];
|