-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 run times out waiting for the browser to connect #3310
Comments
Is there any way to clear the App Data or maybe uninstall / reinstall Cypress altogether? |
We did. We uninstalled and reinstalled and then uninstalled again and installed previous version. |
Are these tests able to run when opened in Electron locally? Could you provide the test code - for spec 1 + spec 2? Likely something changed a few weeks ago that is causing this. |
If I run them locally, they open both in Electron and in Chrome. import { documentManagementModule } from "../../id-collection"
const setDate = (datePicker, date) => {
datePicker.wait(3000)
let dels = '{selectall}{del}';
datePicker.type('${dels}${date}')
cy.wait(4000)
}
describe('Document Management - Search Document', function () {
after(function() {
cy.reload(true)
cy.url()
.should('contain',Cypress.env('url_base_comparar'))
cy.get(documentManagementModule.common.user_badge_topmenu)
.click()
cy.get(documentManagementModule.common.user_badge_popup)
.should('exist')
cy.get(documentManagementModule.common.user_badge_logout)
.click()
.wait(2000)
})
it('TC1163 - check functionality of Document List button', function () {
cy.reload(true)
cy.get(documentManagementModule.DMcommon.menu_item_UploadDocument)
.should('be.visible')
cy.get(documentManagementModule.DMcommon.menu_item_UploadDocument)
.click()
cy.get(documentManagementModule.searchDocument.patientSearch)
.should('be.visible')
cy.url()
.should('contain', 'new')
cy.get(documentManagementModule.DMcommon.menu_item_ListDocuments)
.should('be.visible')
cy.get(documentManagementModule.DMcommon.menu_item_ListDocuments)
.click()
cy.url()
.should('contain','search')
})
it('TC1205 - check there are no documents when page loads and the filter window is open', function () {
cy.visit('app/search')
cy.get('body')
.type('{esc}',{force:true})
cy.get(documentManagementModule.searchDocument.noResults)
.should('exist')
})
it('TC1207 - check functionality of select all', function () {
cy.visit('app/search')
cy.get('body')
.type('{esc}',{force:true})
cy.get(documentManagementModule.searchDocument.noResults)
.should('exist')
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.wait(4000)
.type('cardio{enter}',{ force: true })
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','CARDIOLOGÍA')
cy.get(documentManagementModule.searchDocument.selectCounter)
.should('contain','0')
cy.get(documentManagementModule.searchDocument.selectAll)
.click({force:true})
cy.get(documentManagementModule.searchDocument.selectCounter)
.should('contain','52')
})
it('TC1206 - chech functionality of filter button', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.should('exist')
cy.get(documentManagementModule.searchDocument.btnFilters)
.click()
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.should('not.exist')
cy.get(documentManagementModule.searchDocument.btnFilters)
.click()
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.should('exist')
})
it('TC1184 - search by patient', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.type(Cypress.env('patient'),{ force: true })
cy.get(documentManagementModule.searchDocument.patient_search_result)
.should('contain',Cypress.env('patient'))
.click()
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain',Cypress.env('patient'))
})
it('TC1185 - search by issuer', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.issuers_Input)
.wait(4000)
.type('adeslas{enter}{esc}')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('not.contain','Sin resul')
})
it('TC1203 - search by document date', function () {
cy.visit('app/search')
setDate(cy.get(documentManagementModule.searchDocument.documentDateStart), '01/01/2018')
cy.get(documentManagementModule.searchDocument.helper_documentDateEnd)
.should('contain','rellenar también')
setDate(cy.get(documentManagementModule.searchDocument.documentDateEnd), '01/01/2017')
cy.get(documentManagementModule.searchDocument.helper_documentDateEnd)
.should('contain','debe ser mayor')
setDate(cy.get(documentManagementModule.searchDocument.documentDateEnd), '07/11/2018')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','07/11/2018')
})
it('TC1204 - search by publish date', function () {
cy.visit('app/search')
setDate(cy.get(documentManagementModule.searchDocument.publishedDateStart), '01/01/2018')
cy.get(documentManagementModule.searchDocument.helper_publishedDateEnd)
.should('contain','rellenar también')
setDate(cy.get(documentManagementModule.searchDocument.publishedDateEnd), '01/01/2017')
cy.get(documentManagementModule.searchDocument.helper_publishedDateEnd)
.should('contain','debe ser mayor')
setDate(cy.get(documentManagementModule.searchDocument.publishedDateEnd), '07/11/2018')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','07/11/2018')
})
it('TC1186 - search by medical services', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.wait(4000)
.debug()
.type('admi{enter}alerg{enter}qui{enter}{esc}')
cy.get(documentManagementModule.searchDocument.medicalServices_Values)
.should('contain','3 seleccionados')
cy.get(documentManagementModule.searchDocument.documentName)
.click()
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.type('qui{enter}alerg{enter}{esc}')
cy.get(documentManagementModule.searchDocument.medicalServices_Values)
.should('contain','ADMISIONP')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','ADMISIÓN')
})
it('TC1187 - search by document name', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.documentName)
.type('UDA',{ force: true })
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.helper_documentName)
.should('contain','al menos 4')
cy.get(documentManagementModule.searchDocument.documentName)
.clear()
cy.get(documentManagementModule.searchDocument.documentName)
.type('BUDA',{ force: true })
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('not.contain','Sin resultados')
})
it('TC1217 - search by category', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.categories_Input)
.wait(4000)
.type('tipos{enter}acre{enter}ident{enter}local{enter}{esc}')
cy.get(documentManagementModule.searchDocument.categories_Values)
.should('contain','4 seleccionados')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('empa{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Values)
.should('contain','EMPADRONAMIENTO')
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('local{enter}{esc}')
cy.get(documentManagementModule.searchDocument.categories_Values)
.should('contain','3 seleccionados')
cy.get(documentManagementModule.searchDocument.documentTypes_clear_button)
.click()
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('dni{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Values)
.should('contain','DNI')
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('ident{enter}{esc}')
cy.get(documentManagementModule.searchDocument.categories_Values)
.should('contain','2 seleccionados')
cy.get(documentManagementModule.searchDocument.documentTypes_clear_button)
.click()
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('derecho{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Values)
.should('contain','DOCUMENTO DE DERECHO')
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('acre{enter}{esc}')
cy.get(documentManagementModule.searchDocument.categories_Values)
.should('contain','TIPOS FLORENCE')
cy.get(documentManagementModule.searchDocument.documentTypes_clear_button)
.click()
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('alta{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Values)
.should('contain','ALTA VOLUNTARIA')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','ALTA VOLUNTARIA')
})
it('TC1218 - search by document type', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.wait(4000)
.type('alta{enter}derecho{enter}dni{enter}empa{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Values)
.should('contain','4 seleccionados')
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('tipos{enter}acre{enter}local{enter}iden{enter}{esc}')
cy.get(documentManagementModule.searchDocument.categories_Values)
.should('contain','4 seleccionados')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('not.contain','Sin resulta')
})
it('TC1221 - search by clinical act type', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Input)
.wait(4000)
.type('inter{enter}imagen{enter}{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Values)
.should('contain','2 seleccionados')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','TORAX')
})
it('TC1222 - search by clinical act', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.clinicalActs_Input)
.wait(4000)
.type('13000023 - Densi{enter}{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Input)
.wait(4000)
.type('inter{enter}imagen{enter}{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActs_Values)
.should('not.exist')
cy.get(documentManagementModule.searchDocument.clinicalActs_Input)
.type('13000023 - Densi{enter}{esc}')
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.type(Cypress.env('patient'),{ force: true })
cy.get(documentManagementModule.searchDocument.patient_search_result)
.should('contain',Cypress.env('patient'))
.click()
cy.get(documentManagementModule.searchDocument.clinicalActs_Input)
.type('13000023 - Densi{enter}{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActs_Values)
.should('contain','DENSITOMETRIA')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','DENSITOMETRIA')
})
it('TC1223 - search by clinical act code', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.clinicalActCode)
.type('13000023',{ force: true })
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.results_list)
.should('contain','13000023')
})
it('TC1224 - check functionality of CLEAN button', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.type(Cypress.env('patient'),{ force: true })//1043319
cy.get(documentManagementModule.searchDocument.patient_search_result)
.should('contain',Cypress.env('patient'))
.click()
cy.get(documentManagementModule.searchDocument.documentName)
.type('Test name',{ force: true })
.wait(4000)
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.type('admisi{enter}{esc}')
cy.get(documentManagementModule.searchDocument.issuers_Input)
.type('adeslas{enter}{esc}')
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.categories_Input)
.type('florence{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('alta{enter}{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Input)
.type('imagen{enter}{esc}')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Input)
.type('{esc}')
cy.get(documentManagementModule.searchDocument.clinicalActs_Input)
.type('densitometria{enter}{esc}',{forced:true})
cy.get(documentManagementModule.searchDocument.clinicalActCode)
.type('13000023',{ force: true })
setDate(cy.get(documentManagementModule.searchDocument.documentDateStart), '01/04/2018')
setDate(cy.get(documentManagementModule.searchDocument.documentDateEnd), '30/04/2018')
setDate(cy.get(documentManagementModule.searchDocument.publishedDateStart), '01/04/2018')
setDate(cy.get(documentManagementModule.searchDocument.publishedDateEnd), '30/04/2018')
cy.get(documentManagementModule.searchDocument.cleanButton)
.click()
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.documentName)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.medicalServices_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.issuers_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.categories_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.documentTypes_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.clinicalActTypes_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.clinicalActs_Input)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.clinicalActCode)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.documentDateStart)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.documentDateEnd)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.publishedDateStart)
.should('be.empty')
cy.get(documentManagementModule.searchDocument.publishedDateEnd)
.should('be.empty')
cy.get('body')
.type('{esc}',{force:true})
})
it('TC1219 - click on a document and check its opened and data is correct', function () {
cy.visit('app/search')
cy.get(documentManagementModule.searchDocument.patientSearchComponent)
.type(Cypress.env('patient'),{ force: true })
cy.get(documentManagementModule.searchDocument.patient_search_result)
.should('contain',Cypress.env('patient'))
.click()
cy.get(documentManagementModule.searchDocument.documentName)
.type('ENALG')
cy.get(documentManagementModule.searchDocument.searchButton)
.click()
cy.get(documentManagementModule.searchDocument.btnView_result)
.click()
cy.url()
.should('contain','/view/')
cy.get(documentManagementModule.searchDocument.patientSearch)
.should('contain','FELICISIMO ANGEL')
cy.get(documentManagementModule.searchDocument.categoryInput)
.should('contain','TIPOS FLORENCE')
cy.get(documentManagementModule.searchDocument.serviceInput)
.should('contain','ALERGOLOGÍA')
cy.get(documentManagementModule.searchDocument.documentTypeInput)
.should('contain','INFORME ENDOSCOPIA')
})
}) The weird thing is that it doesn't seem to be related to the spec as I tried changing them (order and so) and it didn't change a thing. Apart from that, the only thing we do is log in: it('TC1317 - Check that login works', function () {
cy.visit('')
cy.get('#btnLoginOauth')
.click()
cy.get("#dniField")
.type(Cypress.env('user'),{force:true})
cy.get("#passwordField")
.type(Cypress.env('pwd'),{force:true})
cy.get("#btnLogin")
.click()
cy.wait(5000)
}) |
Perhaps try to collect some more logging information during |
You may also want to be aware of this issue - where the |
Yeah, I've been dealing with this too, but it's not related to my problem as the first spec, which in my case just tries to log in, log out and make an incorrect login, works perfectly and it closes the browser. I'm checking 2831 anyway, thanks! Will try to DEBUG and get extra information. Just a set DEBUG=cypress:* would work or is it better to go for set DEBUG=cypress:launcher? |
Hello, I have tried using DEBUG=cypress:*, however, didn't get any additional information, as the logs do not include the debugging information in the console, and if I execute everything manually, it works perfectly. Any other idea or workaround? Is there a way to log in a file everything printed by DEBUG=cypress:*? |
I think you're going to have to try to narrow down the test code base to find the core issue. So, cut out half of test code, does it still fail. Try half of that code, etc until you get it to the smallest amount of code to run to reproduce. @bahmutov - you have any leads or suggestions? I know you worked with VSTS some. |
@jennifer-shehane I face the same issue (intermittently). With cypress version 3.1.5. For earlier versions it use to work just fine. Running my test suite locally using npx cypress run (Electron 59) sometimes works and sometimes it doesn't and fails before running the first test. |
I found the cause of that issue. It seems like while starting, cypress threw an error which didn't allow the headless browser to fetch the URL (baseUrl in cypress.json) because the base URL had auth credentials and there were a couple of other URL's mentioned under env (which were cross domain) which my tests needed to access. This was the primary issue. Removed baseUrl altogether and I created a variable under 'env' (for all the URL's) and then it worked fine. Looks like there is CORS related bug, where cypress cannot connect to electron while reading the baseUrl value from cypress.json which further has multiple urls (cross-domain) mentioned elsewhere in the same file. |
I have the very same issue. Cypress version 3.1.0. There is no auth credential in the baseUrl. Cypress fails from time to time, about one of 10 times is failed. |
Thanks @jennifer-shehane for trying to support, but I am having the same issue and all the suggestions implies try-error attempt. Here is the log I have:
and it looks like a failure of cypress to orchestrate parallel request or even allocate diff servers/machines to it. |
Were experiencing this right now. Is there any fix for this? |
There is a workout around to fix this problem. You can overwrite their values reseting the env variable
It means the Cypress will retry every 5 seconds 3 times, then 10 seconds and so on. The number of retries are exactly the length of your value list. |
Looks like headless electron works without that issue. @cbernardes Could you explain that magic ? |
Hey @Pavel-Husakouski it is not magic. It is just the way they have built, I hope intentionally, their middleware. In my case it was hanging-out on the first try only, but it was enough to delay my CI/CD. After digging through their code I found this solution :D. #openSource <3. |
Actually, all our tests are failed because of this issue. Cypress tries to connect per every test and fails - about twenty times "The browser never connected. Something is wrong. The tests cannot run. Aborting..." |
@Pavel-Husakouski this is only necessary when you run your tests in parallel. This request is exactly to know which suite to pull from the queue. Said so, I would strongly encourage you to run your CI/CD with electron. |
I was experiencing this error while using angular cli for the server and the electron browser. I think the problem was that the live-reload server was trying to reload the application during the process of the cypress testing. When I serverd the code with these flags: ng serve --liveReload=false --watch=false, then it worked perfectly. Hopefully this helps some. |
That's interesting. However, we don't use any live reload under Cypress. Moreover, we face the issue under the production environment. Anyway, electron works much better. |
I too got the same error on cypress 4.1.0, auto execution, I run CI/CD with electron, but 10% can got this error. |
We are also facing same issue , the fist spec execution is passed and remaining spec file execution status results in failure due to time out issue.continuous failure in headless and test runner too.unable to invoke the electron browser from second spec execution.Tried out with all specified options ,it's invain. Issue can be reproducible with cypress 3.4.1 ,3.8.3 as well as v4.0.0 on electron . |
Same issue here. Everything works like a charm on MacOS, but on our system server with Debian Stretch, google-chrome-stable 79, node 12.16.1 and npm 6.14.4 it does not work. It is 100% cypress error, because I tried the following versions:
|
Any progress on that? I have the same issue with Cypress 8.3.0 on Jenkins. |
Same here! |
I was having this issue about 50% of the time running on a mac (but not at all on Linux) using Cypress 10.3 and Electron browser. Disabling the GPU has fixed it for me.
|
Github Actions I am running github actions, and In my case I changed some files from |
We were facing same issue with cypress 12.5.0 and Electron 106. The issue for us was coming from XDG_CONFIG_HOME env variable. It was not getting set and it seems this gets used by electron. We tried to set it manually |
My anti-virus was causing this issue for me. Once I disabled it, the issue stopped. |
Thanks for the feedback and ideas for how you were able to solve this type of issue. If anyone comes across this issue again. Please file a new issue and include a reproduction. Thanks! |
I've faced this same issue and after a long research I've identified that my problem is related to webpack build, so I've tried to build( |
I see the above issue again.. with cypress 12.17.1 Timed out waiting for the browser to connect. Retrying... Timed out waiting for the browser to connect. Retrying again... The browser never connected. Something is wrong. The tests cannot run. Aborting... The browser never connected. Something is wrong. The tests cannot run. Aborting On running with DEBUG option, I get to see the following
|
@sangeeta-chakalabbi please open a new issue with a reproducible example and the Cypress team will be happy to investigate. |
I have the same issue since we moved from yarn to pnpm. @sangeeta-chakalabbi Are you using pnpm by any chance? |
The problem is still present:
However the issue occur only with "Electron 114+" (headless) With the other browsers like Chrome, seems working. Can you please fix this issue ? |
We are also experienced that.
Very weird... I tried debugging and changing from localhost to 127.0.0.1 / 0.0.0.0 on cypress and dev server side but with no luck. |
Please open new issues, filling out the issue template, describing your issues. |
Current behavior:
I have an automated release for my test suite. It consists of 8 specs that are executed one after the other.
A few weeks back, one of the specs got stuck and I had to force a shutdown of the release. After that, on every release, after the first spec is run, Cypress fails to open the browser or find it or something and the tests fail.
This is the error I'm getting:
I have deleted the Virtual Machine I use for the test and created it again, changed versions of Chrome, changed versions of Cypress and nothing changes.
If I enter the VM with the release user, and use the command manually on a command line, it works, but in the automated release doesn't.
I'm currently out of ideas.
Desired behavior:
Every spec should run correctly as it did before
Versions
Cypress 3.1.4 and 3.1.5
Chrome 72.0.3626
VSTS for release automation
The text was updated successfully, but these errors were encountered: