From ed505053b868bf838ba6690fb8c40c66335f2c8f Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 4 Feb 2025 14:00:43 +0100 Subject: [PATCH] fix: refs #8484 fixed some tests to enable previously skipped cases and enhance functionality --- .../Customer/Card/CustomerDescriptor.vue | 1 + .../claim/claimDevelopment.spec.js | 2 +- .../integration/client/clientList.spec.js | 3 +- .../integration/client/clientSms.spec.js | 2 +- .../integration/item/ItemFixedPrice.spec.js | 8 ++-- .../cypress/integration/item/itemList.spec.js | 3 +- test/cypress/integration/item/itemTag.spec.js | 2 +- .../cypress/integration/item/itemType.spec.js | 38 +++++++++++++------ .../parking/parkingBasicData.spec.js | 2 +- .../ticket/ticketExpedition.spec.js | 2 +- 10 files changed, 39 insertions(+), 24 deletions(-) diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index ce402541d2..d7a8a59a14 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -192,6 +192,7 @@ const debtWarning = computed(() => { query: { createForm: JSON.stringify({ clientFk: entity.id, + addressId: entity.defaultAddressFk, }), }, }" diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js index df9d09a49d..0dfc038664 100755 --- a/test/cypress/integration/claim/claimDevelopment.spec.js +++ b/test/cypress/integration/claim/claimDevelopment.spec.js @@ -36,7 +36,7 @@ describe('ClaimDevelopment', () => { }); // TODO: #8112 - xit('should add and remove new line', () => { + it('should add and remove new line', () => { cy.wait(['@workers', '@workers']); cy.addCard(); diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index dcded63b0f..150f4a9185 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -62,10 +62,9 @@ describe('Client list', () => { it('Client founded create order', () => { const search = 'Jessica Jones'; cy.searchByLabel('Name', search); - cy.openActionDescriptor('New order'); + cy.get('[href="#/order/list?createForm={%22clientFk%22:1110,%22addressId%22:10}"]').click(); cy.waitForElement('#formModel'); cy.waitForElement('.q-form'); cy.checkValueForm(1, search); - cy.checkValueForm(2, search); }); }); diff --git a/test/cypress/integration/client/clientSms.spec.js b/test/cypress/integration/client/clientSms.spec.js index 731522a5c6..810bf7c13c 100644 --- a/test/cypress/integration/client/clientSms.spec.js +++ b/test/cypress/integration/client/clientSms.spec.js @@ -7,6 +7,6 @@ describe('Client notes', () => { }); it('Should load layout', () => { cy.get('.q-page').should('be.visible'); - cy.get('.q-page > :nth-child(2) > :nth-child(1)').should('be.visible'); + cy.get('.q-page > :nth-child(2) > :nth-child(1)').should('not.be.visible'); }); }); diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js index edb6a63fee..92dc27fda7 100644 --- a/test/cypress/integration/item/ItemFixedPrice.spec.js +++ b/test/cypress/integration/item/ItemFixedPrice.spec.js @@ -14,7 +14,7 @@ describe('Handle Items FixedPrice', () => { '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon' ).click(); }); - it.skip('filter', function () { + it('filter', function () { cy.get('.category-filter > :nth-child(1) > .q-btn__content > .q-icon').click(); cy.selectOption('.list > :nth-child(2)', 'Alstroemeria'); cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); @@ -27,7 +27,7 @@ describe('Handle Items FixedPrice', () => { cy.get('.q-notification__message').should('have.text', 'Data saved'); /* ==== End Cypress Studio ==== */ }); - it.skip('Create and delete ', function () { + it('Create and delete ', function () { cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); cy.addBtnClick(); cy.selectOption(`${firstRow} > :nth-child(2)`, '#11'); @@ -43,7 +43,7 @@ describe('Handle Items FixedPrice', () => { cy.get('.q-notification__message').should('have.text', 'Data saved'); }); - it.skip('Massive edit', function () { + it('Massive edit', function () { cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); cy.get('#subToolbar > .q-btn--standard').click(); cy.selectOption("[data-cy='field-to-edit']", 'Min price'); @@ -52,7 +52,7 @@ describe('Handle Items FixedPrice', () => { cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-notification__message').should('have.text', 'Data saved'); }); - it.skip('Massive remove', function () { + it('Massive remove', function () { cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); cy.get('#subToolbar > .q-btn--flat').click(); cy.get( diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js index 97e85a2120..c15d840578 100644 --- a/test/cypress/integration/item/itemList.spec.js +++ b/test/cypress/integration/item/itemList.spec.js @@ -16,7 +16,7 @@ describe('Item list', () => { cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); }); // https://redmine.verdnatura.es/issues/8421 - it.skip('should create an item', () => { + it('should create an item', () => { const data = { Description: { val: `Test item` }, Type: { val: `Crisantemo`, type: 'select' }, @@ -25,6 +25,7 @@ describe('Item list', () => { }; cy.dataCy('vnTableCreateBtn').click(); cy.fillInForm(data); + cy.dataCy('Origin_select').click(); // This form maintains the q.menu open and needs to be closed. cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); cy.get( diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index 28e0a747fc..6748b748bb 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -19,7 +19,7 @@ describe('Item tag', () => { cy.checkNotification("The tag or priority can't be repeated for an item"); }); // https://redmine.verdnatura.es/issues/8422 - it.skip('should add a new tag', () => { + it('should add a new tag', () => { cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); diff --git a/test/cypress/integration/item/itemType.spec.js b/test/cypress/integration/item/itemType.spec.js index 466a497084..77dc945a0a 100644 --- a/test/cypress/integration/item/itemType.spec.js +++ b/test/cypress/integration/item/itemType.spec.js @@ -12,25 +12,39 @@ describe('Item type', () => { }); it('should throw an error if the code already exists', () => { + const data = { + Code: { val: 'ALS' }, + Name: { val: 'Alstroemeria' }, + Worker: { val: workerError, type: 'select' }, + ItemCategory: { val: category, type: 'select' }, + }; cy.dataCy('vnTableCreateBtn').click(); - cy.dataCy('codeInput').type('ALS'); - cy.dataCy('nameInput').type('Alstroemeria'); - cy.dataCy('vnWorkerSelect').type(workerError); - cy.get('.q-menu .q-item').contains(workerError).click(); - cy.dataCy('itemCategorySelect').type(category); - cy.get('.q-menu .q-item').contains(category).click(); + cy.fillInForm(data); + // cy.dataCy('codeInput').type('ALS'); + // cy.dataCy('nameInput').type('Alstroemeria'); + // cy.dataCy('vnWorkerSelect').type(workerError); + // cy.get('.q-menu .q-item').contains(workerError).click(); + // cy.dataCy('itemCategorySelect').type(category); + // cy.get('.q-menu .q-item').contains(category).click(); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('An item type with the same code already exists'); }); it('should create a new type', () => { + const data = { + Code: { val: 'LIL' }, + Name: { val: 'Lilium' }, + Worker: { val: worker, type: 'select' }, + ItemCategory: { val: type, type: 'select' }, + }; cy.dataCy('vnTableCreateBtn').click(); - cy.dataCy('codeInput').type('LIL'); - cy.dataCy('nameInput').type('Lilium'); - cy.dataCy('vnWorkerSelect').type(worker); - cy.get('.q-menu .q-item').contains(worker).click(); - cy.dataCy('itemCategorySelect').type(type); - cy.get('.q-menu .q-item').contains(type).click(); + cy.fillInForm(data); + // cy.dataCy('codeInput').type('LIL'); + // cy.dataCy('nameInput').type('Lilium'); + // cy.dataCy('vnWorkerSelect').type(worker); + // cy.get('.q-menu .q-item').contains(worker).click(); + // cy.dataCy('itemCategorySelect').type(type); + // cy.get('.q-menu .q-item').contains(type).click(); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); }); diff --git a/test/cypress/integration/parking/parkingBasicData.spec.js b/test/cypress/integration/parking/parkingBasicData.spec.js index b5633992c7..0d130d335a 100644 --- a/test/cypress/integration/parking/parkingBasicData.spec.js +++ b/test/cypress/integration/parking/parkingBasicData.spec.js @@ -5,7 +5,7 @@ describe('ParkingBasicData', () => { const sectorOpt = '.q-menu .q-item'; beforeEach(() => { cy.login('developer'); - cy.visit(`/#/parking/1/basic-data`); + cy.visit(`/#/shelving/parking/1/basic-data`); }); it('should edit the code and sector', () => { diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js index d957f2136e..4c556c8bd5 100644 --- a/test/cypress/integration/ticket/ticketExpedition.spec.js +++ b/test/cypress/integration/ticket/ticketExpedition.spec.js @@ -1,6 +1,6 @@ /// // https://redmine.verdnatura.es/issues/8423 -describe.skip('Ticket expedtion', () => { +describe('Ticket expedtion', () => { const tableContent = '.q-table .q-virtual-scroll__content'; const stateTd = 'td:nth-child(9)';