forked from verdnatura/salix-front
refs #5673 test(claimDevelopment): e2e
This commit is contained in:
parent
ff347db37a
commit
46bb1d86db
|
@ -13,16 +13,17 @@ describe('ClaimDevelopment', () => {
|
|||
it('should reset line', () => {
|
||||
cy.selectOption(firstLineReason, 'Novato');
|
||||
cy.resetCard();
|
||||
cy.getValue(firstLineReason).should('have.text', 'Prisas');
|
||||
cy.getValue(firstLineReason).should('have.value', 'Prisas');
|
||||
});
|
||||
|
||||
it('should edit line', () => {
|
||||
cy.selectOption(firstLineReason, 'Novato');
|
||||
cy.saveCard();
|
||||
|
||||
cy.saveCard();
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/claim/${claimId}/development`);
|
||||
cy.getValue(firstLineReason).should('have.text', 'Novato');
|
||||
|
||||
cy.getValue(firstLineReason).should('have.value', 'Novato');
|
||||
|
||||
//Restart data
|
||||
cy.selectOption(firstLineReason, 'Prisas');
|
||||
|
@ -30,16 +31,16 @@ describe('ClaimDevelopment', () => {
|
|||
});
|
||||
|
||||
it('should add and remove new line', () => {
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/claim/${claimId}/development`);
|
||||
//add row
|
||||
cy.addCard();
|
||||
cy.get(thirdRow).should('exist');
|
||||
|
||||
const rowData = [false, 'Novato', 'Roces', 'Compradores', 'employeeNick', 'Tour'];
|
||||
cy.fillRow(thirdRow, rowData);
|
||||
|
||||
cy.saveCard();
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/claim/${claimId}/development`);
|
||||
|
||||
cy.validateRow(thirdRow, rowData);
|
||||
|
||||
cy.reload();
|
||||
|
|
|
@ -52,16 +52,9 @@ Cypress.Commands.add('getValue', (selector) => {
|
|||
}
|
||||
// Si es un QSelect
|
||||
else if ($el.find('.q-select__dropdown-icon').length) {
|
||||
cy.log(
|
||||
selector,
|
||||
cy.get(
|
||||
selector +
|
||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native'
|
||||
)
|
||||
);
|
||||
return cy.get(
|
||||
selector +
|
||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > span'
|
||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
|
||||
);
|
||||
} else {
|
||||
// Puedes añadir un log o lanzar un error si el elemento no es reconocido
|
||||
|
@ -83,7 +76,6 @@ Cypress.Commands.add('checkOption', (selector) => {
|
|||
// Global buttons
|
||||
Cypress.Commands.add('saveCard', () => {
|
||||
cy.get('[title="Save"]').click();
|
||||
cy.get('[title="Save"]').should('have.class', 'disabled');
|
||||
});
|
||||
Cypress.Commands.add('resetCard', () => {
|
||||
cy.get('[title="Reset"]').click();
|
||||
|
@ -130,7 +122,7 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
|
|||
cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`);
|
||||
continue;
|
||||
}
|
||||
cy.getValue(`:nth-child(${index + 1})`).should('have.text', value);
|
||||
cy.getValue(`:nth-child(${index + 1})`).should('have.value', value);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue