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

Fails with Chrome 73 #3699

Closed
streamnsight opened this issue Mar 13, 2019 · 4 comments
Closed

Fails with Chrome 73 #3699

streamnsight opened this issue Mar 13, 2019 · 4 comments

Comments

@streamnsight
Copy link

Current behavior:

before update to Chrome 73, everything was running fine. Since update Cypress fails, timeout, does not connect to Chrome it seems

Steps to reproduce: (app code and test code)

just update Chrome and relaunch.

Versions

Cypress 3.1.5
Chrome 73
Linux, Mac OS X

@jennifer-shehane
Copy link
Member

Hey @streamnsight, could you provide an example of the test code you are running when you experience this?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Mar 13, 2019
@streamnsight
Copy link
Author

streamnsight commented Mar 13, 2019

Last time we had an issue, it was Cypress not connecting to Chrome at all.

This time, it seems linked to our upload command.

The code goes like this to simulate a browser event:

cy.get(selector).then(subject =>
		cy
			.fixture(fileName, 'base64')
			.then(Cypress.Blob.base64StringToBlob)
			.then(blob => {
				const el = subject[0];
				const testFile = new File([blob], fileName, {
					type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
				});
				const dataTransfer = new DataTransfer();
				dataTransfer.items.add(testFile);
				el.files = dataTransfer.files;
			})
	);

it then waits for the POST api call to happen (registered as an alias) and now it just waits, but the POST never happens, so this code doesn't work anymore.

@streamnsight
Copy link
Author

streamnsight commented Mar 13, 2019

cy.get(selector).then(subject =>
		cy
			.fixture(fileName, 'base64')
			.then(Cypress.Blob.base64StringToBlob)
			.then(blob => {
				const el = subject[0];
				const testFile = new File([blob], fileName, {
					type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
				});
				const dataTransfer = new DataTransfer();
				dataTransfer.items.add(testFile);
				el.files = dataTransfer.files;
                               el.dispatchEvent(new Event('change', { bubbles: true }));  
                              // ^^^ adding this line seems to fix it.
			})
	);

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Mar 14, 2019
@giovannyquin
Copy link

thanks @streamnsight that solution worked well to me, I was having the issue running cypress tests in docker, so you saved me

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

3 participants