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

blank page during visit #6191

Closed
bahmutov opened this issue Jan 17, 2020 · 10 comments
Closed

blank page during visit #6191

bahmutov opened this issue Jan 17, 2020 · 10 comments

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Jan 17, 2020

Cypress v3.8.2 on MAc

Spec

describe('QA Admin', () => {
	it('Loads the auth page, not an empty frame', () => {
		cy.visit('https://redacted.alumniq.com/admin/index.cfm/login');
		cy.get('input');
	});
});

Page is blank

Notice the iframed document only has <head>...</head> element, no <body> at all.

See the following in the terminal (I have added a few line breaks to break the single string)

[11854:0117/162940.246364:ERROR:CONSOLE(0)] "Blocked script execution in 'data:text/html;charset=UTF-8,%3Chead%3E%20%3Cscript%20type='text/javascript'%3E%20document.domain%20=%20'alumniq.com';%20var%20Cypress%20=%20window.Cypress%20=%20parent.Cypress;
%20if%20
(!Cypress)%20%7B%20throw%20new%20Error('Something%20went%20terribly%20wrong%20and%20we%20cannot%20proceed.%20We%20expected%20to%20find%20the%20global%20Cypress
%20in%20the%20parent%20window%20but%20it%20is%20missing!.%20This%20should
%20never%20happen%20and%20likely%20is%20a%20bug.%20Please%20open%20an%20issue!');%20%7D;%20Cypress.action('app:window:before:load',%20window);
%20%3C/script%3E%20%3C/head%3E' because the document's frame is sandboxed 
and the 'allow-scripts' permission is not set.", source: data:text/html;charset=UTF-8,%3Chead%3E%20%3Cscript%20type='text/javascript'%3E%20document.domain%20=%20'
alumniq.com';%20var%20Cypress%20=%20window.Cypress%20=%20parent.Cypress;
%20if%20(!Cypress)%20%7B%20throw%20new%20Error('Something%20went%20terribly%20wrong%20and%20we%20cannot%20proceed.%20We%20expected%20to%20find%20the%20
global%20Cypress%20in%20the%20parent%20window%20but%20it%20is%20missing!.
%20This%20should%20never%20happen%20and%20likely%20is%20a%20bug.%20Please%
20open%20an%20issue!');%20%7D;%20Cypress.action('app:window:before:load',
%20window);%20%3C/script%3E%20%3C/head%3E (0)

Relevant error from the above text

Blocked script execution in 'data:text/html... '
because the document's frame is sandboxed  and the 'allow-scripts' permission 
is not set.", source: data:text/html;charset=UTF-...
@bahmutov
Copy link
Contributor Author

bahmutov commented Jan 17, 2020

After playing some more, see this error in the DevTools console

@bahmutov
Copy link
Contributor Author

bahmutov commented Jan 17, 2020

By inspecting the document.domain between top and aut frames I see the difference

top.document.domain = foo.com

app document.domain = redacted.foo.com

@flotwig
Copy link
Contributor

flotwig commented Jan 17, 2020

do they embed an iframe with the sandbox attribute? if so this sounds like another thing that #5273 could help with

@atuttle
Copy link

atuttle commented Jan 17, 2020

This ticket originated with my request for help on twitter/in gitter... @flotwig can you clarify your question? I don't follow. The page that we're attempting to load doesn't include any iframes (some parts of our application do, but we haven't gotten to writing tests for any of those screens yet.)

@bahmutov
Copy link
Contributor Author

no, @flotwig I could not any iframes there - I think this message comes from aut iframe

@atuttle
Copy link

atuttle commented Jan 22, 2020

Is there anything I can do to assist in debugging?

@flotwig flotwig self-assigned this Jan 22, 2020
@atuttle
Copy link

atuttle commented Jan 24, 2020

I'll be offline for a week, starting tonight. If you need any more information or if you think making some changes could help, please contact my colleagues at helpdesk@alumniq.com

@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Apr 27, 2020
@villelahdenvuo
Copy link

This also happens to me randomly and I have to close Electron and restart the suite.

@jennifer-shehane
Copy link
Member

I'm not able to recreate this issue with the code provided anymore.

Screen Shot 2020-08-12 at 2 28 33 PM

Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please comment in this issue with a reproducible example and we will consider reopening the issue.

@jennifer-shehane jennifer-shehane removed the stage: needs investigating Someone from Cypress needs to look at this label Aug 12, 2020
@villelahdenvuo
Copy link

In case anyone finds this issue, in my case the issue was caused by the experimentalFetchPolyfill setting. It worked fine in the beginning and I replaced my custom polyfill solution, however it started failing in a way that the first cy.visit command would work, but after that I would just get a blank screen and if I tried to retry it would get stuck on loading tests.

After I disabled that and installed a third party polyfill plugin: https://github.com/rckeller/cypress-unfetch it started working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants