diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js index 6a1c18785..c9fe6314a 100644 --- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js @@ -12,11 +12,8 @@ describe('InvoiceInIntrastat', () => { it('should edit the first line', () => { cy.selectOption(`${firstRow} ${codes}`, 'Plantas vivas: Esqueje/injerto, Vid'); - cy.get(firstRowAmount).clear(); cy.saveCard(); - cy.get(codes) - .eq(0) - .should('have.value', '6021010: Plantas vivas: Esqueje/injerto, Vid'); + cy.get(codes).eq(0).contains('6021010: Plantas vivas: Esqueje/injerto, Vid'); }); it('should add a new row', () => { @@ -30,7 +27,7 @@ describe('InvoiceInIntrastat', () => { 'FR', ]); cy.saveCard(); - cy.get('.q-notification__message').should('have.text', 'Data saved'); + cy.checkNotification('Data saved'); }); it('should remove the first line', () => { diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js index 3059a974b..b8b42fa4b 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js @@ -31,7 +31,7 @@ describe('InvoiceOut list', () => { it('should open the invoice descriptor from table icon', () => { cy.get(firstSummaryIcon).click(); cy.get('.cardSummary').should('be.visible'); - cy.get('.summaryHeader > div').should('include.text', 'V10100001'); + cy.get('.summaryHeader > div').should('include.text', 'A1111111'); }); it('should open the client descriptor', () => { diff --git a/test/cypress/integration/shelving/parking/parkingBasicData.spec.js b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js index b898f68d5..b6bae6e9c 100644 --- a/test/cypress/integration/shelving/parking/parkingBasicData.spec.js +++ b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js @@ -1,8 +1,7 @@ /// describe('ParkingBasicData', () => { const codeInput = 'form .q-card .q-input input'; - const sectorSelect = 'form .q-card .q-select input'; - const sectorOpt = '.q-menu .q-item'; + const sectorSelect = 'form .q-card .q-select'; beforeEach(() => { cy.login('developer'); cy.visit(`/#/shelving/parking/1/basic-data`); @@ -17,8 +16,7 @@ describe('ParkingBasicData', () => { }); it('should edit the code and sector', () => { - cy.get(sectorSelect).type('First'); - cy.get(sectorOpt).click(); + cy.selectOption(sectorSelect, 'First'); cy.get(codeInput).eq(0).clear(); cy.get(codeInput).eq(0).type('700-01'); diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js index 8722fe37e..7eed957e2 100644 --- a/test/cypress/integration/vnComponent/UserPanel.spec.js +++ b/test/cypress/integration/vnComponent/UserPanel.spec.js @@ -5,48 +5,31 @@ describe('UserPanel', () => { cy.login('developer'); cy.visit(`/#dashboard`); cy.waitForElement('.q-page', 6000); + cy.openUserPanel(); }); it('should notify when update user warehouse', () => { - const userWarehouse = - '.q-menu .q-gutter-xs > :nth-child(3) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input'; + const userWarehouse = '.q-menu .q-gutter-xs > :nth-child(3) > .q-field'; + const oldOption = 'VNL'; + const newOption = 'VNH'; + cy.get(userWarehouse).contains(oldOption); + cy.selectOption(userWarehouse, newOption); + cy.checkNotification('Data saved'); + cy.get(userWarehouse).contains(newOption); - // Abro el panel - cy.openUserPanel(); - - // Compruebo la opcion inicial - cy.get(userWarehouse).should('have.value', 'VNL').click(); - - // Actualizo la opción - cy.getOption(3); - - //Compruebo la notificación - cy.get('.q-notification').should('be.visible'); - cy.get(userWarehouse).should('have.value', 'VNH'); - - //Restauro el valor - cy.get(userWarehouse).click(); - cy.getOption(2); + // Restore + cy.selectOption(userWarehouse, oldOption); }); it('should notify when update user company', () => { - const userCompany = - '.q-menu .q-gutter-xs > :nth-child(2) > .q-field--float > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input'; + const userCompany = '.q-menu .q-gutter-xs > :nth-child(2) > .q-field'; + const oldOption = 'Warehouse One'; + const newOption = 'TestingWarehouse'; + cy.get(userCompany).contains(oldOption); + cy.selectOption(userCompany, newOption); + cy.checkNotification('Data saved'); + cy.get(userCompany).contains(newOption); - // Abro el panel - cy.openUserPanel(); - - // Compruebo la opcion inicial - cy.get(userCompany).should('have.value', 'Warehouse One').click(); - - //Actualizo la opción - cy.getOption(3); - - //Compruebo la notificación - cy.get('.q-notification').should('be.visible'); - cy.get(userCompany).should('have.value', 'TestingWarehouse'); - - //Restauro el valor - cy.get(userCompany).click(); - cy.getOption(1); + // Restore + cy.selectOption(userCompany, oldOption); }); }); diff --git a/test/cypress/integration/vnComponent/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js index ee49d6065..41fdd7dc3 100644 --- a/test/cypress/integration/vnComponent/VnLocation.spec.js +++ b/test/cypress/integration/vnComponent/VnLocation.spec.js @@ -41,7 +41,7 @@ describe('VnLocation', () => { cy.get( `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `, ).click(); - cy.dataCy('locationProvince').should('have.value', province); + cy.dataCy('locationProvince').contains(province); }); }); describe('Worker Create', () => { diff --git a/test/cypress/integration/zone/zoneDeliveryDays.spec.js b/test/cypress/integration/zone/zoneDeliveryDays.spec.js index 6d19edb77..51c65df05 100644 --- a/test/cypress/integration/zone/zoneDeliveryDays.spec.js +++ b/test/cypress/integration/zone/zoneDeliveryDays.spec.js @@ -26,27 +26,8 @@ describe('ZoneDeliveryDays', () => { }); }).as('events'); - cy.dataCy('ZoneDeliveryDaysPostcodeSelect').type(postcode); - cy.get('.q-menu .q-item').contains(postcode).click(); - cy.get('.q-menu').then(($menu) => { - if ($menu.is(':visible')) { - cy.get('[data-cy="ZoneDeliveryDaysPostcodeSelect"]') - .as('focusedElement') - .focus(); - cy.get('@focusedElement').blur(); - } - }); - - cy.dataCy('ZoneDeliveryDaysAgencySelect').type(agency); - cy.get('.q-menu .q-item').contains(agency).click(); - cy.get('.q-menu').then(($menu) => { - if ($menu.is(':visible')) { - cy.get('[data-cy="ZoneDeliveryDaysAgencySelect"]') - .as('focusedElement') - .focus(); - cy.get('@focusedElement').blur(); - } - }); + cy.selectOption('[data-cy="ZoneDeliveryDaysPostcodeSelect"]', postcode); + cy.selectOption('[data-cy="ZoneDeliveryDaysAgencySelect"]', agency); cy.get(submitForm).click(); cy.wait('@events').then((interception) => {