diff --git a/Jenkinsfile b/Jenkinsfile index f57678938..e6647a654 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -108,7 +108,6 @@ pipeline { } stage('E2E') { environment { - CREDENTIALS = credentials('docker-registry') COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}" COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ." } @@ -116,8 +115,10 @@ pipeline { script { sh 'rm junit/e2e-*.xml || true' env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev' + withDockerRegistry([credentialsId: 'docker-registry', url: "https://${env.REGISTRY}" ]) { + sh "docker-compose ${env.COMPOSE_PARAMS} up -d" + } def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') - sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { sh 'cypress run --browser chromium || true' } diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue index 5978f4e21..255bea9cd 100644 --- a/src/components/TicketProblems.vue +++ b/src/components/TicketProblems.vue @@ -12,7 +12,7 @@ defineProps({ row: { type: Object, required: true } }); > - {{ t('ticketSale.claim') }}: + {{ $t('ticketSale.claim') }}: {{ row.claim?.claimFk }} diff --git a/src/components/common/VnAccountNumber.vue b/src/components/common/VnAccountNumber.vue index c4fa78674..56add7329 100644 --- a/src/components/common/VnAccountNumber.vue +++ b/src/components/common/VnAccountNumber.vue @@ -1,12 +1,9 @@ - - + diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index aeb4a31fd..9e13f5351 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -83,7 +83,7 @@ const mixinRules = [ requiredFieldRule, ...($attrs.rules ?? []), (val) => { - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; if (maxlength && +val.length > maxlength) return t(`maxLength`, { value: maxlength }); const { min, max } = vnInputRef.value.$attrs; @@ -108,7 +108,7 @@ const handleInsertMode = (e) => { e.preventDefault(); const input = e.target; const cursorPos = input.selectionStart; - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; let currentValue = value.value; if (!currentValue) currentValue = e.key; const newValue = e.key; @@ -143,7 +143,7 @@ const handleUppercase = () => { :rules="mixinRules" :lazy-rules="true" hide-bottom-space - :data-cy="$attrs.dataCy ?? $attrs.label + '_input'" + :data-cy="$attrs['data-cy'] ?? $attrs.label + '_input'" > diff --git a/src/components/ui/CatalogItem.vue b/src/components/ui/CatalogItem.vue index 7806562b2..0ae890e37 100644 --- a/src/components/ui/CatalogItem.vue +++ b/src/components/ui/CatalogItem.vue @@ -132,7 +132,8 @@ const card = toRef(props, 'item'); display: flex; flex-direction: column; gap: 4px; - + white-space: nowrap; + width: 192px; p { margin-bottom: 0; } diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 013569064..5f532d41c 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -370,6 +370,7 @@ globals: countryFk: Country countryCodeFk: Country companyFk: Company + nickname: Alias model: Model fuel: Fuel active: Active diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 24e57e1bd..f30665642 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -371,6 +371,7 @@ globals: countryFk: País countryCodeFk: País companyFk: Empresa + nickname: Alias errors: statusUnauthorized: Acceso denegado statusInternalServerError: Ha ocurrido un error interno del servidor diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index d4acc9bbe..4ced7e862 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}`" /> diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 89f9d9449..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') }} + { {{ t('unpaidDated', { - dated: toDate(customer.unpaid?.dated), + dated: toDate(entity.unpaid?.dated), }) }} {{ t('unpaidAmount', { - amount: toCurrency(customer.unpaid?.amount), + amount: toCurrency(entity.unpaid?.amount), }) }} diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index 4e0c21100..651121de8 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -1,14 +1,17 @@ @@ -37,48 +87,75 @@ function navigate(id) { - - - - - - - - - - - - - - - - - - - - - {{ $t('shelving.list.newShelving') }} - - - - + + + + + + + + + + + es: + shelving: + list: + parking: Estacionamiento + priority: Prioridad + + summary: + recyclable: Reciclable + en: + shelving: + list: + parking: Parking + priority: Priority + + summary: + recyclable: Recyclable + diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue index ecee5b76b..4293bd41a 100644 --- a/src/pages/Supplier/Card/SupplierFiscalData.vue +++ b/src/pages/Supplier/Card/SupplierFiscalData.vue @@ -108,7 +108,6 @@ function handleLocation(data, location) { diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue index c9625518f..d1d437a19 100644 --- a/src/pages/Supplier/SupplierList.vue +++ b/src/pages/Supplier/SupplierList.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import VnTable from 'components/VnTable/VnTable.vue'; import VnSection from 'src/components/common/VnSection.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'src/components/FetchData.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import SupplierSummary from './Card/SupplierSummary.vue'; @@ -53,7 +52,7 @@ const columns = computed(() => [ label: t('globals.alias'), name: 'alias', columnFilter: { - name: 'search', + name: 'nickname', }, cardVisible: true, }, @@ -120,6 +119,21 @@ const columns = computed(() => [ ], }, ]); + +const filterColumns = computed(() => { + const copy = [...columns.value]; + copy.splice(copy.length - 1, 0, { + align: 'left', + label: t('globals.params.provinceFk'), + name: 'provinceFk', + options: provincesOptions.value, + columnFilter: { + component: 'select', + }, + }); + + return copy; +}); [ /> - - diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index 456a151a3..cc16af72c 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -681,6 +681,17 @@ watch( :disabled-attr="isTicketEditable" > + + + {{ `saleGroup: ${row.saleGroupFk}` }} + + 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/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index c3522cbfe..592642f4d 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', () => { + const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'; 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,33 +24,23 @@ 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.dataCy('file-1').click(); + cy.get(carrouselClose).click(); - cy.get('.q-carousel__control > button').click(); - - cy.get( - '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', - ).click(); - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'not.be.visible', - ); + cy.dataCy('file-1').click(); + cy.get('.q-carousel__control > button').as('nextButton').click(); + cy.get('.q-carousel__slide > .q-ma-none').should('be.visible'); + cy.get(carrouselClose).click(); }); 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(); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index 29d841acc..8370ac6fd 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -17,7 +17,6 @@ describe('InvoiceOut summary', () => { cy.login('developer'); cy.visit(`/#/invoice-out/1/summary`); }); - it('open the descriptors', () => { cy.get(firstRowDescriptors(1)).click(); cy.get('.descriptor').should('be.visible'); @@ -33,9 +32,8 @@ describe('InvoiceOut summary', () => { cy.get('.q-item > .q-item__label').should('include.text', '1101'); }); - it.skip('should open the ticket list', () => { + it('should open the ticket list', () => { cy.get(toTicketList).click(); - cy.get('.descriptor').should('be.visible'); cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111'); }); diff --git a/test/cypress/integration/shelving/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js index ecee8aab7..ca1877621 100644 --- a/test/cypress/integration/shelving/parking/parkingList.spec.js +++ b/test/cypress/integration/shelving/parking/parkingList.spec.js @@ -1,7 +1,7 @@ /// describe('ParkingList', () => { const searchbar = '#searchbar input'; - const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; + const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; const summaryHeader = '.summaryBody .header'; beforeEach(() => { diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js new file mode 100644 index 000000000..d7b0dc692 --- /dev/null +++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js @@ -0,0 +1,24 @@ +/// +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 give an error if the code aldready exists', () => { + 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().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 new file mode 100644 index 000000000..745dd1b78 --- /dev/null +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -0,0 +1,41 @@ +/// +describe('ShelvingList', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/list`); + }); + + it('should redirect on clicking a shelving', () => { + 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.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'); + 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/); + }); +}); diff --git a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js index 63ab646fe..0dc12205b 100644 --- a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js +++ b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js @@ -1,35 +1,50 @@ -describe('VnInput Component', () => { +describe('VnAccountNumber', () => { beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); cy.visit('/#/supplier/1/fiscal-data'); }); - it('should replace character at cursor position in insert mode', () => { - // Simula escribir en el input - cy.dataCy('supplierFiscalDataAccount').clear(); - cy.dataCy('supplierFiscalDataAccount').type('4100000001'); - // Coloca el cursor en la posición 0 - cy.dataCy('supplierFiscalDataAccount').type('{movetostart}'); - // Escribe un número y verifica que se reemplace correctamente - cy.dataCy('supplierFiscalDataAccount').type('999'); - cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001'); + describe('VnInput handleInsertMode()', () => { + it('should replace character at cursor position in insert mode', () => { + cy.get('input[data-cy="supplierFiscalDataAccount"]').type( + '{selectall}4100000001', + ); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').should( + 'have.value', + '9990000001', + ); + }); + + it('should replace character at cursor position in insert mode', () => { + cy.get('input[data-cy="supplierFiscalDataAccount"]').clear(); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('4100000001'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('{movetostart}'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('999'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').should( + 'have.value', + '9990000001', + ); + }); + + it('should respect maxlength prop', () => { + cy.get('input[data-cy="supplierFiscalDataAccount"]').clear(); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123456789012345'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').should( + 'have.value', + '1234567890', + ); + }); }); - it('should replace character at cursor position in insert mode', () => { - // Simula escribir en el input - cy.dataCy('supplierFiscalDataAccount').clear(); - cy.dataCy('supplierFiscalDataAccount').type('4100000001'); - // Coloca el cursor en la posición 0 - cy.dataCy('supplierFiscalDataAccount').type('{movetostart}'); - // Escribe un número y verifica que se reemplace correctamente en la posicion incial - cy.dataCy('supplierFiscalDataAccount').type('999'); - cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001'); - }); - - it('should respect maxlength prop', () => { - cy.dataCy('supplierFiscalDataAccount').clear(); - cy.dataCy('supplierFiscalDataAccount').type('123456789012345'); - cy.dataCy('supplierFiscalDataAccount').should('have.value', '1234567890'); // asumiendo que maxlength es 10 + it('should convert short account number to standard format', () => { + cy.get('input[data-cy="supplierFiscalDataAccount"]').clear(); + cy.get('input[data-cy="supplierFiscalDataAccount"]').type('123.'); + cy.get('input[data-cy="supplierFiscalDataAccount"]').should( + 'have.value', + '1230000000', + ); }); });