cypress: Page doesn't load as expected

Bug

I wanna test ad unit’s using cypress. But when i open this url in cypress - https://www.tripsavvy.com/when-should-you-get-your-luggage-wrapped-4146609?kw=TEST4534121759 - ad unit’s load broken

Current behavior:

screen shot 2018-04-03 at 9 54 18 am

Desired behavior:

screen shot 2018-04-03 at 9 54 48 am

How to reproduce:

Just open this url using cypress cy.visit(“https://www.tripsavvy.com/when-should-you-get-your-luggage-wrapped-4146609?kw=TEST4534121759”);

Test code:

'use strict';

describe('FIU', () => {

  it('FIU', () => {
  	cy.visit("https://www.tripsavvy.com/when-should-you-get-your-luggage-wrapped-4146609?kw=TEST4534121759");
  });
});

Additional Info (images, stack traces, etc)

I was trying to set “chromeWebSecurity”: false , but it didn’t help

Thank you!

  • Operating System: Mac Os Hight Sierra 10.13.3
  • Cypress Version: 2.1.0
  • Browser Version: Chrome 65.0.3325.181, see same issue on Electron 59, and Canary 67

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 2
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@maxim94plyasunov It appears your ad is using “frame busting” to get access to the root document’s page from the iframe and set the height/width of itself. By default Cypress blocks this from happening so the app can’t mess up Cypress’s Test Runner, which runs your app inside an iframe itself. There is an option to disable this by setting modifyObstructiveCode=false in cypress.json, but that still might not fix your problem. I tried to display your webpage from an iframe in Chrome, and it didn’t work, giving me this error

Refused to display 'https://www.tripsavvy.com/when-should-you-get-your-luggage-wrapped-4146609?kw=TEST4534121759' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' *.specless.io *.specless.tech http://*.seo.aws.about.com https://*.seo.aws.about.com www.tripsavvy.com *.qa.aws.tripsavvy.com atlas.tripsavvy.com atlas.local.tripsavvy.com".

i’am facing the same issue , and ADS are not showing up while running it through cypress ,any fixes yet? modifyObstructiveCode=false and 'chromeWebSecurity": false are not working .