From e0f60ed1181c2548ba77b4e2a55461c7b6492e5e Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 8 Oct 2024 11:07:05 +0000 Subject: [PATCH 1/2] test: fix VnLocation --- .../integration/vnComponent/vnLocation.spec.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js index 78dc38899..c1b0cf929 100644 --- a/test/cypress/integration/vnComponent/vnLocation.spec.js +++ b/test/cypress/integration/vnComponent/vnLocation.spec.js @@ -64,7 +64,7 @@ describe('VnLocation', () => { `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon` ).click(); cy.get( - `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input` + `#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input` ).should('have.value', province); }); }); @@ -133,6 +133,8 @@ describe('VnLocation', () => { ); cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get(`${createForm.prefix}`).should('not.exist'); + cy.waitForElement('.q-form'); + checkVnLocation(postCode, province); }); it('Create city', () => { @@ -144,10 +146,12 @@ describe('VnLocation', () => { cy.get( `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon` ).click(); - cy.selectOption('#q-portal--dialog--2 .q-select', 'one'); - cy.get('#q-portal--dialog--2 .q-input').type(province); - cy.get('#q-portal--dialog--2 .q-btn--standard').click(); + cy.selectOption('#q-portal--dialog--3 .q-select', 'one'); + cy.get('#q-portal--dialog--3 .q-input').type(province); + cy.get('#q-portal--dialog--3 .q-btn--standard').click(); cy.get('#q-portal--dialog--1 .q-btn--standard').click(); + cy.waitForElement('.q-form'); + checkVnLocation(postCode, province); }); From 6a797460806cf628f9310a7c54d35fb878c29b03 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 8 Oct 2024 13:18:51 +0200 Subject: [PATCH 2/2] test: fix TicketDescriptor --- test/cypress/integration/ticket/ticketDescriptor.spec.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js index 8192b7c7c..0ba2723a2 100644 --- a/test/cypress/integration/ticket/ticketDescriptor.spec.js +++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js @@ -1,7 +1,8 @@ /// describe('Ticket descriptor', () => { - const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)'; - const setWeightOpt = '[role="menu"] .q-list > :nth-child(6)'; + const listItem = '[role="menu"] .q-list .q-item'; + const toCloneOpt = 'To clone ticket'; + const setWeightOpt = 'Set weight'; const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span'; const summaryHeader = '.summaryHeader > div'; const weight = 25; @@ -14,7 +15,7 @@ describe('Ticket descriptor', () => { it('should clone the ticket without warehouse', () => { cy.visit('/#/ticket/1/summary'); cy.openActionsDescriptor(); - cy.get(toCloneOpt).click(); + cy.contains(listItem, toCloneOpt).click(); cy.clickConfirm(); cy.get(warehouseValue).contains('Warehouse One'); cy.get(summaryHeader) @@ -28,7 +29,7 @@ describe('Ticket descriptor', () => { it('should set the weight of the ticket', () => { cy.visit('/#/ticket/10/summary'); cy.openActionsDescriptor(); - cy.get(setWeightOpt).click(); + cy.contains(listItem, setWeightOpt).click(); cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight'); cy.get('.q-dialog input').type(weight); cy.clickConfirm();