fix: refs #8717 streamline field filling logic in tests
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jose Antonio Tubau 2025-03-25 14:02:13 +01:00
parent 6766a6136a
commit 9a2c7c8012
1 changed files with 10 additions and 7 deletions

View File

@ -53,17 +53,20 @@ describe('Route extended list', () => {
function fillField(selector, type, value) { function fillField(selector, type, value) {
switch (type) { switch (type) {
case 'select': case 'select':
cy.get(selector).should('be.visible').click(); cy.get(selector).should('be.visible').click().clear().type(value);
cy.dataCy('null_select').clear().type(value);
cy.get('.q-item').contains(value).click(); cy.get('.q-item').contains(value).click();
break; break;
case 'input': case 'input':
cy.get(selector).should('be.visible').click(); cy.get(selector)
cy.dataCy('null_input').clear().type(`${value}`); .should('be.visible')
.click()
.type(`{selectall}{backspace}${value}`);
break; break;
case 'date': case 'date':
cy.get(selector).should('be.visible').click(); cy.get(selector)
cy.dataCy('null_inputDate').clear().type(`${value}`); .should('be.visible')
.click()
.type(`{selectall}{backspace}${value}`);
break; break;
case 'checkbox': case 'checkbox':
cy.get(selector).should('be.visible').click().click(); cy.get(selector).should('be.visible').click().click();
@ -177,7 +180,7 @@ describe('Route extended list', () => {
const [month, day, year] = value.split('/'); const [month, day, year] = value.split('/');
value = `${day}/${month}/${year}`; value = `${day}/${month}/${year}`;
} }
cy.validateContent(selector, value); cy.get(selector).should('contain', value);
}); });
}); });