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
VSB-TUO/fix(cypress): stabilize login flow and hide Klaro consent banner in e… (#1296)
* fix(cypress): stabilize login flow and hide Klaro consent banner in e2e tests'
* fix(cypress): use programmatic REST login to bypass hanging UI form on CI
CI evidence (run 26398927955) shows every login-protected spec failing with:
'cy.wait() timed out waiting 30000ms for the 1st response to the route:
loginRequest. No response ever occurred.'
The browser-side POST /api/authn/login dispatched from the Angular login
form does not receive a response within Cypress' default 30s wait on the
ubuntu-latest runner, while anonymous specs (23/55) pass. Switching to
cy.request() drives the login from the Cypress (Node) side directly against
the backend, bypassing CORS/XSRF/SSR timing problems, and writes the
resulting auth token into the same UI cookie Angular reads on bootstrap.
A subsequent cy.reload() rehydrates Angular as an authenticated user and
preserves the original returnUrl for specs that visit a restricted page
first (e.g. /mydspace, /submit).
Also addresses Copilot review feedback on the prior attempt: removes the
hard cy.wait(500) and encodes the klaro-anonymous cookie via
JSON.stringify + encodeURIComponent.
* Empty commit
* fix(cypress): revert loginViaForm to form-based login
With the backend auth-chain fix (PasswordAuthentication first) the admin
login no longer hangs, so the programmatic cy.request() login introduced
earlier is unnecessary. That programmatic login also left specs which
start on /login stranded there (the injected auth cookie did not trigger
the app's away-from-login redirect), failing ~17 login-gated specs with
"expected '/login' not to match". Reverting to the proven form-based
login fixes those.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(cypress): stabilize submission & admin-workflow specs on slow CI
These VSB/CLARIN pages render slower than Cypress' 4s default, which
caused the last two failures after the login fix:
- submission: the CLARIN submission form loads several controlled
vocabularies before the metadata fields appear, so input#dc_title was
not yet in the DOM. Wait for ds-submission-edit and give dc_title a
generous timeout. After a failed deposit the metadata accordion section
can collapse (ngb-accordion drops its body), so re-expand it before
asserting the title field is invalid.
- admin-workflow: the supervision-configured search can take a while to
return on a freshly started backend; allow extra time for the first
list-object to render.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(cypress): match VSB dc.title <textarea> in submission spec
The submission spec failed on `input#dc_title` even with a generous
timeout because it was never a timing problem: VSB configures dc.title
with input type "textarea" (upstream uses "onebox"), so the field renders
as <textarea id="dc_title">, which `input#dc_title` never matches. Use the
tag-agnostic id selector `#dc_title` instead. (admin-workflow, which was a
genuine slow-render case, is already green from the previous timeout bump.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(cypress): skip inapplicable CLARIN resource-license steps in submission deposit test
After fixing the title selector, the deposit test reached the CLARIN
resource-license *selector* (ds-submission-section-clarin-license). That
section is not part of the "Sample Collection" traditional submission form
(which only includes the distribution-license section, already toggled), so
those steps could never pass here. Comment them out, consistent with the
other inapplicable CLARIN steps already disabled in this file. The test
still covers title/date, distribution-license acceptance and file upload.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments