-
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 can't access different ports on same domain #6475
Comments
I'm not able to recreate this. I have 2 local servers running and there are no errors accessing them. I even added the extra config options although I think it's unnecessary. Tried Can you access the domain normally, via curl within your environment? What is the result of running Code I ran: it('visit', () => {
cy.visit('http://localhost:2222', {
failOnStatusCode: false
})
})
it('request', () => {
cy.request({
method: 'POST',
url: 'http://localhost:8080',
form: true,
followRedirect: false,
body: {
username: '',
password: ''
}
})
}) |
hi @jennifer-shehane , thanks for your reply.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='../login?returnURL=%2F'" />
<title>Redirecting to ../login?returnURL=%2F</title>
</head>
<body>
Redirecting to <a href="../login?returnURL=%2F">../login?returnURL=%2F</a>.
</body>
</html>% And this is of <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='/login?returnURL=%2F'" />
<title>Redirecting to /login?returnURL=%2F</title>
</head>
<body>
Redirecting to <a href="/login?returnURL=%2F">/login?returnURL=%2F</a>.
</body>
</html>% They might look similar but they are different.
|
Do you see anything different in the server logs when Cypress is running the tests? also try http://127.0.0.1:8888 |
@Sumedh-k the request never reaches my server :( so nothing is shown on the error server. |
@mankinchi Are you behind a corporate proxy? Do you have any proxy configuration set up? https://on.cypress.io/proxy-configuration |
@jennifer-shehane I am not using any proxy nor connecting to any proxy in my company |
Is there any update on this? |
Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen. |
Happens to me too It there any workaround? I have an angular app, and a laravel backend (localhost:4200 and localhost:8000) |
I am trying to help another use debug it here: #26154 (comment). I couldn't make a minimal reproduction, but the user there suggested a work around when they encountered this issue. I wonder if it's windows specific? |
I am using fedora 35 and am also have the same issue |
Take a look at #26154 @josephkabba. Can you provide a minimal reproduction? You could share it there. |
Thanks @lmiller1990 #26154 helped solve the issue |
Current behavior:
What I have is 2 tests (initially 1) looks like this
Application port (1):
Authentication port (2) (previously is going straight to the website and fill it in, but I switch to use
cy.request
instead):Additional code:
So if I put (1) before (2), this error shows up:
And if I put (2) before (1), this error shows up:
Desired behavior:
Accessing both ports doesn't end up with error
Test code to reproduce
Versions
Cypress: 4.0.2
Mac: 10.15.2
Additional
I found a similar issue here: https://stackoverflow.com/questions/60031340/cypress-login-command-with-cy-request-causes-subsequent-cy-visit-to-fail
The text was updated successfully, but these errors were encountered: