fix: refs #8717 streamline field filling logic in tests
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
6766a6136a
commit
9a2c7c8012
|
@ -53,17 +53,20 @@ describe('Route extended list', () => {
|
|||
function fillField(selector, type, value) {
|
||||
switch (type) {
|
||||
case 'select':
|
||||
cy.get(selector).should('be.visible').click();
|
||||
cy.dataCy('null_select').clear().type(value);
|
||||
cy.get(selector).should('be.visible').click().clear().type(value);
|
||||
cy.get('.q-item').contains(value).click();
|
||||
break;
|
||||
case 'input':
|
||||
cy.get(selector).should('be.visible').click();
|
||||
cy.dataCy('null_input').clear().type(`${value}`);
|
||||
cy.get(selector)
|
||||
.should('be.visible')
|
||||
.click()
|
||||
.type(`{selectall}{backspace}${value}`);
|
||||
break;
|
||||
case 'date':
|
||||
cy.get(selector).should('be.visible').click();
|
||||
cy.dataCy('null_inputDate').clear().type(`${value}`);
|
||||
cy.get(selector)
|
||||
.should('be.visible')
|
||||
.click()
|
||||
.type(`{selectall}{backspace}${value}`);
|
||||
break;
|
||||
case 'checkbox':
|
||||
cy.get(selector).should('be.visible').click().click();
|
||||
|
@ -177,7 +180,7 @@ describe('Route extended list', () => {
|
|||
const [month, day, year] = value.split('/');
|
||||
value = `${day}/${month}/${year}`;
|
||||
}
|
||||
cy.validateContent(selector, value);
|
||||
cy.get(selector).should('contain', value);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue