Blocked a frame with origin "http://localhost:4200" from accessing a cross-origin frame
My app runs locally over http://localhost:4200
(actually an angular application, served by ng serve
).
The home page includes an iframe
to a youtube clip:
<iframe src="https://www.youtube.com/embed/[....]"></iframe>
I'm using cypress-visual-regression
to take snapshots of my application (at various resolutions) to assure my visual refactorings don't introduce any visual regression.
My visual regression testing fails because the iframe is still loading (the snapshots taken prove that the clip is still loading by the time of the shot).
I tried to use cypress-iframe
to make cypress
wait the full load:
cy.visit('/');
cy.viewport(width, height);
cy.frameLoaded(); // wait iframe
cy.compareSnapshot(`${width}x${height}`); // take snapshot
But it fails with:
Blocked a frame with origin "http://localhost:4200" from accessing a cross-origin frame
Any workaround?