-
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 failed to verify that your server(http://localhost: 8080) is running error for Cypress Component testing in Jenkins CI pipeline (Uses Linux) #27967
Comments
Any update to this? We are facing exact problem when we try to run the component tests on our Jenkins CI |
This looks like the same issue as #28338 The workaround documented there worked in my case. |
Duplicate of #28338 |
I tried to downgrade cypress dependency to 13.1.0 and the issue still exists and hasn't resolved yet based on @jimmux suggestion based on 28338. This issue doesn't look like the exact same issue as referenced above. Can you please reopen this ticket again please @jennifer-shehane? Thanks |
@mdlkumaran There hasn't been independent verification that that is the version this issue was introduced in, but the majority of people say it's resolved in v12 latest version. |
@jennifer-shehane : I did try downgrading to v12.7 for cypress and I see this is resolved as you mentioned. But looks like v12.7 has 2 critical vulnerability reported which makes me not to use that version in our current organization. Could you help with any other suggestions? Thanks |
@jennifer-shehane : This is possibly related to #27990 |
Current behavior
Hi Cypress team and good day!
I am new to Cypress component testing and was able to follow the official steps and able to successfully run the component tests locally using React and webpack.
However, running the same code in the Jenkins CI pipeline, I am facing this error as below:
18:19:52 DevTools listening on ws://127.0.0.1:39521/devtools/browser/eaff2479-7355-421-ae4f -71b25c94c30b
18:19:53 Missing baser in compilerOptions. tsconfig-paths will be skipped
18:19:56 [webpack-dev-server] Project is running at:
18:19:56 [webpack-dev-server] Loopback: http://127.0.0.1:8080/
18:19:56 [webpack-dev-server] Content not from webpack is served from " /home/jenkins/agent/workspace/DOM-Github_feature_ECSCAEA-1652/public' directory
18:19:57 Cypress could not verify that this server is running:
18:19:57
18:19:57
> http://localhost: 8080
18:19:57
18:19:57 We are verifying this server because it has been configured as your baseUrl.
18:19:57
18:19:57 Cypress automatically waits until your server is accessible before running tests
18:19:57
18:19:57 We will try connecting to it 3 more times.
18:20:00 We will try connecting to it 2 more times
18:20:03 We will try connecting to it 1 more time...
18:20:03
18:20:07 Cypress failed to verify that your server is running.
18:20:07
18:20:07 Please start this server and then run Cypress again.
I searched all through the internet and did not find anything that helps me specifically for component testing and all the solutions are around e2e testing like using wait-on or start-server-and-test and I don't think it is applicable to the cypress component testing as I do not see we have control on making the dev server wait in the cypress.config.js.
I also found this link similar to the error message and also a fix for it but for e2e and fixed 2 years back
#8870 - Issue
PostHog/posthog#14539 - Fix
Could someone let me know if there is already a fix/steps to handle this in the pipeline or a bug that needs to be addressed?
It would be great if I could get some help if anyone else faced this issue and found a workaround for this in the pipeline for Cypress component testing. Knowing the awesomeness of Cypress e2e testing for our project, we started this effort to migrate from React testing library unit tests to Cypress component testing. We are stuck here at this point and do not want to stick with the React testing library unit tests again. Thanks for your help in advance.
Desired behavior
Cypress should wait/have config to increase the timeout for the wepack-dev-server (Local server in pipeline) to launch the localhost successfully and then try to run the cypress component testing.
Test code to reproduce
I have posted the necessary screenshots for reproducing this issue.
Cypress Version
13.3.0
Node version
v18.17.0
Operating System
Ubuntu20
Debug Logs
Other
NA
The text was updated successfully, but these errors were encountered: