'Cypress Security Error. Can only call open() on same-origin documents

I'm learning Cypress and decided to test a 3d party website as a practice. This 3dparty website uses subdomains. (ex catalog.main.com, cart.main.com, news.main.com)

So I set a base Url (main.com) in cypress.json file. But for some reason I get the following error when running my tests Security Error Failed to execute 'open' on 'Document': Can only call open() on same-origin documents.

So I tried to remove the base URL and use a separate subdomain URL for each test. And got even more Security errors like above.

Could you please tell me how can I get rid of this error?

P.S. I set "chromeWebSecurity: false" in my cypress.json file



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source