From 33eef88825c33bbce5661a165a7c8d94364a9597 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 21 Feb 2024 14:00:52 +0100 Subject: [PATCH] refs #5509 fix: e2e --- test/cypress/integration/claim/claimDevelopment.spec.js | 4 ++-- .../integration/invoiceIn/invoiceInIntrastat.spec.js | 2 +- test/cypress/integration/invoiceIn/invoiceInVat.spec.js | 2 +- test/cypress/support/commands.js | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js index 88ccbfab80..26c7ee1961 100755 --- a/test/cypress/integration/claim/claimDevelopment.spec.js +++ b/test/cypress/integration/claim/claimDevelopment.spec.js @@ -13,7 +13,7 @@ describe('ClaimDevelopment', () => { it('should reset line', () => { cy.selectOption(firstLineReason, 'Novato'); cy.resetCard(); - cy.getValue(firstLineReason).should('have.value', 'Prisas'); + cy.getValue(firstLineReason).should('equal', 'Prisas'); }); it('should edit line', () => { @@ -23,7 +23,7 @@ describe('ClaimDevelopment', () => { cy.login('developer'); cy.visit(`/#/claim/${claimId}/development`); - cy.getValue(firstLineReason).should('have.value', 'Novato'); + cy.getValue(firstLineReason).should('equal', 'Novato'); //Restart data cy.selectOption(firstLineReason, 'Prisas'); diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js index 5024b2f1c4..306c0b8c02 100644 --- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js @@ -18,7 +18,7 @@ describe('InvoiceInIntrastat', () => { cy.visit(`/#/invoice-in/1/intrastat`); cy.getValue(firstLineCode).should( - 'have.value', + 'equal', 'Plantas vivas: Esqueje/injerto, Vid' ); }); diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js index 26c7750adb..811374b986 100644 --- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js @@ -21,7 +21,7 @@ describe('InvoiceInVat', () => { cy.saveCard(); cy.visit(`/#/invoice-in/1/vat`); - cy.getValue(firstLineVat).should('have.value', 'H.P. IVA 21% CEE'); + cy.getValue(firstLineVat).should('equal', 'H.P. IVA 21% CEE'); }); it('should add a new row', () => { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index a8b4a86f04..f075d500ff 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -55,13 +55,13 @@ Cypress.Commands.add('getValue', (selector) => { return cy.get( selector + '> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input' - ); + ).invoke('val') } // Si es un QSelect if ($el.find('span').length) { return cy.get( selector + ' span' - ); + ).then(($span) => { return $span[0].innerText }) } // Puedes aƱadir un log o lanzar un error si el elemento no es reconocido cy.log('Elemento no soportado'); @@ -138,7 +138,7 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => { cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`); continue; } - cy.getValue(`:nth-child(${index + 1})`).invoke('text').should('have.value', value) + cy.getValue(`:nth-child(${index + 1})`).should('equal', value) } }); });