cypress: Frequent InvalidStateError when running tests in 3.1.4 update
Current behavior:
When running certain tests, I will frequently get an InvalidStateError on tests that worked previously in 3.1.3. Additionally, this does not happen everytime the test is run. Sometimes the test will pass, but many times this error will happen.
InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').
Desired behavior:
The test should pass without any errors. Consistent behavior from one test run to another.
Steps to reproduce: (app code and test code)
The below test is on a page that loads a HERE map, and consequently receives many XHR responses upon loading. Example code of a test case that resulted in this error, but worked in previous Cypress versions.
const Accounts = require('../../constants/accounts');
const Routes = require('../../constants/routes');
describe('Switching organizations, then refreshes the page', () => {
before(() => {
cy.viewport('macbook-15');
cy.visit(Routes().dashboardBaseUrl);
cy.get('input[name=email]').type(Accounts().email);
cy.get('input[name=password]')
.type(Accounts().pw)
.type('{enter}');
});
it('should default back to original organization view upon refresh', () => {
context('switch from parent organization to child organization', () => {
cy.get('[data=subscribedName]').should(
'have.text',
'organization name'
);
//open the dropdown
cy.get('[data=dropdown-toggle]').click();
//Click on the first child organization
cy.get('[data=orgName]:first').click();
//organization title should have changed
cy.get('[data=subscribedName]').should(
'have.text',
'blacklist'
);
});
cy.reload();
cy.get('[data=subscribedName]').should(
'have.text',
'organization name'
);
});
});
Versions 3.1.4
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 30 (9 by maintainers)
Commits related to this issue
- Fix error on aborting XHRs of non responseType '' or 'text' (#3054) - close #3008 — committed to cypress-io/cypress by jennifer-shehane 5 years ago
- Update to cypress 3.1.5 Fixes error: Error: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'blob')... — committed to EyeSeeTea/vaccination-app by tokland 5 years ago
I’ve started a PR to fix this, so hopefully should get out in 3.1.5 https://github.com/cypress-io/cypress/pull/3054
We have a similar error since the 3.1.4 update
The difference is
text' (was 'blob')instead ofarraybufferTests fail when running
cypress runwith Electron 59. The tests do run successful withcypress openrunning Chrome 71 but fail with the above message withcypress openrunning Electron 59Released in
3.1.5.Would 3.1.5 also fix the
text' (was 'blob')issue?I pulled down the issue-branch and built it locally. We had the
(was ’blob’)which was solved.Looking at the changes in the fix-branch, it looks like every
(was ’xxx’)will be covered.Thanks a bunch @jennifer-shehane 🎉
Same here. I’m getting
Error: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').when running inside docker withcypress run --spec=cypress/tests/visual/*.test.js --browser chrome.Docker base image:
cypress/browsers:chrome69Hey @Dan195, does this happen during
cypress open,cypress run, or both? Could you also specify OS/browser being used?