Cannot specify port on intercept
Current behavior
Hi there, I'm having an issue where if I specify the port on cy.intercept it won’t match the request.
This is what my code looks like:
cy.intercept(
{
method: 'POST',
pathname: '/api/my-work-list',
hostname: 'localhost',
port: 8100,
}, {
body: 'Created successfully',
}
).as('POST-createWorklist')
When I don’t specify the port it works correctly:
cy.intercept(
{
method: 'POST',
pathname: '/api/my-work-list',
hostname: 'localhost',
}, {
body: 'Created successfully',
}
).as('POST-createWorklist')
The expected behaviour is that it will only match the calls to the port if it is specified, as described in the documentation.
I'm using Cypress version 8.2.0.
Thanks in advance.
Desired behavior
The expected behaviour is that it will only match the calls to the port if it is specified, as described in the documentation.
Test code to reproduce
cy.intercept(
{
method: 'POST',
pathname: '/api/my-work-list',
hostname: 'localhost',
port: 8100,
}, {
body: 'Created successfully',
}
).as('POST-createWorklist')
Cypress Version
8.2.0
Other
No response
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.
I'm also experiencing this. Matching on port appears to simply not work.
Having the same issue with cypress 13.8.0
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
This issue has been closed due to inactivity.