awesome-web-testing-playwright icon indicating copy to clipboard operation
awesome-web-testing-playwright copied to clipboard

Unable to make API request calls against localhost : @ Error: apiRequestContext.post: connect ECONNREFUSED ::1

Open kiarrasayshi opened this issue 1 year ago • 1 comments

Following all setup instructions and steps in the tutorial leads me to an issue with making the post request against the local API. The rest of the test runs fine using local host and I am able to make this request from Postman. This is my first attempt at testing API calls using Playwright against a local environment. I am able to make API request calls using playwright against live APIs in test and production environments. I don't think this is an issue with your tutorial per se as I've seen other people having this issue and requesting help online without finding good fixes, but if this is a common issue, it may be helpful to mention a fix (if you know of one!) in the tutorial steps.

Note I get this error whether I run the tests in the terminal or through the playwright ui, but, again, not when using Postman to make the request.

As I'm still able to make the API request in postman, I've just commented out this line of code so I can continue with the tutorial, which I am finding incredibly helpful! Just wanted to document this issue in case anyone else runs into it while working through the tutorial. playwright tutorial error

kiarrasayshi avatar Jan 13 '25 20:01 kiarrasayshi

Thanks for letting me know. That's strange. I'll keep an eye open for it.

AutomationPanda avatar Jan 14 '25 13:01 AutomationPanda