From 2ca60b6a0f4038507a584fe2d78e5f1bd566c47a Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 25 Feb 2025 15:27:12 +0100 Subject: [PATCH] fix: refs #8581 update Cypress tests to use data-cy attributes and improve checkbox validation --- .../invoiceIn/invoiceInDescriptor.spec.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js index 6c247b5b8..c6522f453 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js @@ -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); }); }); });