testes em API
Testes em rotas com usuário autorizado
1) "before each" hook for "GET via url front para teste em resposta da home"
Requisições de usuário clínica em especialistas
2) "before each" hook for "POSt em especialista"
0 passing (1s)
2 failing
1) testes em API
Testes em rotas com usuário autorizado
"before each" hook for "GET via url front para teste em resposta da home":
CypressError: `cy.request()` failed on:
http://localhost:8080/auth/login
The response we received from your web server was:
> 500: Internal Server Error
This was considered a failure because the status code was not `2xx` or `3xx`.
If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
-----------------------------------------------------------
The request we sent was:
Method: POST
URL: http://localhost:8080/auth/login
Headers: {
"Connection": "keep-alive",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/13.7.2 Chrome/118.0.5993.159 Electron/27.1.3 Safari/537.36",
"accept": "*/*",
"accept-encoding": "gzip, deflate",
"content-type": "application/json",
"content-length": 47
}
Body: {"email":"clinica@gmail.com","password":"4321"}
-----------------------------------------------------------
The response we got was:
Status: 500 - Internal Server Error
Headers: {
"x-powered-by": "Express",
"access-control-allow-origin": "*",
"content-type": "application/json; charset=utf-8",
"content-length": "181",
"etag": "W/\"b5-x9oIfrr3pIq2kwwlcV1K2LilZTI\"",
"date": "Mon, 06 Oct 2025 03:00:18 GMT",
"connection": "keep-alive",
"keep-alive": "timeout=5"
}
Body: {
"status": 500,
"message": "Internal server error: The \"password\" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received undefined"
}
https://on.cypress.io/request
Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `Testes em rotas com usuário...`
at <unknown> (http://localhost:3000/__cypress/runner/cypress_runner.js:133123:72)
at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:1807:23)
at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:1519:31)
at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:1701:18)
at _drainQueueStep (http://localhost:3000/__cypress/runner/cypress_runner.js:2407:12)
at _drainQueue (http://localhost:3000/__cypress/runner/cypress_runner.js:2400:9)
at Async._drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:2416:5)
at Async.drainQueues (http://localhost:3000/__cypress/runner/cypress_runner.js:2286:14)
From Your Spec Code:
at ee (webpack://web-ci/./node_modules/cypress-plugin-api/dist/support.js:14:2002)
at Context.eval (webpack://web-ci/./node_modules/cypress-plugin-api/dist/support.js:14:2181)
2) testes em API
Requisições de usuário clínica em especialistas
"before each" hook for "POSt em especialista":
CypressError: `cy.request()` failed on:
http://localhost:8080/auth/login
The response we received from your web server was:
> 500: Internal Server Error
This was considered a failure because the status code was not `2xx` or `3xx`.
If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
-----------------------------------------------------------
The request we sent was:
Method: POST
URL: http://localhost:8080/auth/login
Headers: {
"Connection": "keep-alive",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/13.7.2 Chrome/118.0.5993.159 Electron/27.1.3 Safari/537.36",
"accept": "*/*",
"accept-encoding": "gzip, deflate",
"content-type": "application/json",
"content-length": 47
}
Body: {"email":"clinica@gmail.com","password":"4321"}
-----------------------------------------------------------
The response we got was:
Status: 500 - Internal Server Error
Headers: {
"x-powered-by": "Express",
"access-control-allow-origin": "*",
"content-type": "application/json; charset=utf-8",
"content-length": "181",
"etag": "W/\"b5-x9oIfrr3pIq2kwwlcV1K2LilZTI\"",
"date": "Mon, 06 Oct 2025 03:00:19 GMT",
"connection": "keep-alive",
"keep-alive": "timeout=5"
}