CypressError: `cy.request()` failed on:
http://localhost:5004/api/1/add-forge/request/create/
The response we received from your web server was:
> 400: Bad Request
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:5004/api/1/add-forge/request/create/
Headers: {
"Connection": "keep-alive",
"X-CSRFToken": "tDVM65tmHexQdr6h0Y1NfHnmEHicCnx17N9gl8YR0rh1KbSocj9YVnyorAgLj5Fa",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/9.6.1 Chrome/94.0.4606.81 Electron/15.5.1 Safari/537.36",
"accept": "*/*",
"cookie": "sessionid=g14rmifbj6kp2g158tdeyy8flib3qi5t; csrftoken=tDVM65tmHexQdr6h0Y1NfHnmEHicCnx17N9gl8YR0rh1KbSocj9YVnyorAgLj5Fa",
"accept-encoding": "gzip, deflate",
"content-type": "application/json",
"content-length": 206
}
Body: {"forge_type":"bitbucket","forge_url":"test.example.com","forge_contact_email":"test%40example.com","forge_contact_name":"test user","submitter_forward_username":true,"forge_contact_comment":"test comment"}
-----------------------------------------------------------
The response we got was:
Status: 400 - Bad Request
Headers: {
"date": "Thu, 19 May 2022 09:16:31 GMT",
"server": "WSGIServer/0.2 CPython/3.7.3",
"content-type": "application/json",
"vary": "Accept, Origin, Cookie, Accept-Encoding",
"allow": "POST, OPTIONS",
"x-frame-options": "SAMEORIGIN",
"content-length": "501",
"content-encoding": "gzip"
}
Body: {
"exception": "BadInputExc",
"reason": "{\"forge_contact_email\": [\"Enter a valid email address.\"]}",
"traceback": "Traceback (most recent call last):\n File \"/home/jenkins/.local/lib/python3.7/site-packages/rest_framework/views.py\", line 506, in dispatch\n response = handler(request, *args, **kwargs)\n File \"/home/jenkins/.local/lib/python3.7/site-packages/rest_framework/decorators.py\", line 50, in handler\n return func(*args, **kwargs)\n File \"/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/swh/web/api/apiurls.py\", line 96, in api_view_f\n response = f(request, **kwargs)\n File \"/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/swh/web/api/apidoc.py\", line 380, in documented_view\n raise exc\n File \"/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/swh/web/api/apidoc.py\", line 377, in documented_view\n return {\"data\": f(request, **kwargs), \"doc_data\": doc_data}\n File \"/usr/lib/python3.7/contextlib.py\", line 74, in inner\n return func(*args, **kwds)\n File \"/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/swh/web/api/views/add_forge_now.py\", line 182, in api_add_forge_request_create\n raise BadInputExc(json.dumps(form.errors))\nswh.web.common.exc.BadInputExc: {\"forge_contact_email\": [\"Enter a valid email address.\"]}\n"
}
https://on.cypress.io/request
Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `Test add forge now request ...`
at http://localhost:5004/__cypress/runner/cypress_runner.js:165424:80
at tryCatcher (http://localhost:5004/__cypress/runner/cypress_runner.js:13022:23)
at Promise._settlePromiseFromHandler (http://localhost:5004/__cypress/runner/cypress_runner.js:10957:31)
at Promise._settlePromise (http://localhost:5004/__cypress/runner/cypress_runner.js:11014:18)
at Promise._settlePromise0 (http://localhost:5004/__cypress/runner/cypress_runner.js:11059:10)
at Promise._settlePromises (http://localhost:5004/__cypress/runner/cypress_runner.js:11139:18)
at _drainQueueStep (http://localhost:5004/__cypress/runner/cypress_runner.js:7729:12)
at _drainQueue (http://localhost:5004/__cypress/runner/cypress_runner.js:7722:9)
at Async.../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:5004/__cypress/runner/cypress_runner.js:7738:5)
at Async.drainQueues (http://localhost:5004/__cypress/runner/cypress_runner.js:7608:14)
From Your Spec Code:
at Context.eval (http://localhost:5004/__cypress/tests?p=cypress/integration/add-forge-now-request-dashboard.spec.js:121:8)
TEST RESULT
TEST RESULT
- Run At
- May 19 2022, 11:33 AM