diff --git a/Jenkinsfile b/Jenkinsfile
index 341fffefa..c5424ee27 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -12,18 +12,18 @@ def BRANCH_ENV = [
node {
stage('Setup') {
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
-
PROTECTED_BRANCH = [
'dev',
'test',
'master',
'main',
'beta'
- ].contains(env.BRANCH_NAME)
+ ]
+ IS_PROTECTED_BRANCH = PROTECTED_BRANCH.contains(env.BRANCH_NAME)
IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME)
- // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
+ // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
echo "NODE_NAME: ${env.NODE_NAME}"
echo "WORKSPACE: ${env.WORKSPACE}"
@@ -36,7 +36,7 @@ node {
props.each {key, value -> echo "${key}: ${value}" }
}
- if (PROTECTED_BRANCH) {
+ if (IS_PROTECTED_BRANCH) {
configFileProvider([
configFile(fileId: "salix-front.branch.${env.BRANCH_NAME}",
variable: 'BRANCH_PROPS_FILE')
@@ -63,7 +63,7 @@ pipeline {
stages {
stage('Version') {
when {
- expression { PROTECTED_BRANCH }
+ expression { IS_PROTECTED_BRANCH }
}
steps {
script {
@@ -84,7 +84,7 @@ pipeline {
}
stage('Test') {
when {
- expression { !PROTECTED_BRANCH }
+ expression { !IS_PROTECTED_BRANCH }
}
environment {
NODE_ENV = ''
@@ -113,10 +113,11 @@ pipeline {
}
steps {
script {
+ env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
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'
+ sh 'cypress run --browser chromium || true'
}
}
}
@@ -124,7 +125,7 @@ pipeline {
always {
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
junit(
- testResults: 'junit/e2e.xml',
+ testResults: 'junit/e2e-*.xml',
allowEmptyResults: true
)
}
@@ -134,10 +135,9 @@ pipeline {
}
stage('Build') {
when {
- expression { PROTECTED_BRANCH }
+ expression { IS_PROTECTED_BRANCH }
}
environment {
- CREDENTIALS = credentials('docker-registry')
VERSION = readFile 'VERSION.txt'
}
steps {
@@ -156,7 +156,7 @@ pipeline {
}
stage('Deploy') {
when {
- expression { PROTECTED_BRANCH }
+ expression { IS_PROTECTED_BRANCH }
}
environment {
VERSION = readFile 'VERSION.txt'
diff --git a/cypress.config.js b/cypress.config.js
index dfe963a12..5cf075e2a 100644
--- a/cypress.config.js
+++ b/cypress.config.js
@@ -6,7 +6,7 @@ if (process.env.CI) {
urlHost = 'front';
reporter = 'junit';
reporterOptions = {
- mochaFile: 'junit/e2e.xml',
+ mochaFile: 'junit/e2e-[hash].xml',
toConsole: false,
};
} else {
diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue
index c1e541abb..d768c0256 100644
--- a/src/components/VnTable/VnTable.vue
+++ b/src/components/VnTable/VnTable.vue
@@ -310,8 +310,14 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
if (evt?.shiftKey && added) {
const rowIndex = selectedRows[0].$index;
const selectedIndexes = new Set(selected.value.map((row) => row.$index));
- for (const row of rows) {
- if (row.$index == rowIndex) break;
+ const minIndex = selectedIndexes.size
+ ? Math.min(...selectedIndexes, rowIndex)
+ : 0;
+ const maxIndex = Math.max(...selectedIndexes, rowIndex);
+
+ for (let i = minIndex; i <= maxIndex; i++) {
+ const row = rows[i];
+ if (row.$index == rowIndex) continue;
if (!selectedIndexes.has(row.$index)) {
selected.value.push(row);
selectedIndexes.add(row.$index);
diff --git a/src/components/VnTable/__tests__/VnTable.spec.js b/src/components/VnTable/__tests__/VnTable.spec.js
index 74ba06987..e5e38a63c 100644
--- a/src/components/VnTable/__tests__/VnTable.spec.js
+++ b/src/components/VnTable/__tests__/VnTable.spec.js
@@ -27,30 +27,58 @@ describe('VnTable', () => {
beforeEach(() => (vm.selected = []));
describe('handleSelection()', () => {
- const rows = [{ $index: 0 }, { $index: 1 }, { $index: 2 }];
- const selectedRows = [{ $index: 1 }];
- it('should add rows to selected when shift key is pressed and rows are added except last one', () => {
+ const rows = [
+ { $index: 0 },
+ { $index: 1 },
+ { $index: 2 },
+ { $index: 3 },
+ { $index: 4 },
+ ];
+
+ it('should add rows to selected when shift key is pressed and rows are added in ascending order', () => {
+ const selectedRows = [{ $index: 1 }];
vm.handleSelection(
{ evt: { shiftKey: true }, added: true, rows: selectedRows },
- rows
+ rows,
);
expect(vm.selected).toEqual([{ $index: 0 }]);
});
+ it('should add rows to selected when shift key is pressed and rows are added in descending order', () => {
+ const selectedRows = [{ $index: 3 }];
+ vm.handleSelection(
+ { evt: { shiftKey: true }, added: true, rows: selectedRows },
+ rows,
+ );
+ expect(vm.selected).toEqual([{ $index: 0 }, { $index: 1 }, { $index: 2 }]);
+ });
+
it('should not add rows to selected when shift key is not pressed', () => {
+ const selectedRows = [{ $index: 1 }];
vm.handleSelection(
{ evt: { shiftKey: false }, added: true, rows: selectedRows },
- rows
+ rows,
);
expect(vm.selected).toEqual([]);
});
it('should not add rows to selected when rows are not added', () => {
+ const selectedRows = [{ $index: 1 }];
vm.handleSelection(
{ evt: { shiftKey: true }, added: false, rows: selectedRows },
- rows
+ rows,
);
expect(vm.selected).toEqual([]);
});
+
+ it('should add all rows between the smallest and largest selected indexes', () => {
+ vm.selected = [{ $index: 1 }, { $index: 3 }];
+ const selectedRows = [{ $index: 4 }];
+ vm.handleSelection(
+ { evt: { shiftKey: true }, added: true, rows: selectedRows },
+ rows,
+ );
+ expect(vm.selected).toEqual([{ $index: 1 }, { $index: 3 }, { $index: 2 }]);
+ });
});
});
diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue
index 1d71a6966..fa733baa5 100644
--- a/src/components/ui/CardDescriptor.vue
+++ b/src/components/ui/CardDescriptor.vue
@@ -230,7 +230,7 @@ const toModule = computed(
-
+
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index 30e4135e2..8607d9694 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -204,8 +204,9 @@ async function search() {
}
:deep(.q-field--focused) {
- .q-icon {
- color: black;
+ .q-icon,
+ .q-placeholder {
+ color: var(--vn-black-text-color);
}
}
diff --git a/src/pages/Entry/EntryBuysTableDialog.vue b/src/pages/Entry/EntryBuysTableDialog.vue
index 86a9b018f..7a6c4ac43 100644
--- a/src/pages/Entry/EntryBuysTableDialog.vue
+++ b/src/pages/Entry/EntryBuysTableDialog.vue
@@ -65,7 +65,7 @@ const entriesTableColumns = computed(() => [
]);
function downloadCSV(rows) {
- const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'comment'];
+ const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'grouping', 'comment'];
const csvRows = rows.map((row) => {
const buy = row;
@@ -77,6 +77,7 @@ function downloadCSV(rows) {
item.name || '',
buy.stickers,
buy.packing,
+ buy.grouping,
item.comment || '',
].join(',');
});
diff --git a/src/pages/InvoiceOut/locale/en.yml b/src/pages/InvoiceOut/locale/en.yml
index f1baef432..17d198351 100644
--- a/src/pages/InvoiceOut/locale/en.yml
+++ b/src/pages/InvoiceOut/locale/en.yml
@@ -2,6 +2,7 @@ invoiceOut:
search: Search invoice
searchInfo: You can search by invoice reference
params:
+ id: ID
company: Company
country: Country
clientId: Client
diff --git a/src/pages/InvoiceOut/locale/es.yml b/src/pages/InvoiceOut/locale/es.yml
index afca27871..3df95d6b2 100644
--- a/src/pages/InvoiceOut/locale/es.yml
+++ b/src/pages/InvoiceOut/locale/es.yml
@@ -2,6 +2,7 @@ invoiceOut:
search: Buscar factura emitida
searchInfo: Puedes buscar por referencia de la factura
params:
+ id: ID
company: Empresa
country: País
clientId: Cliente
diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue
index a4c58ef4b..84e07a293 100644
--- a/src/pages/Item/Card/ItemDescriptor.vue
+++ b/src/pages/Item/Card/ItemDescriptor.vue
@@ -120,22 +120,9 @@ const updateStock = async () => {
-
-
-
-
+
+
+
diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue
index e88133ff1..456a151a3 100644
--- a/src/pages/Ticket/Card/TicketSale.vue
+++ b/src/pages/Ticket/Card/TicketSale.vue
@@ -203,7 +203,7 @@ const updateQuantity = async (sale) => {
sale.isNew = false;
await axios.post(`Sales/${id}/updateQuantity`, { quantity });
notify('globals.dataSaved', 'positive');
- tableRef.value.reload();
+ resetChanges();
} catch (e) {
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
(s) => s.id === sale.id,
@@ -247,7 +247,7 @@ const updateConcept = async (sale) => {
const data = { newConcept: sale.concept };
await axios.post(`Sales/${sale.id}/updateConcept`, data);
notify('globals.dataSaved', 'positive');
- tableRef.value.reload();
+ resetChanges();
};
const DEFAULT_EDIT = {
@@ -298,7 +298,7 @@ const updatePrice = async (sale, newPrice) => {
sale.price = newPrice;
edit.value = { ...DEFAULT_EDIT };
notify('globals.dataSaved', 'positive');
- tableRef.value.reload();
+ resetChanges();
};
const changeDiscount = async (sale) => {
@@ -330,7 +330,7 @@ const updateDiscount = async (sales, newDiscount = null) => {
};
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
notify('globals.dataSaved', 'positive');
- tableRef.value.reload();
+ resetChanges();
};
const getNewPrice = computed(() => {
@@ -398,7 +398,7 @@ const removeSales = async () => {
await axios.post('Sales/deleteSales', params);
removeSelectedSales();
notify('globals.dataSaved', 'positive');
- window.location.reload();
+ resetChanges();
};
const setTransferParams = async () => {
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 78bebc297..60e80a6be 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -251,7 +251,7 @@ const fetchAvailableAgencies = async (formData) => {
const { options, agency } = response;
if (options) agenciesOptions.value = options;
- if (agency) formData.agencyModeId = agency;
+ if (agency) formData.agencyModeId = agency.agencyModeFk;
};
const fetchClient = async (formData) => {
diff --git a/src/pages/Worker/WorkerDepartment.vue b/src/pages/Worker/WorkerDepartment.vue
index baf6db154..e1411250b 100644
--- a/src/pages/Worker/WorkerDepartment.vue
+++ b/src/pages/Worker/WorkerDepartment.vue
@@ -1,16 +1,9 @@
-
-
-
-
-
-
-
+
diff --git a/test/cypress/docker-compose.yml b/test/cypress/docker-compose.yml
index 9d51ee345..8d70c5248 100644
--- a/test/cypress/docker-compose.yml
+++ b/test/cypress/docker-compose.yml
@@ -1,7 +1,7 @@
version: '3.7'
services:
back:
- image: registry.verdnatura.es/salix-back:dev
+ image: 'registry.verdnatura.es/salix-back:${COMPOSE_TAG:-dev}'
volumes:
- ./test/cypress/storage:/salix/storage
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
@@ -18,4 +18,4 @@ services:
- TZ
dns_search: .
db:
- image: registry.verdnatura.es/salix-db:dev
+ image: 'registry.verdnatura.es/salix-db:${COMPOSE_TAG:-dev}'
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index df9d09a49..7ca6472af 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -35,8 +35,7 @@ describe('ClaimDevelopment', () => {
cy.saveCard();
});
- // 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/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js
index 576671a38..fa4a214a1 100644
--- a/test/cypress/integration/claim/claimNotes.spec.js
+++ b/test/cypress/integration/claim/claimNotes.spec.js
@@ -8,10 +8,7 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
- cy.get('.q-textarea')
- .should('be.visible')
- .should('not.be.disabled')
- .type(message);
+ cy.get('.q-textarea').should('not.be.disabled').type(message);
cy.get(saveBtn).click();
cy.get(firstNote).should('have.text', message);
diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js
index 2d33e66c1..c3522cbfe 100755
--- a/test/cypress/integration/claim/claimPhoto.spec.js
+++ b/test/cypress/integration/claim/claimPhoto.spec.js
@@ -25,33 +25,33 @@ 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'
+ 'be.visible',
);
cy.get('.q-carousel__control > button').click();
cy.get(
- '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
+ '.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'
+ 'not.be.visible',
);
});
it('should remove third and fourth file', () => {
cy.get(
- '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon'
+ '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
).click();
cy.get(
- '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ '.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'
+ '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
).click();
cy.get(
- '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
});
diff --git a/test/cypress/integration/client/clientAddress.spec.js b/test/cypress/integration/client/clientAddress.spec.js
index 434180047..8673c9083 100644
--- a/test/cypress/integration/client/clientAddress.spec.js
+++ b/test/cypress/integration/client/clientAddress.spec.js
@@ -4,7 +4,6 @@ describe('Client consignee', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1107/address');
- cy.domContentLoad();
});
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');
diff --git a/test/cypress/integration/client/clientFiscalData.spec.js b/test/cypress/integration/client/clientFiscalData.spec.js
index d189f896a..58d2d956f 100644
--- a/test/cypress/integration/client/clientFiscalData.spec.js
+++ b/test/cypress/integration/client/clientFiscalData.spec.js
@@ -4,7 +4,6 @@ describe('Client fiscal data', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1107/fiscal-data');
- cy.domContentLoad();
});
it('Should change required value when change customer', () => {
cy.get('.q-card').should('be.visible');
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index 7572ea417..f83d29278 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -1,7 +1,6 @@
///
-describe.skip('Client list', () => {
+describe('Client list', () => {
beforeEach(() => {
- cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/customer/list', {
timeout: 5000,
@@ -28,7 +27,7 @@ describe.skip('Client list', () => {
Email: { val: `user.test${randomInt}@cypress.com` },
'Sales person': { val: 'salesPerson', type: 'select' },
Location: { val: '46000', type: 'select' },
- 'Business type': { val: 'Otros', type: 'select' },
+ 'Business type': { val: 'others', type: 'select' },
};
cy.fillInForm(data);
@@ -37,6 +36,7 @@ describe.skip('Client list', () => {
cy.checkNotification('Data created');
cy.url().should('include', '/summary');
});
+
it('Client list search client', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
@@ -59,6 +59,7 @@ describe.skip('Client list', () => {
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
});
+
it('Client founded create order', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
index 4e2b8f9cc..d9ab3f7e7 100644
--- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
@@ -9,7 +9,7 @@ describe('InvoiceInList', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-in/list`);
- cy.get('#searchbar input').should('be.visible').type('{enter}');
+ cy.get('#searchbar input').type('{enter}');
});
it('should redirect on clicking a invoice', () => {
@@ -21,7 +21,7 @@ describe('InvoiceInList', () => {
cy.url().should('include', `/invoice-in/${id}/summary`);
});
});
- // https://redmine.verdnatura.es/issues/8420
+
it('should open the details', () => {
cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data');
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
index 7ebaf3ef3..333f7e2c4 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -1,5 +1,5 @@
///
-describe.skip('InvoiceOut summary', () => {
+describe('InvoiceOut summary', () => {
const transferInvoice = {
Client: { val: 'employee', type: 'select' },
Type: { val: 'Error in customer data', type: 'select' },
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
index edb6a63fe..2cf9c2caf 100644
--- a/test/cypress/integration/item/ItemFixedPrice.spec.js
+++ b/test/cypress/integration/item/ItemFixedPrice.spec.js
@@ -11,7 +11,7 @@ describe('Handle Items FixedPrice', () => {
cy.visit('/#/item/fixed-price', { timeout: 5000 });
cy.waitForElement('.q-table');
cy.get(
- '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon'
+ '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon',
).click();
});
it.skip('filter', function () {
@@ -38,7 +38,7 @@ describe('Handle Items FixedPrice', () => {
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click();
cy.get(
- '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
@@ -56,7 +56,7 @@ describe('Handle Items FixedPrice', () => {
cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
cy.get('#subToolbar > .q-btn--flat').click();
cy.get(
- '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
+ '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js
index 97e85a212..f0c744f21 100644
--- a/test/cypress/integration/item/itemList.spec.js
+++ b/test/cypress/integration/item/itemList.spec.js
@@ -15,6 +15,7 @@ describe('Item list', () => {
cy.get('.q-menu .q-item').contains('Anthurium').click();
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', () => {
const data = {
@@ -28,7 +29,7 @@ describe('Item list', () => {
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.get(
- ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
+ ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content',
).should('be.visible');
});
});
diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js
index cd9f288f5..3fc2842d3 100644
--- a/test/cypress/integration/ticket/ticketDescriptor.spec.js
+++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js
@@ -30,8 +30,6 @@ describe('Ticket descriptor', () => {
it('should set the weight of the ticket', () => {
cy.visit('/#/ticket/10/summary');
- cy.intercept('GET', /\/api\/Tickets\/\d/).as('ticket');
- cy.wait('@ticket');
cy.openActionsDescriptor();
cy.contains(listItem, setWeightOpt).click();
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js
index d957f2136..6d7dc6721 100644
--- a/test/cypress/integration/ticket/ticketExpedition.spec.js
+++ b/test/cypress/integration/ticket/ticketExpedition.spec.js
@@ -1,6 +1,5 @@
///
-// 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)';
diff --git a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
index 000c2151d..63ab646fe 100644
--- a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
+++ b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
@@ -3,7 +3,6 @@ describe('VnInput Component', () => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/supplier/1/fiscal-data');
- cy.domContentLoad();
});
it('should replace character at cursor position in insert mode', () => {
@@ -14,8 +13,7 @@ describe('VnInput Component', () => {
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');
+ cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
});
it('should replace character at cursor position in insert mode', () => {
@@ -26,14 +24,12 @@ describe('VnInput Component', () => {
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');
+ 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
+ cy.dataCy('supplierFiscalDataAccount').should('have.value', '1234567890'); // asumiendo que maxlength es 10
});
});
diff --git a/test/cypress/integration/vnComponent/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js
index 292b2a395..986cbcaaf 100644
--- a/test/cypress/integration/vnComponent/VnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/VnLocation.spec.js
@@ -17,7 +17,6 @@ describe('VnLocation', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
- cy.domContentLoad();
cy.get(createLocationButton).click();
});
it('should filter provinces based on selected country', () => {
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index ce3723e54..4e78e57de 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -18,6 +18,6 @@ describe('WagonCreate', () => {
).type('100');
cy.dataCy('Type_select').type('{downarrow}{enter}');
- cy.get('[title="Remove"] > .q-btn__content > .q-icon').click();
+ cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
index 70ded3f79..6db39b072 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -9,13 +9,7 @@ describe('ZoneBasicData', () => {
});
it('should throw an error if the name is empty', () => {
- cy.intercept('GET', /\/api\/Zones\/4./).as('zone');
-
- cy.wait('@zone').then(() => {
- cy.get('[data-cy="zone-basic-data-name"] input').type(
- '{selectall}{backspace}',
- );
- });
+ cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get(saveBtn).click();
cy.checkNotification("can't be blank");
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 6b6ebd426..096a29dc1 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -33,7 +33,8 @@ Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, waitUntil);
Cypress.Commands.add('resetDB', () => {
cy.exec('pnpm run resetDatabase');
});
-Cypress.Commands.add('login', (user) => {
+
+Cypress.Commands.add('login', (user = 'developer') => {
//cy.visit('/#/login');
cy.request({
method: 'POST',
@@ -56,9 +57,12 @@ Cypress.Commands.add('login', (user) => {
});
});
-Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
+Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
+ originalFn(url, options);
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
+ cy.waitUntil(() => cy.get('main').should('exist'));
});
+
Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
});
@@ -329,8 +333,13 @@ Cypress.Commands.add('openUserPanel', () => {
Cypress.Commands.add('checkNotification', (text) => {
cy.get('.q-notification', { timeout: 10000 })
.should('be.visible')
- .filter((_, el) => Cypress.$(el).text().includes(text))
- .should('have.length.greaterThan', 0);
+ .should('have.length.greaterThan', 0)
+ .should(($elements) => {
+ const found = $elements
+ .toArray()
+ .some((el) => Cypress.$(el).text().includes(text));
+ expect(found).to.be.true;
+ });
});
Cypress.Commands.add('openActions', (row) => {
@@ -376,7 +385,13 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
}
});
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
- cy.get(`.q-icon.${iconClass}`).parent().click();
+ cy.waitForElement('[data-cy="descriptor_actions"]');
+ cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
+ cy.get('.q-btn')
+ .filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
+ .then(($btn) => {
+ cy.wrap($btn).click();
+ });
});
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
cy.get('.q-btn').contains(buttonText).click();