ECONNREFUSED Error while trying to make e2e tests

I have written my tests and are good to go… but running e2e tests with playwright birngs an Econnrefused error from the global-setup file. the log is in this pastebin here. @dennis and any other person help me out with this. It seems playwright starts but openmrs does not even when I start the server.

The ECONNREFUSED error during e2e tests usually indicates the server isn’t running or is unreachable. Ensure your test environment is properly configured.

how do I setup the test environment. I think @brucebanner you should guide me through that. I have tried all that I can

End-to-end testing with Playwright – O3 Docs has instructions on how to run e2e tests after starting up the relevant package that you want to test. Typically, you’d start up the app in one terminal, and run the e2e tests in another.

Thank you @nethmi the document helped me out verry well…, Initially I started server with the “esm-patient-search-app”. Unfortunately when I get to this http://localhost:8080/openmrs/spa/patient-search the page opens but it is blank and it is on this page that part of my tests I am making are and this is making my e2e tests to fail. Do I need to add another app while starting the server? or else how do I interact with the patient search.

1 Like

@wedson, it might be a setup issue. Are your changes on GitHub?

In the terminal where you started the patient-search app is there any output?

@ibacher These are the logs of patient-search-outputs, they seem to be fine. thought.

Indeed that does look correct. Could you try moving the esm-patient-management repo to a folder path that doesn’t have spaces and see if that fixes things? If that does, there’s probably something we need to fix.

@ibacher I have done as you have said but still the same problem. meaning we have to fix something

Oh… The page you want is called /search not /patient-search.

Thanks @ibacher , It worked out