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

[cypress] fix accessing a cross-origin frame error #7552

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented May 20, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Cypress dashboard tests randomly failed with error message:
Error: Blocked a frame with origin "https://*******.com" from accessing a cross-origin frame.

Screen Shot 2019-05-19 at 6 57 28 PM

This issues is reported here, and it also gave a solution:
cypress-io/cypress#1951

(There might have other error message, use #7538 track all cypress flaky issues)

TEST PLAN

CI

REVIEWERS

@mistercrunch @michellethomas

@graceguo-supercat graceguo-supercat force-pushed the gg-FixSaveDashIntegrationTest branch from ea0676d to a9492a3 Compare May 20, 2019 05:42
@codecov-io
Copy link

codecov-io commented May 20, 2019

Codecov Report

Merging #7552 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7552   +/-   ##
=======================================
  Coverage   65.17%   65.17%           
=======================================
  Files         433      433           
  Lines       21428    21428           
  Branches     2360     2360           
=======================================
  Hits        13966    13966           
  Misses       7342     7342           
  Partials      120      120

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ae000a...6d4f4ec. Read the comment docs.

@mistercrunch
Copy link
Member

Now I'm wondering if chromeWebSecurity would ever catch relevant security issues, and that setting it to false we may miss out on that?

How about only disabling it for the scope of this test? https://docs.cypress.io/guides/references/configuration.html#Cypress-config

@graceguo-supercat
Copy link
Author

graceguo-supercat commented May 21, 2019

The cross-origin frame error seems only happens for dashboard test: user save-as a new copy, server-side response a new dashboard id, and then page be redirected to new dashboard.
According to https://docs.cypress.io/guides/guides/web-security.html#Disabling-Web-Security, it is a JavaScript Redirects. In our test, dashboard was not redirect to subdomain or new domain, but cypress still show error randomly.
According to solution suggested by cypress, Set chromeWebSecurity to false in cypress.json and we’ll take care of the rest., i am not sure this config can be changed at run time, but i can still change to see if it will work.

@graceguo-supercat graceguo-supercat force-pushed the gg-FixSaveDashIntegrationTest branch from a9492a3 to 6d4f4ec Compare May 21, 2019 18:47
Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mistercrunch
Copy link
Member

Next time we see this test flake again maybe we can set it to false globally

@mistercrunch
Copy link
Member

Superseded by #7538

@graceguo-supercat
Copy link
Author

@mistercrunch you close this by accident?

@graceguo-supercat graceguo-supercat merged commit efb085a into apache:master May 21, 2019
@graceguo-supercat graceguo-supercat deleted the gg-FixSaveDashIntegrationTest branch August 8, 2019 20:38
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants