Test execution is stopped.
Below error is displayed on command prompt.
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
cypress log:

Test should work.
Testing internal application
Latest
Please provide more information, i.e.
Please answer _at least_ these questions but understand to investigate this, a reproducible example is almost always necessary.
This looks like a zlib error, but we have no way of accessing if this is related to Cypress.
@ValerieThoma
What OS are you on?
Windows 7
What browser are you using and/or how are you running Cypress?
Chrome latest
Where are you running Cypress? i.e. locally, CI, etc.
Locally
At what point in your test run does Cypress stop? Is it the same always?
Random
Is this behavior consistent across Electron/Chrome browsers?
Yes
Try below steps:
cy.visit('http://front-t-u3.sandbox.local/df')
cy.get('input.search-input').first()
.type('hotels')
cy.get('span.si.si-search').first()
.click()
cy.get('a.thematic__wrapper-link').first()
.click()
cy.get('span.add-to-cart__content').first()
.click()
cy.get('a.button.primary.no-margin-bottom')
.click()
cy.get('span.basket-count').should('contain','1')
cy.get('span.si.si-cart').last()
.click()
cy.get('input#checkout-email-address')
.type('[email protected]')
cy.get('input#shipping_lastname')
.type('lname')
cy.get('input#shipping_firstname')
.type('fname')
cy.get('input#shipping_street_1')
.type('stret1')
cy.get('input#shipping_street_2')
.type('stret2')
cy.get('input#shipping_postcode')
.type('12345')
cy.get('input#shipping_city')
.type('paris')
cy.get('input#shipping_telephone')
.type('1234567890')
cy.get('button#to-payment.button.primary.large-5.medium-5.small-12.no-margin')
.click()
Thank you for sharing a few more details.
I cannot reproduce because I cannot make this cy.visit(), but are you offering that this is the test that gives you the above error?
@ValerieThoma try with cy.visit('http://www.smartbox.com/fr/'). Run above test twice in same window,
Okay, I ran this test (4 times) in Chrome 66 before Cypress stopped.
The first three times resulted in Cypress timing out with this message:

I ran this test in Electron, and Cypress timed out waiting for the same element.
This time with a console error too:

This is configurable here
It's likely your
we're experiencing the same issue with some urls in our tests. I've tried with the example above and was able to reproduce the error by disabling chromeWebSecurity
Just to inform you that we have the same issue at our end. It crashes randomly at any given moment. Also windows 7, Cypress 3.0.1 and latest chrome 67.0.3396.62.
@jamesmckenzie does it solve if we enable chomeWebSecurity? Or does cypress then do not run anymore?
@neutcomp to clarify, disabling chromeWebSecurity doesn't fix the issue, it just allows the above example to work without failing due to the same-origin-policy restrictions.
@jamesmckenzie @neutcomp @ValerieThoma @jennifer-shehane
It will be really helpful if we can get below issue fixed:
Below error is displayed on command prompt.
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
@jennifer-shehane @ValerieThoma @brian-mann Guyes can you please run blow test few times:
OS- Windows 7
NPM version 5.6
Cypress version 3.1.0
Add "chromeWebSecurity" : false in cypress.json
Add
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})#
in Command.js
Code:
describe('checkout', function () {
it('add card details', function () {
cy.visit('http://www.smartbox.com/fr/')
window.top.Cypress
cy.get('button.button.primary.js-accept-cookies.cookie-consent__continue.gdpr-modal-button.gdpr-modal-button-continue')
.click()
cy.get('input.search-input').first()
.type('hotels')
cy.get('span.si.si-search').first()
.click()
cy.get('a.thematic__wrapper-link').first()
.click()
cy.get('span.add-to-cart__content').first()
.click()
cy.get('a.button.primary.no-margin-bottom')
.click()
cy.get('span.si.si-cart').last()
.click({ force: true })
cy.get('input#checkout-email-address')
.type('abc@gmail.com')
cy.get('input#shipping_lastname')
.type('lname')
cy.get('input#shipping_firstname')
.type('fname')
cy.get('input#shipping_street_1')
.type('stret1')
cy.get('input#shipping_street_2')
.type('stret2')
cy.get('input#shipping_postcode')
.type('12345')
cy.get('input#shipping_city')
.type('paris')
cy.get('input#shipping_telephone')
.clear()
.type('0123456789')
cy.get('button#to-payment.button.primary.large-5.medium-5.small-12.no-margin')
.click()
cy.get('input#card-number').clear()
.type('4111111111111111')
cy.get('input#card-owner')
.type('Test')
cy.get('.month.expand.month').select('1')
cy.get('.year.expand').select('2020')
cy.get('input#card-security-code')
.type('123')
})
})
Cypress is stopped with below error:
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
@arun290636 When I run the code above, I get the following error where it clicks on the 'span.si.si-cart'
CypressError: Cypress detected a cross origin error happened on page load:
> Blocked a frame with origin "http://www.smartbox.com" from accessing a cross-origin frame.
Before the page load, you were bound to the origin policy:
> http://smartbox.com
A cross origin error happens when your application navigates to a new superdomain which does not match the origin policy above.
This typically happens in one of three ways:
1. You clicked an <a> that routed you outside of your application
2. You submitted a form and your server redirected you outside of your application
3. You used a javascript redirect to a page outside of your application
Cypress does not allow you to change superdomains within a single test.
You may need to restructure some of your test code to avoid this problem.
Alternatively you can also disable Chrome Web Security which will turn off this restriction by setting { chromeWebSecurity: false } in your 'cypress.json' file.
@jennifer-shehane Please try running this code few times- https://github.com/arun290636/cypress-issue.git . Cypress has stopped intermittently with below error :
Environment:
OS- Windows 7
NPM version 5.6
Cypress version 3.1.0
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
As i said earlier this issue is a blocker for me .
K, I was able to reproduce. It does take running it a few times. This is a definite bug. Thanks for giving us a reproducible example.
Just need to set up tests like described above and the error will hit when refreshing in cypress open
cypress:server:timers clearing timer id 1757 from queue { '4': { args: [], ms: 2500, cb: [Function: cb] }, '1523': { args: [], ms: 85000, cb: [Function] }, '1755': { args: [], ms: 85000, cb: [Function] }, '1756': { args: [], ms: 30000, cb: [Function] }, '1757': { args: [], ms: 3000, cb: [Function: timeoutTimeout] } } +1ms
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }
Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
cypress:server:browsers killing browser process +2ms
GET /fr/skin/frontend/smartbox_rwd_v1/default/img/payment-reassurance/credit-mutuel.png - - ms - -
GET /fr/js/salesforce/liveagent.js - - ms - -
$
@brian-mann @jennifer-shehane Please let me know once this is fixed, As i said earlier this is blocker for us.
Thanks
@arun290636 We are a small team and have many considerations on what issues we work on and when, and will get to this issue as soon as we can. We can prioritize bug fixes, do screensharing, and code reviews under our premium support. If you鈥檙e interested in this kind of premium support, please let us know by emailing support@cypress.io.
@jennifer-shehane Thanks for you quick response. I really liked Cypress as a tool but will stop using for now. Will wait for you guys to fix this issue. I do understand that you are a small team. Take your time, please let me know once this issue is fixed.
Just wanted to add we're hitting this now as well. Looking like a chunked encoding issue for us where some packets are delayed in arriving as its happening very inconsistently for us.
Server 2012
Node 8.11.2 and 10.4.1
Cypress 3.0.1
I should have been more specific about what I did to replicate this bug. Steps to reproduce:
cypress open it('add card details', function () {
cy.visit('http://www.smartbox.com/fr/nos-smartbox/sejour/v794-sejour-gourmand-en-savoie.html')
cy.get('.gdpr-modal-button-continue').click()
cy.get('span.add-to-cart__content').first().click()
cy.get('a.button.primary.no-margin-bottom').click()
})
I have discovered the root underlying cause of this and am working on a fix.
@brian-mann when are you planning to release 3.0.2 ?
Released in 3.0.2.
Most helpful comment
I have discovered the root underlying cause of this and am working on a fix.