Closed chamino closed 2 years ago
Hello @chamino, Indeed it's not really a XHR request as trackers (or pixels) by definition will be requested through the source of an image tag. https://github.com/dailymotion/vast-client-js/blob/d13ba9a566af10555673ac04b9c1aa4f164a9a44/src/util/util.js#L9 But on my side I'm able to intercept it with cy.intercept and wait like below.
cy.intercept('GET', 'https://foo.bar/my-first-quartile-tracker-url').as('trackerFirstQuartile')
cy.wait('@trackerFirstQuartile')
If the tracker url is not requested the wait command will fail with following error No request ever occurred.
Tell me if that works for you, if not can you provide more details ?
Hi, thank you for the tip it works! I was trying to get the callCount which didn't work, but at the end we created an object on window and pushed events there during integration tests so we can verify how many times it's been called. (Like how GTM works).
You're welcome ! 👍 I will close this issue then, please feel free to open another one if needed.
Hi, I'm trying to write integration tests to test that events are sent properly. However, intercept/spy doesn't work in cypress, probably because it's not XHR . Do you have a recommended way to write integration tests?