Skip to content

Commit 2b6da23

Browse files
milanmajchrakclaude
andcommitted
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>
1 parent d3f1b15 commit 2b6da23

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

cypress/e2e/submission.cy.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ describe('New Submission page', () => {
5959
// This page is restricted, so we will be shown the login form. Fill it out & submit.
6060
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
6161

62-
// The CLARIN submission form is heavy (loads several controlled vocabularies),
63-
// so wait until it has fully rendered before interacting with it.
62+
// NOTE: VSB configures dc.title as a <textarea> (not the upstream <input>), so the title
63+
// field is matched by id only (#dc_title). The CLARIN form also loads several controlled
64+
// vocabularies, so wait for the form to render before interacting with it.
6465
cy.get('ds-submission-edit').should('be.visible');
65-
cy.get('input#dc_title', { timeout: 30000 }).should('exist');
66+
cy.get('#dc_title', { timeout: 30000 }).should('exist');
6667

6768
// Attempt an immediate deposit without filling out any fields
6869
cy.get('button#deposit').click();
@@ -79,13 +80,13 @@ describe('New Submission page', () => {
7980
// ngb-accordion) removes its fields from the DOM. Ensure it is expanded before asserting
8081
// on the title field.
8182
cy.get('body').then(($body) => {
82-
if ($body.find('input#dc_title').length === 0) {
83+
if ($body.find('#dc_title').length === 0) {
8384
cy.get('div#traditionalpageone-header').click();
8485
}
8586
});
8687

8788
// Title field should have class "is-invalid" applied, as it's required
88-
cy.get('input#dc_title', { timeout: 15000 }).should('have.class', 'is-invalid');
89+
cy.get('#dc_title', { timeout: 15000 }).should('have.class', 'is-invalid');
8990

9091
// Date Year field should also have "is-valid" class
9192
cy.get('input#dc_date_issued_year').should('have.class', 'is-invalid');
@@ -134,12 +135,13 @@ describe('New Submission page', () => {
134135
// This page is restricted, so we will be shown the login form. Fill it out & submit.
135136
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
136137

137-
// The CLARIN submission form is heavy (loads several controlled vocabularies),
138-
// so wait until it has fully rendered before interacting with it.
138+
// NOTE: VSB configures dc.title as a <textarea> (not the upstream <input>), so the title
139+
// field is matched by id only (#dc_title). The CLARIN form also loads several controlled
140+
// vocabularies, so wait for the form to render before interacting with it.
139141
cy.get('ds-submission-edit').should('be.visible');
140142

141143
// Fill out all required fields (Title, Date)
142-
cy.get('input#dc_title', { timeout: 30000 }).type('DSpace logo uploaded via e2e tests');
144+
cy.get('#dc_title', { timeout: 30000 }).type('DSpace logo uploaded via e2e tests');
143145
cy.get('input#dc_date_issued_year').type('2022');
144146

145147
// Confirm the required license by checking checkbox

0 commit comments

Comments
 (0)