Skip to content

Commit 7478b4b

Browse files
authored
feat(VAST-64): e2e tests randomly fails (#57)
* feat(VAST-64): e2e tests randomly fails * feat(VAST-64): update test video * chore: compiled files * chore: remove console
1 parent 979b85d commit 7478b4b

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

cypress/e2e/all.cy.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
/* eslint-disable no-undef */
44
import { VASTParser } from '@dailymotion/vast-client';
55

6+
const cacheKiller = Date.now();
7+
68
describe('Linear Test : Inline', () => {
79
it('Player source is ad source', () => {
8-
const vastUrl = '/fixtures/Inline_Simple.xml';
10+
const vastUrl = `/fixtures/Inline_Simple.xml?cacheKiller=${cacheKiller}`;
911
cy.intercept('GET', vastUrl).as('vastFile');
1012
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
1113
cy.wait('@vastFile').then((req) => {
@@ -15,7 +17,7 @@ describe('Linear Test : Inline', () => {
1517
.then((parsedVAST) => {
1618
const linearAd = parsedVAST.ads[0].creatives.filter((creative) => creative.type === 'linear')[0];
1719
cy.window().then((win) => {
18-
win.adsPlugin.player.on('play', (data) => {
20+
win.adsPlugin.player.on('play', () => {
1921
cy.get('video').should('have.prop', 'src', linearAd.mediaFiles[0].fileURL);
2022
});
2123
cy.get('.vjs-big-play-button').click();
@@ -28,7 +30,7 @@ describe('Linear Test : Inline', () => {
2830

2931
describe('Linear Test : Wrapper', () => {
3032
it('Creative is reachable', () => {
31-
const vastUrl = '/fixtures/Wrapper_Tag-test.xml';
33+
const vastUrl = `/fixtures/Wrapper_Tag-test.xml?cacheKiller=${cacheKiller}`;
3234
cy.intercept('GET', vastUrl).as('vastFile');
3335
cy.intercept('GET', vastUrl).as('subVastFile');
3436
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
@@ -45,7 +47,7 @@ describe('Linear Test : Wrapper', () => {
4547

4648
describe('Linear : skip', () => {
4749
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}`;
4951
cy.intercept('GET', vastUrl).as('vastFile');
5052
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
5153
cy.wait('@vastFile').then(() => {
@@ -58,7 +60,7 @@ describe('Linear : skip', () => {
5860
describe('Linear : icon', () => {
5961
it('Icon has been added', () => {
6062
let linearAd;
61-
const vastUrl = '/fixtures/IconClickFallbacks.xml';
63+
const vastUrl = `/fixtures/IconClickFallbacks.xml?cacheKiller=${cacheKiller}`;
6264
cy.intercept('GET', vastUrl).as('vastFile');
6365
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
6466
cy.wait('@vastFile').then((req) => {
@@ -78,7 +80,7 @@ describe('Linear : icon', () => {
7880

7981
describe('Linear Test : companions', () => {
8082
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}`;
8284
cy.intercept('GET', vastUrl).as('vastFile');
8385
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
8486
cy.wait('@vastFile').then((req) => {
@@ -122,7 +124,7 @@ describe('Linear Test : companions', () => {
122124

123125
describe('Linear Test : adPods', () => {
124126
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}`;
126128
cy.intercept('GET', vastUrl).as('vastFile');
127129
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
128130
cy.wait('@vastFile').then((req) => {
@@ -138,7 +140,7 @@ describe('Linear Test : adPods', () => {
138140

139141
describe('Linear Test : empty VAST', () => {
140142
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}`;
142144
cy.intercept('GET', vastUrl).as('vastFile');
143145
// cy.intercept('GET', videoFile).as('videoFile');
144146
cy.visit(`http://localhost:3000/?vastUrl=${encodeURIComponent(vastUrl)}`);
@@ -155,7 +157,7 @@ describe('Linear Test : empty VAST', () => {
155157

156158
describe('Linear Test : Impression', () => {
157159
it.skip('Impression are tracked', () => {
158-
const vastUrl = '/fixtures/wrapper-ad-pod.xml';
160+
const vastUrl = `/fixtures/wrapper-ad-pod.xml?cacheKiller=${cacheKiller}`;
159161
// intercept final vast
160162
cy.intercept('GET', 'inline-linear.xml').as('vastFile');
161163
// cy.intercept('GET', videoFile).as('videoFile');
@@ -202,7 +204,7 @@ describe('Linear Test : Impression', () => {
202204

203205
describe('Linear Test : verification', () => {
204206
it('Verification script are loaded', () => {
205-
const vastUrl = '/fixtures/Ad_Verification-test.xml';
207+
const vastUrl = `/fixtures/Ad_Verification-test.xml?cacheKiller=${cacheKiller}`;
206208
cy.intercept('GET', vastUrl).as('vastFile');
207209
cy.intercept('GET', '/fixtures/verification.js').as('verificationScript1');
208210
cy.intercept('GET', '/fixtures/verification2.js').as('verificationScript2');

0 commit comments

Comments
 (0)