You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing an API json response
My code looks like
describe('retrieve information for product',()=>{// assertsit('with sku',()=>{cy.request('GET',`${url}/product/list?skus=WJ12`).then((response)=>{// response.body is automatically serialised into JSONconsole.log(response)})})})
The API url is http://localhost:8080/api/product/list?skus=WJ12
Within the GUI of Cypress it works, as can be seen below
When running the same code in the CLI it fails with
test the product api
✓ loads the product api (48ms)
retrieve information for product
1) with sku
1 passing (940ms)
1 failing
1) test the product api
retrieve information for product
with sku:
CypressError: `cy.request()` failed trying to load:
http://localhost:8080/api/product/list?skus=WJ12
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: connect ECONNREFUSED 127.0.0.1:8080
I have tested this in
Cypress 4.7.0
Cypress 4.8.0
Can you see if I am doing anything wrong here?
The text was updated successfully, but these errors were encountered:
I found the issue. I'm running cypress cli in a docker, and this docker instance, does not recognise the location of the API
Running it locally works, as expected
test the product api
✓ loads the product api
retrieve information for product
✓ with sku (1663ms)
2 passing (2s)
I found the issue. I'm running cypress cli in a docker, and this docker instance, does not recognise the location of the API Running it locally works, as expected
test the product api
✓ loads the product api
retrieve information for product
✓ with sku (1663ms)
2 passing (2s)
Closing this issue
how do you fix this issue? because I have the same one when I try to test on the GitHub action
I found the issue. I'm running cypress cli in a docker, and this docker instance, does not recognise the location of the API Running it locally works, as expected
test the product api
✓ loads the product api
retrieve information for product
✓ with sku (1663ms)
2 passing (2s)
Closing this issue
how do you fix this issue? because I have the same one when I try to test on the GitHub action
I'm testing an API json response
My code looks like
The API url is
http://localhost:8080/api/product/list?skus=WJ12
Within the GUI of Cypress it works, as can be seen below
When running the same code in the CLI it fails with
I have tested this in
Cypress 4.7.0
Cypress 4.8.0
Can you see if I am doing anything wrong here?
The text was updated successfully, but these errors were encountered: