3
3
/* eslint-disable no-undef */
4
4
import { VASTParser } from '@dailymotion/vast-client' ;
5
5
6
+ const cacheKiller = Date . now ( ) ;
7
+
6
8
describe ( 'Linear Test : Inline' , ( ) => {
7
9
it ( 'Player source is ad source' , ( ) => {
8
- const vastUrl = ' /fixtures/Inline_Simple.xml' ;
10
+ const vastUrl = ` /fixtures/Inline_Simple.xml?cacheKiller= ${ cacheKiller } ` ;
9
11
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
10
12
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
11
13
cy . wait ( '@vastFile' ) . then ( ( req ) => {
@@ -15,7 +17,7 @@ describe('Linear Test : Inline', () => {
15
17
. then ( ( parsedVAST ) => {
16
18
const linearAd = parsedVAST . ads [ 0 ] . creatives . filter ( ( creative ) => creative . type === 'linear' ) [ 0 ] ;
17
19
cy . window ( ) . then ( ( win ) => {
18
- win . adsPlugin . player . on ( 'play' , ( data ) => {
20
+ win . adsPlugin . player . on ( 'play' , ( ) => {
19
21
cy . get ( 'video' ) . should ( 'have.prop' , 'src' , linearAd . mediaFiles [ 0 ] . fileURL ) ;
20
22
} ) ;
21
23
cy . get ( '.vjs-big-play-button' ) . click ( ) ;
@@ -28,7 +30,7 @@ describe('Linear Test : Inline', () => {
28
30
29
31
describe ( 'Linear Test : Wrapper' , ( ) => {
30
32
it ( 'Creative is reachable' , ( ) => {
31
- const vastUrl = ' /fixtures/Wrapper_Tag-test.xml' ;
33
+ const vastUrl = ` /fixtures/Wrapper_Tag-test.xml?cacheKiller= ${ cacheKiller } ` ;
32
34
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
33
35
cy . intercept ( 'GET' , vastUrl ) . as ( 'subVastFile' ) ;
34
36
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
@@ -45,7 +47,7 @@ describe('Linear Test : Wrapper', () => {
45
47
46
48
describe ( 'Linear : skip' , ( ) => {
47
49
it ( 'Skip button should be present' , ( ) => {
48
- const vastUrl = ' http://localhost:3000/fixtures/vast_skip.xml' ;
50
+ const vastUrl = ` http://localhost:3000/fixtures/vast_skip.xml?cacheKiller= ${ cacheKiller } ` ;
49
51
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
50
52
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
51
53
cy . wait ( '@vastFile' ) . then ( ( ) => {
@@ -58,7 +60,7 @@ describe('Linear : skip', () => {
58
60
describe ( 'Linear : icon' , ( ) => {
59
61
it ( 'Icon has been added' , ( ) => {
60
62
let linearAd ;
61
- const vastUrl = ' /fixtures/IconClickFallbacks.xml' ;
63
+ const vastUrl = ` /fixtures/IconClickFallbacks.xml?cacheKiller= ${ cacheKiller } ` ;
62
64
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
63
65
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
64
66
cy . wait ( '@vastFile' ) . then ( ( req ) => {
@@ -78,7 +80,7 @@ describe('Linear : icon', () => {
78
80
79
81
describe ( 'Linear Test : companions' , ( ) => {
80
82
it ( 'Player should display companions' , ( ) => {
81
- const vastUrl = ' /fixtures/Inline_Companion_Tag-test.xml' ;
83
+ const vastUrl = ` /fixtures/Inline_Companion_Tag-test.xml?cacheKiller= ${ cacheKiller } ` ;
82
84
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
83
85
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
84
86
cy . wait ( '@vastFile' ) . then ( ( req ) => {
@@ -122,7 +124,7 @@ describe('Linear Test : companions', () => {
122
124
123
125
describe ( 'Linear Test : adPods' , ( ) => {
124
126
it ( 'Player should play all ads of adpods' , ( ) => {
125
- const vastUrl = ' /fixtures/wrapper-ad-pod.xml' ;
127
+ const vastUrl = ` /fixtures/wrapper-ad-pod.xml?cacheKiller= ${ cacheKiller } ` ;
126
128
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
127
129
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
128
130
cy . wait ( '@vastFile' ) . then ( ( req ) => {
@@ -138,7 +140,7 @@ describe('Linear Test : adPods', () => {
138
140
139
141
describe ( 'Linear Test : empty VAST' , ( ) => {
140
142
it ( 'Player should play normal video and no vast event' , ( ) => {
141
- const vastUrl = ' /fixtures/empty-no-ad.xml' ;
143
+ const vastUrl = ` /fixtures/empty-no-ad.xml?cacheKiller= ${ cacheKiller } ` ;
142
144
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
143
145
// cy.intercept('GET', videoFile).as('videoFile');
144
146
cy . visit ( `http://localhost:3000/?vastUrl=${ encodeURIComponent ( vastUrl ) } ` ) ;
@@ -155,7 +157,7 @@ describe('Linear Test : empty VAST', () => {
155
157
156
158
describe ( 'Linear Test : Impression' , ( ) => {
157
159
it . skip ( 'Impression are tracked' , ( ) => {
158
- const vastUrl = ' /fixtures/wrapper-ad-pod.xml' ;
160
+ const vastUrl = ` /fixtures/wrapper-ad-pod.xml?cacheKiller= ${ cacheKiller } ` ;
159
161
// intercept final vast
160
162
cy . intercept ( 'GET' , 'inline-linear.xml' ) . as ( 'vastFile' ) ;
161
163
// cy.intercept('GET', videoFile).as('videoFile');
@@ -202,7 +204,7 @@ describe('Linear Test : Impression', () => {
202
204
203
205
describe ( 'Linear Test : verification' , ( ) => {
204
206
it ( 'Verification script are loaded' , ( ) => {
205
- const vastUrl = ' /fixtures/Ad_Verification-test.xml' ;
207
+ const vastUrl = ` /fixtures/Ad_Verification-test.xml?cacheKiller= ${ cacheKiller } ` ;
206
208
cy . intercept ( 'GET' , vastUrl ) . as ( 'vastFile' ) ;
207
209
cy . intercept ( 'GET' , '/fixtures/verification.js' ) . as ( 'verificationScript1' ) ;
208
210
cy . intercept ( 'GET' , '/fixtures/verification2.js' ) . as ( 'verificationScript2' ) ;
0 commit comments