From cb2d2d1ce07b75db20c53dfd2bf898625f2b82ee Mon Sep 17 00:00:00 2001 From: provira Date: Tue, 18 Feb 2025 15:00:58 +0100 Subject: [PATCH 01/15] feat: refs #8612 changed shelving to VnTable & created e2e tests --- src/pages/Shelving/ShelvingList.vue | 166 ++++++++++++------ src/router/modules/shelving.js | 9 - .../parking/parkingBasicData.spec.js | 0 .../parking/parkingList.spec.js | 0 .../shelving/shelvingBasicData.spec.js | 20 +++ .../integration/shelving/shelvingList.spec.js | 32 ++++ 6 files changed, 166 insertions(+), 61 deletions(-) rename test/cypress/integration/{ => shelving}/parking/parkingBasicData.spec.js (100%) rename test/cypress/integration/{ => shelving}/parking/parkingList.spec.js (100%) create mode 100644 test/cypress/integration/shelving/shelvingBasicData.spec.js create mode 100644 test/cypress/integration/shelving/shelvingList.spec.js diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index 4e0c21100..4af1e4e7d 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -1,25 +1,60 @@ + + + + + es: + shelving: + list: + parking: Estacionamiento + priority: Prioridad + + summary: + recyclable: Reciclable + en: + shelving: + list: + parking: Parking + priority: Priority + + summary: + recyclable: Recyclable + diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js index c085dd8dc..94ff274dc 100644 --- a/src/router/modules/shelving.js +++ b/src/router/modules/shelving.js @@ -111,15 +111,6 @@ export default { shelvingCard, ], }, - { - path: 'create', - name: 'ShelvingCreate', - meta: { - title: 'shelvingCreate', - icon: 'add', - }, - component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'), - }, { path: 'parking', name: 'ParkingMain', diff --git a/test/cypress/integration/parking/parkingBasicData.spec.js b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js similarity index 100% rename from test/cypress/integration/parking/parkingBasicData.spec.js rename to test/cypress/integration/shelving/parking/parkingBasicData.spec.js diff --git a/test/cypress/integration/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js similarity index 100% rename from test/cypress/integration/parking/parkingList.spec.js rename to test/cypress/integration/shelving/parking/parkingList.spec.js diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js new file mode 100644 index 000000000..54547463e --- /dev/null +++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js @@ -0,0 +1,20 @@ +/// +describe('ShelvingList', () => { + + const parking = '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container'; + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/1/basic-data`); + }); + + it('should edit the data and save', () => { + cy.selectOption(parking, 'P-01-1'); + cy.dataCy('Code_input').type('1'); + cy.dataCy('Priority_input').type('10'); + cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click(); + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + + }); +}); \ No newline at end of file diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js new file mode 100644 index 000000000..1a792c3d1 --- /dev/null +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -0,0 +1,32 @@ +/// +describe('ShelvingList', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/list`); + }); + + it('should redirect on clicking a shelving', () => { + cy.get('#searchbar input').type('{enter}'); + cy.get(':nth-child(2) > .q-card').click(); + cy.url().should('include', '/shelving/2/summary'); + }); + + it('should filter and redirect if only one result', () => { + cy.selectOption('[data-cy="Parking_select"]', 'P-02-2'); + cy.dataCy('Parking_select').type('{enter}'); + cy.url().should('match', /\/shelving\/\d+\/summary/); + }); + + it('should create a new shelving', () => { + cy.dataCy('vnTableCreateBtn').click(); + cy.dataCy('code-create-popup').type('Test'); + cy.dataCy('Priority_input').type('10'); + cy.selectOption( + '.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container', '100-01' + ) + cy.dataCy('FormModelPopup_save').click(); + cy.checkNotification('Data created'); + cy.url().should('match', /\/shelving\/\d+\/basic-data/); + }); +}); From 4ff6971a07d20ba0261050c1eea480cda138e8fc Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 21 Feb 2025 13:02:12 +0100 Subject: [PATCH 02/15] feat: refs #8612 added summary button & changed e2e tests --- src/pages/Shelving/ShelvingList.vue | 15 +++++++++++++++ .../shelving/shelvingBasicData.spec.js | 12 +++++++++--- .../integration/shelving/shelvingList.spec.js | 12 ++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index 4af1e4e7d..b95d3915f 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'; import VnTable from 'components/VnTable/VnTable.vue'; import VnSection from 'src/components/common/VnSection.vue'; import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue'; +import ShelvingSummary from './Card/ShelvingSummary.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import exprBuilder from './ShelvingExprBuilder.js'; import VnSelect from 'src/components/common/VnSelect.vue'; @@ -12,6 +13,7 @@ import { QCheckbox } from 'quasar'; const { t } = useI18n(); const router = useRouter(); +const { viewSummary } = useSummaryDialog(); const dataKey = 'ShelvingList'; const filter = { @@ -50,6 +52,19 @@ const columns = computed(() => [ label: t('shelving.summary.recyclable'), sortable: true, }, + { + align: 'right', + label: '', + name: 'tableActions', + actions: [ + { + title: t('components.smartCard.viewSummary'), + icon: 'preview', + action: (row) => viewSummary(row.id, ShelvingSummary), + isPrimary: true, + }, + ], + }, ]); const onDataSaved = ({ id }) => { diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js index 54547463e..0e90d2350 100644 --- a/test/cypress/integration/shelving/shelvingBasicData.spec.js +++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js @@ -8,13 +8,19 @@ describe('ShelvingList', () => { cy.visit(`/#/shelving/1/basic-data`); }); + it('should give an error if the code aldready exists', () => { + cy.dataCy('Code_input').should('exist').clear(); + cy.dataCy('Code_input').type('AA7'); + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'The code already exists'); + }); it('should edit the data and save', () => { cy.selectOption(parking, 'P-01-1'); - cy.dataCy('Code_input').type('1'); + cy.dataCy('Code_input').clear(); + cy.dataCy('Code_input').type('AA1'); cy.dataCy('Priority_input').type('10'); cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click(); cy.saveCard(); cy.get('.q-notification__message').should('have.text', 'Data saved'); - }); -}); \ No newline at end of file +}); diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js index 1a792c3d1..86cbabf89 100644 --- a/test/cypress/integration/shelving/shelvingList.spec.js +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -8,10 +8,18 @@ describe('ShelvingList', () => { it('should redirect on clicking a shelving', () => { cy.get('#searchbar input').type('{enter}'); - cy.get(':nth-child(2) > .q-card').click(); - cy.url().should('include', '/shelving/2/summary'); + cy.dataCy('cardBtn').eq(0).click(); + cy.get('.summaryHeader > .header > .q-icon').click(); + cy.url().should('include', '/shelving/1/summary'); }); + it('should redirect from preview to basic-data', () => { + cy.get('#searchbar input').type('{enter}'); + cy.dataCy('cardBtn').eq(0).click(); + cy.get('.q-card > .header').click(); + cy.url().should('include', '/shelving/1/basic-data'); + }) + it('should filter and redirect if only one result', () => { cy.selectOption('[data-cy="Parking_select"]', 'P-02-2'); cy.dataCy('Parking_select').type('{enter}'); From ae52fa17e3ff33a7bb4a5b8869cc6aeea3daee02 Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 21 Feb 2025 14:23:56 +0100 Subject: [PATCH 03/15] fix: refs #8612 changed QCheckbox for VnCheckbox --- src/pages/Shelving/ShelvingList.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index b95d3915f..651121de8 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -9,7 +9,7 @@ import ShelvingSummary from './Card/ShelvingSummary.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import exprBuilder from './ShelvingExprBuilder.js'; import VnSelect from 'src/components/common/VnSelect.vue'; -import { QCheckbox } from 'quasar'; +import VnCheckbox from 'src/components/common/VnCheckbox.vue'; const { t } = useI18n(); const router = useRouter(); @@ -118,7 +118,7 @@ const onDataSaved = ({ id }) => { :filter-options="['id', 'code']" :fields="['id', 'code']" /> - From 3835d7debe7e0267068d1e1859085c230d7f5588 Mon Sep 17 00:00:00 2001 From: provira Date: Wed, 26 Feb 2025 08:04:04 +0100 Subject: [PATCH 04/15] fix: refs #8612 fixed shelving e2e tests --- .../integration/shelving/shelvingBasicData.spec.js | 12 +++++------- .../integration/shelving/shelvingList.spec.js | 11 ++++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js index 0e90d2350..d7b0dc692 100644 --- a/test/cypress/integration/shelving/shelvingBasicData.spec.js +++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js @@ -1,7 +1,7 @@ /// describe('ShelvingList', () => { - - const parking = '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container'; + const parking = + '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container'; beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); @@ -9,16 +9,14 @@ describe('ShelvingList', () => { }); it('should give an error if the code aldready exists', () => { - cy.dataCy('Code_input').should('exist').clear(); - cy.dataCy('Code_input').type('AA7'); + cy.dataCy('Code_input').should('exist').clear().type('AA7'); cy.saveCard(); cy.get('.q-notification__message').should('have.text', 'The code already exists'); }); it('should edit the data and save', () => { cy.selectOption(parking, 'P-01-1'); - cy.dataCy('Code_input').clear(); - cy.dataCy('Code_input').type('AA1'); - cy.dataCy('Priority_input').type('10'); + cy.dataCy('Code_input').clear().type('AA1'); + cy.dataCy('Priority_input').clear().type('10'); cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click(); cy.saveCard(); cy.get('.q-notification__message').should('have.text', 'Data saved'); diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js index 86cbabf89..745dd1b78 100644 --- a/test/cypress/integration/shelving/shelvingList.spec.js +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -7,18 +7,18 @@ describe('ShelvingList', () => { }); it('should redirect on clicking a shelving', () => { - cy.get('#searchbar input').type('{enter}'); + cy.typeSearchbar('{enter}'); cy.dataCy('cardBtn').eq(0).click(); cy.get('.summaryHeader > .header > .q-icon').click(); cy.url().should('include', '/shelving/1/summary'); }); it('should redirect from preview to basic-data', () => { - cy.get('#searchbar input').type('{enter}'); + cy.typeSearchbar('{enter}'); cy.dataCy('cardBtn').eq(0).click(); cy.get('.q-card > .header').click(); cy.url().should('include', '/shelving/1/basic-data'); - }) + }); it('should filter and redirect if only one result', () => { cy.selectOption('[data-cy="Parking_select"]', 'P-02-2'); @@ -31,8 +31,9 @@ describe('ShelvingList', () => { cy.dataCy('code-create-popup').type('Test'); cy.dataCy('Priority_input').type('10'); cy.selectOption( - '.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container', '100-01' - ) + '.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container', + '100-01', + ); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); cy.url().should('match', /\/shelving\/\d+\/basic-data/); From f7f12b8c3b75a498c845b33ece4292f6aa52416a Mon Sep 17 00:00:00 2001 From: provira Date: Thu, 27 Feb 2025 12:40:01 +0100 Subject: [PATCH 05/15] fix: refs #8417 fixed claimPhoto e2e test --- .../integration/claim/claimPhoto.spec.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index c3522cbfe..f62a9e313 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,6 +1,6 @@ /// // redmine.verdnatura.es/issues/8417 -describe.skip('ClaimPhoto', () => { +describe('ClaimPhoto', () => { beforeEach(() => { const claimId = 1; cy.login('developer'); @@ -16,6 +16,7 @@ describe.skip('ClaimPhoto', () => { }); it('should add new file with drag and drop', () => { + cy.get('.container').should('be.visible').and('exist'); cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', { action: 'drag-drop', }); @@ -23,12 +24,8 @@ describe.skip('ClaimPhoto', () => { }); it('should open first image dialog change to second and close', () => { - cy.get(':nth-last-child(1) > .q-card').click(); - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'be.visible', - ); - - cy.get('.q-carousel__control > button').click(); + cy.get(':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image').click(); + cy.get('.q-carousel__next-arrow > .q-btn > .q-btn__content > .q-icon').click(); cy.get( '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', @@ -39,17 +36,13 @@ describe.skip('ClaimPhoto', () => { }); it('should remove third and fourth file', () => { - cy.get( - '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon', - ).click(); + cy.dataCy('delete-button-4').click(); cy.get( '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); cy.get('.q-notification__message').should('have.text', 'Data deleted'); - cy.get( - '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon', - ).click(); + cy.dataCy('delete-button-3').click(); cy.get( '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); From 3d204911621c7396c432c54ba02580a591835d80 Mon Sep 17 00:00:00 2001 From: provira Date: Thu, 27 Feb 2025 12:56:18 +0100 Subject: [PATCH 06/15] fix: refs #8417 added data-cy to delete button --- src/pages/Claim/Card/ClaimPhoto.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index d4acc9bbe..5496e5c51 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -210,6 +210,7 @@ function onDrag() { class="all-pointer-events absolute delete-button zindex" @click.stop="viewDeleteDms(index)" round + :data-cy="`delete-button-${index+1}`" /> Date: Fri, 28 Feb 2025 11:45:39 +0100 Subject: [PATCH 07/15] fix: refs #8417 added data-cy to all files and fixed test --- src/pages/Claim/Card/ClaimPhoto.vue | 2 ++ test/cypress/integration/claim/claimPhoto.spec.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index 5496e5c51..4ced7e862 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -228,6 +228,7 @@ function onDrag() { class="rounded-borders cursor-pointer fit" @click="openDialog(media.dmsFk)" v-if="!media.isVideo" + :data-cy="`file-${index+1}`" > {
{{ t('unpaidDated', { - dated: toDate(customer.unpaid?.dated), + dated: toDate(entity.unpaid?.dated), }) }}
{{ t('unpaidAmount', { - amount: toCurrency(customer.unpaid?.amount), + amount: toCurrency(entity.unpaid?.amount), }) }} From f030fcd8b71f15985b4d9a63a7888bcf6359b8ed Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 5 Mar 2025 07:40:07 +0100 Subject: [PATCH 15/15] fix(CustomerDescriptor): reposition isFreezed icon for better visibility --- src/pages/Customer/Card/CustomerDescriptor.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 04c81ddcc..e3156dd6d 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -118,14 +118,6 @@ const debtWarning = computed(() => { > {{ t('Allowed substitution') }}
- - {{ t('customer.card.isFrozen') }} - { > {{ t('customer.card.notChecked') }} + + {{ t('customer.card.isFrozen') }} +