From 1c76d8671030833543829d2905a5258c7e107447 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 24 May 2024 09:56:16 +0200 Subject: [PATCH] fix: refs #6942 e2e tests --- .../invoiceIn/invoiceInBasicData.spec.js | 22 ++++++++----------- .../invoiceIn/invoiceInDescriptor.spec.js | 16 ++++++++------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js index 963dda3e2..77a11969b 100644 --- a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js @@ -2,8 +2,7 @@ describe('InvoiceInBasicData', () => { const formInputs = '.q-form > .q-card input'; const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select'; - const appendBtns = '.q-form label button'; - const dialogAppendBtns = '.q-dialog label button'; + const documentBtns = '.q-form .q-field button'; const dialogInputs = '.q-dialog input'; const dialogActionBtns = '.q-card__actions button'; @@ -15,8 +14,7 @@ describe('InvoiceInBasicData', () => { it('should edit the provideer and supplier ref', () => { cy.selectOption(firstFormSelect, 'Bros'); cy.get('[title="Reset"]').click(); - cy.get(appendBtns).eq(0).click(); - cy.get(formInputs).eq(1).type(4739); + cy.get(formInputs).eq(1).type('{selectall}4739'); cy.saveCard(); cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick'); @@ -27,22 +25,20 @@ describe('InvoiceInBasicData', () => { const firtsInput = 'Ticket:65'; const secondInput = "I don't know what posting here!"; - cy.get(appendBtns).eq(3).click(); - cy.get(dialogAppendBtns).eq(0).click(); - cy.get(dialogInputs).eq(0).type(firtsInput); - cy.get(dialogAppendBtns).eq(1).click(); - cy.get('textarea').type(secondInput); + cy.get(documentBtns).eq(1).click(); + cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`); + cy.get('textarea').type(`{selectall}${secondInput}`); cy.get(dialogActionBtns).eq(1).click(); - cy.get(appendBtns).eq(3).click(); - + cy.get(documentBtns).eq(1).click(); cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput); cy.get('textarea').invoke('val').should('eq', secondInput); }); it('should throw an error creating a new dms if a file is not attached', () => { - cy.get(appendBtns).eq(2).click(); - cy.get(appendBtns).eq(1).click(); + cy.get(formInputs).eq(5).click(); + cy.get(formInputs).eq(5).type('{selectall}{backspace}'); + cy.get(documentBtns).eq(0).click(); cy.get(dialogActionBtns).eq(1).click(); cy.get('.q-notification__message').should( 'have.text', diff --git a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js index 85fdc4b0a..f2d9a3497 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js @@ -1,7 +1,9 @@ describe('InvoiceInDescriptor', () => { - const saveDialog = '.q-btn--unelevated > .q-btn__content > .block'; + const dialogBtns = '.q-card__actions button'; const firstDescritorOpt = '.q-menu > .q-list > :nth-child(1) > .q-item__section'; - const screen = '.q-drawer-container > .fullscreen'; + const isBookedField = + '.q-card:nth-child(3) .vn-label-value:nth-child(5) > .value > span'; + it('should booking and unbooking the invoice properly', () => { cy.login('developer'); cy.visit(`/#/invoice-in/1/summary?limit=10`); @@ -9,14 +11,14 @@ describe('InvoiceInDescriptor', () => { cy.openLeftMenu(); cy.openActionsDescriptor(); cy.get(firstDescritorOpt).click(); - cy.get(saveDialog).click(); - cy.get(screen).click(); - cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'true'); + cy.get(dialogBtns).eq(1).click(); + cy.get('.fullscreen').first().click(); + cy.get(isBookedField).should('have.attr', 'title', 'true'); cy.openLeftMenu(); cy.openActionsDescriptor(); cy.get(firstDescritorOpt).click(); - cy.get(saveDialog).click(); - cy.get('.q-checkbox').should('have.attr', 'aria-checked', 'false'); + cy.get(dialogBtns).eq(1).click(); + cy.get(isBookedField).should('have.attr', 'title', 'false'); }); });