From d9b0ed1174fbfc34145a06346d7004a44ed4d65b Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 21 Feb 2025 14:17:45 +0100 Subject: [PATCH 01/10] feat: refs #8648 enhance roadmapList tests with improved selectors and additional scenarios --- .../route/roadMap/roadmapList.spec.js | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js index 6d46b2cf6..64fcd1330 100644 --- a/test/cypress/integration/route/roadMap/roadmapList.spec.js +++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js @@ -1,12 +1,76 @@ describe('RoadMap', () => { + const getSelector = (colField) => + `tr:last-child > [data-col-field="${colField}"] > .no-padding`; + + const selectors = { + roadmap: getSelector('name'), + id: getSelector('id'), + etd: getSelector('etd'), + summaryHeader: '.summaryHeader > :nth-child(2)', + summaryGoToSummaryBtn: '.summaryHeader > a > .q-icon', + summaryBtn: 'tableAction-0', + inputRoadmap: 'Roadmap_input', + checkbox: '.q-virtual-scroll__content tr:last-child .q-checkbox', + cloneFormBtn: '.q-card__actions > .q-btn--standard', + cloneBtn: '#subToolbar > :nth-child(3)', + deleteBtn: ':nth-child(4) > .q-btn__content', + confirmBtn: 'VnConfirm_confirm', + inputEtd: 'ETD_inputDate', + }; + + const data = { + roadmap: 'TEST-ROADMAP', + etd: '01/01/2025', + }; + + const dataCreated = 'Data created'; + const summaryUrl = '/summary'; + beforeEach(() => { + cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/route/roadmap`); + cy.typeSearchbar('{enter}'); }); + + it('Should list roadmaps', () => { + cy.get('.q-table') + .children() + .should('be.visible') + .should('have.length.greaterThan', 0); + }); + it('Route list create roadmap and redirect', () => { cy.addBtnClick(); - cy.get('input[name="name"]').type('roadMapTestOne{enter}'); - cy.get('.q-notification__message').should('have.text', 'Data created'); - cy.url().should('include', '/summary'); + cy.dataCy(selectors.inputRoadmap).type(`${data.roadmap}{enter}`); + cy.checkNotification(dataCreated); + cy.url().should('include', summaryUrl); + }); + + it('open summary', () => { + cy.dataCy(selectors.summaryBtn).last().click(); + cy.get(selectors.summaryHeader).should('contain', data.roadmap); + cy.get(selectors.summaryGoToSummaryBtn).click(); + cy.get(selectors.summaryHeader).should('contain', data.roadmap); + }); + + it('Should clone selected roadmap with new ETD', () => { + cy.get(selectors.checkbox).click(); + cy.get(selectors.cloneBtn).click(); + cy.dataCy(selectors.inputEtd).click().type(`${data.etd}{enter}`); + cy.get(selectors.cloneFormBtn).click(); + cy.get(selectors.etd).should('contain', data.etd); + }); + + it('Should delete selected roadmap', () => { + cy.get(selectors.id).then(($el) => { + const valor = $el.text(); + + cy.get(selectors.checkbox).click(); + cy.get(selectors.deleteBtn).click(); + cy.dataCy(selectors.confirmBtn).click(); + cy.typeSearchbar('{enter}'); + cy.get(selectors.id).should('not.have.text', valor); + }); }); }); From a0a5c4944b14c1e2f26d9b481bd4737fb69e3fdb Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 3 Mar 2025 14:13:26 +0100 Subject: [PATCH 02/10] refactor: refs #8648 update roadmap deletion test to use current element text --- test/cypress/integration/route/roadMap/roadmapList.spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js index 64fcd1330..35c0c2b02 100644 --- a/test/cypress/integration/route/roadMap/roadmapList.spec.js +++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js @@ -64,13 +64,11 @@ describe('RoadMap', () => { it('Should delete selected roadmap', () => { cy.get(selectors.id).then(($el) => { - const valor = $el.text(); - cy.get(selectors.checkbox).click(); cy.get(selectors.deleteBtn).click(); cy.dataCy(selectors.confirmBtn).click(); cy.typeSearchbar('{enter}'); - cy.get(selectors.id).should('not.have.text', valor); + cy.get(selectors.id).should('not.have.text', $el.text); }); }); }); From c7136c35a43847b52686fe339a7d91679fe1bf06 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 7 Mar 2025 09:38:26 +0100 Subject: [PATCH 03/10] fix(ClaimSummary): clean url --- src/components/ui/VnNotes.vue | 2 +- src/pages/Claim/Card/ClaimSummaryAction.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index eb0804af0..6ce28254d 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -186,7 +186,7 @@ function fetchData([data]) { ref="vnPaginateRef" class="show" v-bind="$attrs" - search-url="notes" + :search-url="false" @on-fetch=" newNote.text = ''; newNote.observationTypeFk = null; diff --git a/src/pages/Claim/Card/ClaimSummaryAction.vue b/src/pages/Claim/Card/ClaimSummaryAction.vue index e5273902c..577ac2a65 100644 --- a/src/pages/Claim/Card/ClaimSummaryAction.vue +++ b/src/pages/Claim/Card/ClaimSummaryAction.vue @@ -80,7 +80,7 @@ const columns = [ :right-search="false" :column-search="false" :disable-option="{ card: true, table: true }" - search-url="actions" + :search-url="false" :filter="{ where: { claimFk: $props.id } }" :columns="columns" :limit="0" From 34d4944fbfbadf90027a0e335bfbb262745943ef Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 11 Mar 2025 08:47:33 +0100 Subject: [PATCH 04/10] test: fix clientBalance --- src/components/common/VnInput.vue | 2 +- test/cypress/integration/client/clientBalance.spec.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 9e13f5351..9821992cb 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -143,7 +143,7 @@ const handleUppercase = () => { :rules="mixinRules" :lazy-rules="true" hide-bottom-space - :data-cy="$attrs['data-cy'] ?? $attrs.label + '_input'" + :data-cy="($attrs['data-cy'] ?? $attrs.label) + '_input'" >