fix: refs #8581 update Cypress tests to use data-cy attributes and improve checkbox validation

This commit is contained in:
Jorge Penadés 2025-02-25 15:27:12 +01:00
parent 3993e37f39
commit 2ca60b6a0f
1 changed files with 6 additions and 9 deletions

View File

@ -1,23 +1,20 @@
describe('InvoiceInDescriptor', () => {
const book = '.summaryHeader > .no-wrap > .q-btn';
const firstDescritorOpt = '.q-menu > .q-list > :nth-child(5) > .q-item__section';
const checkbox = ':nth-child(5) > .q-checkbox';
const checkbox = '[data-cy="vnLvIs booked"] > .q-checkbox';
describe('more options', () => {
it('should booking and unbooking the invoice properly', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/invoice-in/1/summary');
cy.waitForElement('.q-page');
cy.dataCy('descriptor-more-opts').click();
cy.selectDescriptorOption();
cy.get(book).click();
cy.dataCy('VnConfirm_confirm').click();
cy.get(checkbox).invoke('attr', 'aria-checked').should('eq', 'true');
cy.validateCheckbox(checkbox);
cy.selectDescriptorOption();
cy.dataCy('descriptor-more-opts').first().click();
cy.get(firstDescritorOpt).click();
cy.dataCy('VnConfirm_confirm').click();
cy.get(checkbox).invoke('attr', 'aria-checked').should('eq', 'false');
cy.validateCheckbox(checkbox, false);
});
});
});