Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityError due to accessing a cross-origin frame without navigating outside of the site #3685

Closed
Haegin opened this issue Mar 11, 2019 · 6 comments
Labels
stage: ready for work The issue is reproducible and in scope stale no activity on this issue for a long period topic: cross-origin ⤭ Topics related to cross-origin navigation in tests

Comments

@Haegin
Copy link

Haegin commented Mar 11, 2019

Current behavior:

I've got a very simple test that just loads a website (https://femalefunders.com) and checks the title and some links are present. The first time I ran it some of the tests passed or failed correctly but the last test threw an error and since then every test on every test run has thrown the same error.

SecurityError: Blocked a frame with origin "https://femalefunders.com" from accessing a cross-origin frame.

Desired behavior:

The tests shouldn't error and should pass (or fail) correctly. The tests in question aren't accessing an external site or changing the base URL.

Steps to reproduce: (app code and test code)

  1. Clone https://github.com/Haegin/cypress-test-tiny/
  2. Checkout the female-funders branch
  3. Launch Cypress with CYPRESS_baseUrl='https://femalefunders.com' yarn cypress open
  4. Run the tests. I get the same error in both Electron and Chrome.

Versions

Cypress: 3.1.5
OS: macOS Mojave 10.14.3
Chrome: 72.0.3626.121 (Official Build) (64-bit)

@kristian-puccio
Copy link

I'm finding the same thing.

To get around I refresh the tests in Cypress and sometimes I can get through without this error

@flotwig
Copy link
Contributor

flotwig commented May 18, 2019

Does your server send Content-Type: text/html as a header? If it doesn't have this, Cypress can show this error: #4238

@kristian-puccio
Copy link

I've double checked an mine does set the correct header.

One thing I am doing though is generating the test functions inside a context call.
Maybe Cypress needs statically defined tests to cleanup after itself?

@sainthkh sainthkh added stage: ready for work The issue is reproducible and in scope topic: cross-origin ⤭ Topics related to cross-origin navigation in tests labels Nov 11, 2020
@sainthkh
Copy link
Contributor

This is still happening at 5.6.0.

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 18, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: ready for work The issue is reproducible and in scope stale no activity on this issue for a long period topic: cross-origin ⤭ Topics related to cross-origin navigation in tests
Projects
None yet
Development

No branches or pull requests

5 participants