{
}
});
cy.get(
- '[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
+ '[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control',
).type('{enter}');
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
cy.dataCy('catalogFilterValueDialogBtn').last().click();
diff --git a/test/cypress/integration/claim/claimAction.spec.js b/test/cypress/integration/claim/claimAction.spec.js
index 685e120ce..e98be85fc 100644
--- a/test/cypress/integration/claim/claimAction.spec.js
+++ b/test/cypress/integration/claim/claimAction.spec.js
@@ -24,9 +24,9 @@ describe('ClaimAction', () => {
const rowData = [true];
cy.fillRow(firstRow, rowData);
- cy.get('[title="Change destination"]').click();
+ cy.get('[title="Change destination"]').click({ force: true });
cy.selectOption(destinationRow, 'Confeccion');
- cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
+ cy.get('.q-card > .q-card__actions > .q-btn--standard').click({ force: true });
});
it('should regularize', () => {
diff --git a/test/cypress/integration/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js
index d7a918db1..576671a38 100644
--- a/test/cypress/integration/claim/claimNotes.spec.js
+++ b/test/cypress/integration/claim/claimNotes.spec.js
@@ -8,7 +8,11 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
- cy.get('.q-textarea').type(message);
+ cy.get('.q-textarea')
+ .should('be.visible')
+ .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 0a7320060..2d33e66c1 100755
--- a/test/cypress/integration/claim/claimPhoto.spec.js
+++ b/test/cypress/integration/claim/claimPhoto.spec.js
@@ -23,14 +23,12 @@ describe.skip('ClaimPhoto', () => {
});
it('should open first image dialog change to second and close', () => {
- cy.get(
- ':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
- ).click();
+ 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 > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get('.q-carousel__control > button').click();
cy.get(
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
@@ -42,7 +40,7 @@ describe.skip('ClaimPhoto', () => {
it('should remove third and fourth file', () => {
cy.get(
- '.multimediaParent > :nth-child(3) > .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'
@@ -50,7 +48,7 @@ describe.skip('ClaimPhoto', () => {
cy.get('.q-notification__message').should('have.text', 'Data deleted');
cy.get(
- '.multimediaParent > :nth-child(3) > .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'
diff --git a/test/cypress/integration/client/clientBasicData.spec.js b/test/cypress/integration/client/clientBasicData.spec.js
index bed28dc22..8e0f0f6bd 100644
--- a/test/cypress/integration/client/clientBasicData.spec.js
+++ b/test/cypress/integration/client/clientBasicData.spec.js
@@ -8,7 +8,7 @@ describe('Client basic data', () => {
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');
cy.dataCy('customerPhone').find('input').should('be.visible');
- cy.dataCy('customerPhone').find('input').type('123456789');
+ cy.dataCy('customerPhone').find('input').clear().type('123456789');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
const { body } = req;
diff --git a/test/cypress/integration/entry/entryList.spec.js b/test/cypress/integration/entry/entryList.spec.js
index 4f99f0cb6..3ed686cae 100644
--- a/test/cypress/integration/entry/entryList.spec.js
+++ b/test/cypress/integration/entry/entryList.spec.js
@@ -20,7 +20,7 @@ describe('Entry', () => {
);
});
- it('Create entry, modify travel and add buys', () => {
+ it.skip('Create entry, modify travel and add buys', () => {
createEntryAndBuy();
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
selectTravel('two');
diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js
index bc36156b4..b282a19a5 100644
--- a/test/cypress/integration/entry/stockBought.spec.js
+++ b/test/cypress/integration/entry/stockBought.spec.js
@@ -9,7 +9,7 @@ describe('EntryStockBought', () => {
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
cy.get('input[name="reserve"]').type('10{enter}');
cy.get('button[title="Save"]').click();
- cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.checkNotification('Data saved');
});
it('Should add a new reserved space for buyerBoss', () => {
cy.addBtnClick();
diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
index 82f0fa3b6..d3a84d226 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
@@ -1,6 +1,16 @@
///
describe('InvoiceOut list', () => {
const serial = 'Española rapida';
+ const columnCheckbox =
+ '.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner';
+ const firstRowDescriptor =
+ 'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link';
+ const firstRowCheckbox =
+ 'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner ';
+ const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon';
+ const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
+ const firstSummaryIcon =
+ ':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon';
beforeEach(() => {
cy.viewport(1920, 1080);
@@ -9,18 +19,32 @@ describe('InvoiceOut list', () => {
cy.typeSearchbar('{enter}');
});
- it('should search and filter an invoice and enter to the summary', () => {
- cy.typeSearchbar('1{enter}');
- cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
- cy.get('.header > a.q-btn > .q-btn__content').click();
- cy.typeSearchbar('{enter}');
- cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
+ it('should download one pdf from the subtoolbar button', () => {
+ cy.get(firstRowCheckbox).click();
+ cy.dataCy('InvoiceOutDownloadPdfBtn').click();
});
it('should download all pdfs', () => {
- cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
+ cy.get(columnCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
- cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
+ });
+
+ it('should open the invoice descriptor from table icon', () => {
+ cy.get(firstSummaryIcon).click();
+ cy.get('.cardSummary').should('be.visible');
+ cy.get('.summaryHeader > div').should('include.text', 'A1111111');
+ });
+
+ it('should open the client descriptor', () => {
+ cy.get(firstRowDescriptor).click();
+ cy.get(summaryPopupIcon).click();
+ });
+
+ it('should filter the results by client ID, then check the first result is correct', () => {
+ cy.dataCy('Customer ID_input').type('1103');
+ cy.get(filterBtn).click();
+ cy.get(firstRowDescriptor).click();
+ cy.get('.q-item > .q-item__label').should('include.text', '1103');
});
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
@@ -31,11 +55,14 @@ describe('InvoiceOut list', () => {
cy.checkNotification('This ticket is already invoiced');
});
- it('should create a manual invoice and enter to its summary', () => {
+ it('should create a manual invoice and enter to its summary, then delete that invoice', () => {
cy.dataCy('vnTableCreateBtn').click();
- cy.dataCy('InvoiceOutCreateTicketinput').type(8);
+ cy.dataCy('InvoiceOutCreateTicketinput').type(9);
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(4)').click();
+ cy.dataCy('VnConfirm_confirm').click();
});
});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
index 02b7fbb43..4d530de05 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
@@ -1,11 +1,26 @@
///
describe('InvoiceOut negative bases', () => {
+ const getDescriptors = (opt) =>
+ `:nth-child(1) > [data-col-field="${opt}"] > .no-padding > .link`;
+
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-out/negative-bases`);
});
+ it('should open the posible descriptors', () => {
+ cy.get(getDescriptors('clientId')).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '1101');
+ cy.get(getDescriptors('ticketFk')).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '23');
+ cy.get(getDescriptors('workerName')).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '18');
+ });
+
it('should filter and download as CSV', () => {
cy.get('input[name="ticketFk"]').type('23{enter}');
cy.get('#subToolbar > .q-btn').click();
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
index 44b0a9961..7ebaf3ef3 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -1,44 +1,95 @@
///
-describe('InvoiceOut summary', () => {
+describe.skip('InvoiceOut summary', () => {
const transferInvoice = {
Client: { val: 'employee', type: 'select' },
Type: { val: 'Error in customer data', type: 'select' },
};
+ const firstRowDescriptors = (opt) =>
+ `tbody > :nth-child(1) > :nth-child(${opt}) > .q-btn`;
+ const toCustomerSummary = '[href="#/customer/1101"]';
+ const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]';
+ const selectMenuOption = (opt) => `.q-menu > .q-list > :nth-child(${opt})`;
+ const confirmSend = '.q-btn--unelevated';
+
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/invoice-out/list`);
+ cy.visit(`/#/invoice-out/1/summary`);
});
- it('should generate the invoice PDF', () => {
- cy.typeSearchbar('T1111111{enter}');
- cy.dataCy('descriptor-more-opts').click();
- cy.get('.q-menu > .q-list > :nth-child(6)').click();
- cy.dataCy('VnConfirm_confirm').click();
- cy.checkNotification('The invoice PDF document has been regenerated');
+ it('open the descriptors', () => {
+ cy.get(firstRowDescriptors(1)).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '1');
+ cy.get(firstRowDescriptors(2)).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
- it('should refund the invoice ', () => {
+
+ it('should open the client summary and the ticket list', () => {
+ cy.get(toCustomerSummary).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '1101');
+ });
+
+ it('should open the ticket list', () => {
+ cy.get(toTicketList).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
+ });
+
+ it('should transfer the invoice ', () => {
cy.typeSearchbar('T1111111{enter}');
cy.dataCy('descriptor-more-opts').click();
- cy.get('.q-menu > .q-list > :nth-child(7)').click();
- cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
- cy.checkNotification('The following refund ticket have been created');
+ cy.get(selectMenuOption(1)).click();
+ cy.fillInForm(transferInvoice);
+ cy.get('.q-mt-lg > .q-btn').click();
+ cy.checkNotification('Transferred invoice');
+ });
+
+ it('should send the invoice as PDF', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(selectMenuOption(3)).click();
+ cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
+ cy.get(confirmSend).click();
+ cy.checkNotification('Notification sent');
+ });
+
+ it('should send the invoice as CSV', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(selectMenuOption(3)).click();
+ cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
+ cy.get(confirmSend).click();
+ cy.checkNotification('Notification sent');
});
it('should delete an invoice ', () => {
cy.typeSearchbar('T2222222{enter}');
cy.dataCy('descriptor-more-opts').click();
- cy.get('.q-menu > .q-list > :nth-child(4)').click();
+ cy.get(selectMenuOption(4)).click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('InvoiceOut deleted');
});
- it('should transfer the invoice ', () => {
- cy.typeSearchbar('T1111111{enter}');
+
+ it('should book the invoice', () => {
cy.dataCy('descriptor-more-opts').click();
- cy.get('.q-menu > .q-list > :nth-child(1)').click();
- cy.fillInForm(transferInvoice);
- cy.get('.q-mt-lg > .q-btn').click();
- cy.checkNotification('Transferred invoice');
+ cy.get(selectMenuOption(5)).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('InvoiceOut booked');
+ });
+
+ it('should generate the invoice PDF', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(selectMenuOption(6)).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('The invoice PDF document has been regenerated');
+ });
+
+ it('should refund the invoice ', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get(selectMenuOption(7)).click();
+ cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
+ cy.checkNotification('The following refund ticket have been created');
});
});
diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js
index d1596f693..d7a9ea4b3 100644
--- a/test/cypress/integration/item/itemTag.spec.js
+++ b/test/cypress/integration/item/itemTag.spec.js
@@ -4,25 +4,21 @@ describe('Item tag', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/tags`);
+ cy.get('.q-page').should('be.visible');
+ cy.waitForElement('[data-cy="itemTags"]');
});
it('should throw an error adding an existent tag', () => {
- cy.get('.q-page').should('be.visible');
cy.get('.q-page-sticky > div').click();
- cy.get('.q-page-sticky > div').click();
- cy.dataCy('Tag_select').eq(7).type('Tallos');
- cy.get('.q-menu .q-item').contains('Tallos').click();
+ cy.selectOption(':nth-child(8) > .q-select', 'Tallos');
cy.get(':nth-child(8) > [label="Value"]').type('1');
cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification("The tag or priority can't be repeated for an item");
});
it('should add a new tag', () => {
- cy.get('.q-page').should('be.visible');
cy.get('.q-page-sticky > div').click();
- cy.get('.q-page-sticky > div').click();
- cy.dataCy('Tag_select').eq(7).click();
- cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
+ cy.selectOption(':nth-child(8) > .q-select', 'Ancho de la base');
cy.get(':nth-child(8) > [label="Value"]').type('50');
cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification('Data saved');
diff --git a/test/cypress/integration/outLogin/recoverPassword.spec.js b/test/cypress/integration/outLogin/recoverPassword.spec.js
index eec81b661..48f6f8563 100755
--- a/test/cypress/integration/outLogin/recoverPassword.spec.js
+++ b/test/cypress/integration/outLogin/recoverPassword.spec.js
@@ -24,7 +24,7 @@ describe('Recover Password', () => {
it('should change password to user', () => {
// Get token from mail
cy.request(
- `http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
+ `/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
).then((response) => {
const regex = /access_token=([a-zA-Z0-9]+)/;
const [match] = response.body[0].body.match(regex);
diff --git a/test/cypress/integration/outLogin/twoFactor.spec.js b/test/cypress/integration/outLogin/twoFactor.spec.js
index 4d8561f0f..6a8ac9c06 100755
--- a/test/cypress/integration/outLogin/twoFactor.spec.js
+++ b/test/cypress/integration/outLogin/twoFactor.spec.js
@@ -11,7 +11,7 @@ describe('Two Factor', () => {
it('should enable two factor to sysadmin', () => {
cy.request(
'PATCH',
- `http://localhost:3000/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
+ `/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
{ twoFactor: 'email' }
);
});
@@ -41,7 +41,7 @@ describe('Two Factor', () => {
// Get code from mail
cy.request(
- `http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
+ `/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
).then((response) => {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.body[0].body;
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 82ec6626d..5679ceba1 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -1,4 +1,4 @@
-describe('AgencyWorkCenter', () => {
+describe.skip('AgencyWorkCenter', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js
new file mode 100644
index 000000000..e3505ad60
--- /dev/null
+++ b/test/cypress/integration/route/routeExtendedList.spec.js
@@ -0,0 +1,205 @@
+describe.skip('Route extended list', () => {
+ const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
+
+ const selectors = {
+ worker: getSelector('workerFk'),
+ agency: getSelector('agencyModeFk'),
+ vehicle: getSelector('vehicleFk'),
+ date: getSelector('dated'),
+ description: getSelector('description'),
+ served: getSelector('isOk'),
+ lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
+ removeBtn: '[title="Remove"]',
+ resetBtn: '[title="Reset"]',
+ confirmBtn: 'VnConfirm_confirm',
+ saveBtn: 'crudModelDefaultSaveBtn',
+ saveFormBtn: 'FormModelPopup_save',
+ cloneBtn: '#st-actions > .q-btn-group > :nth-child(1)',
+ downloadBtn: '#st-actions > .q-btn-group > :nth-child(2)',
+ markServedBtn: '#st-actions > .q-btn-group > :nth-child(3)',
+ searchbar: 'searchbar',
+ firstTicketsRowSelectCheckBox:
+ '.q-card > :nth-child(2) > .q-table__container > .q-table__middle > .q-table > tbody > :nth-child(1) > .q-table--col-auto-width > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg > .q-checkbox__svg',
+ };
+
+ const checkboxState = {
+ check: 'check',
+ uncheck: 'close',
+ };
+ const url = '/#/route/extended-list';
+ const dataCreated = 'Data created';
+ const dataSaved = 'Data saved';
+
+ const originalFields = [
+ { selector: selectors.worker, type: 'select', value: 'logistic' },
+ { selector: selectors.agency, type: 'select', value: 'Super-Man delivery' },
+ { selector: selectors.vehicle, type: 'select', value: '3333-IMK' },
+ { selector: selectors.date, type: 'date', value: '01/02/2024' },
+ { selector: selectors.description, type: 'input', value: 'Test route' },
+ { selector: selectors.served, type: 'checkbox', value: checkboxState.uncheck },
+ ];
+
+ const updateFields = [
+ { selector: selectors.worker, type: 'select', value: 'salesperson' },
+ { selector: selectors.agency, type: 'select', value: 'inhouse pickup' },
+ { selector: selectors.vehicle, type: 'select', value: '1111-IMK' },
+ { selector: selectors.date, type: 'date', value: '01/01/2001' },
+ { selector: selectors.description, type: 'input', value: 'Description updated' },
+ { selector: selectors.served, type: 'checkbox', value: checkboxState.check },
+ ];
+
+ function fillField(selector, type, value) {
+ switch (type) {
+ case 'select':
+ cy.get(selector).should('be.visible').click();
+ cy.dataCy('null_select').clear().type(value);
+ cy.get('.q-item').contains(value).click();
+ break;
+ case 'input':
+ cy.get(selector).should('be.visible').click();
+ cy.dataCy('null_input').clear().type(`${value}{enter}`);
+ break;
+ case 'date':
+ cy.get(selector).should('be.visible').click();
+ cy.dataCy('null_inputDate').clear().type(`${value}{enter}`);
+ break;
+ case 'checkbox':
+ cy.get(selector).should('be.visible').click().click();
+ break;
+ }
+ }
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(url);
+ cy.typeSearchbar('{enter}');
+ });
+
+ after(() => {
+ cy.visit(url);
+ cy.typeSearchbar('{enter}');
+ cy.get(selectors.lastRowSelectCheckBox).click();
+
+ cy.get(selectors.removeBtn).click();
+ cy.dataCy(selectors.confirmBtn).click();
+ });
+
+ it('Should list routes', () => {
+ cy.get('.q-table')
+ .children()
+ .should('be.visible')
+ .should('have.length.greaterThan', 0);
+ });
+
+ it('Should create new route', () => {
+ cy.addBtnClick();
+
+ const data = {
+ Worker: { val: 'logistic', type: 'select' },
+ Agency: { val: 'Super-Man delivery', type: 'select' },
+ Vehicle: { val: '3333-IMK', type: 'select' },
+ Date: { val: '02-01-2024', type: 'date' },
+ From: { val: '01-01-2024', type: 'date' },
+ To: { val: '10-01-2024', type: 'date' },
+ 'Km start': { val: 1000 },
+ 'Km end': { val: 1200 },
+ Description: { val: 'Test route' },
+ };
+
+ cy.fillInForm(data);
+
+ cy.dataCy(selectors.saveFormBtn).click();
+ cy.checkNotification(dataCreated);
+ cy.url().should('include', '/summary');
+ });
+
+ it('Should reset changed values when click reset button', () => {
+ updateFields.forEach(({ selector, type, value }) => {
+ fillField(selector, type, value);
+ });
+
+ cy.get('[title="Reset"]').click();
+
+ originalFields.forEach(({ selector, value }) => {
+ cy.validateContent(selector, value);
+ });
+ });
+
+ it('Should clone selected route', () => {
+ cy.get(selectors.lastRowSelectCheckBox).click();
+ cy.get(selectors.cloneBtn).click();
+ cy.dataCy('route.Starting date_inputDate').type('10-05-2001{enter}');
+ cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
+ cy.validateContent(selectors.date, '05/10/2001');
+ });
+
+ it('Should download selected route', () => {
+ const downloadsFolder = Cypress.config('downloadsFolder');
+ cy.get(selectors.lastRowSelectCheckBox).click();
+ cy.get(selectors.downloadBtn).click();
+ cy.wait(5000);
+
+ const fileName = 'download.zip';
+ cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
+
+ cy.task('deleteFile', `${downloadsFolder}/${fileName}`).then((deleted) => {
+ expect(deleted).to.be.true;
+ });
+ });
+
+ it('Should mark as served the selected route', () => {
+ cy.get(selectors.lastRowSelectCheckBox).click();
+ cy.get(selectors.markServedBtn).click();
+
+ cy.typeSearchbar('{enter}');
+ cy.validateContent(selectors.served, checkboxState.check);
+ });
+
+ it('Should delete the selected route', () => {
+ cy.get(selectors.lastRowSelectCheckBox).click();
+
+ cy.get(selectors.removeBtn).click();
+ cy.dataCy(selectors.confirmBtn).click();
+
+ cy.checkNotification(dataSaved);
+ });
+
+ it('Should save changes in route', () => {
+ updateFields.forEach(({ selector, type, value }) => {
+ fillField(selector, type, value);
+ });
+
+ cy.dataCy(selectors.saveBtn).should('not.be.disabled').click();
+ cy.checkNotification(dataSaved);
+
+ cy.typeSearchbar('{enter}');
+
+ updateFields.forEach(({ selector, value }) => {
+ cy.validateContent(selector, value);
+ });
+ });
+
+ it('Should add ticket to route', () => {
+ cy.dataCy('tableAction-0').last().click();
+ cy.get(selectors.firstTicketsRowSelectCheckBox).click();
+ cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
+ cy.checkNotification(dataSaved);
+ });
+
+ it('Should open summary pop-up when click summuary icon', () => {
+ cy.dataCy('tableAction-1').last().click();
+ cy.get('.summaryHeader > :nth-child(2').should('contain', updateFields[4].value);
+ });
+
+ it('Should redirect to the summary from the route summary pop-up', () => {
+ cy.dataCy('tableAction-1').last().click();
+ cy.get('.header > .q-icon').should('be.visible').click();
+ cy.url().should('include', '/summary');
+ });
+
+ it('Should redirect to the summary when click go to summary icon', () => {
+ cy.dataCy('tableAction-2').last().click();
+ cy.url().should('include', '/summary');
+ });
+});
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index 976ce7352..04278cfc5 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -7,7 +7,7 @@ describe('Route', () => {
it('Route list create route', () => {
cy.addBtnClick();
- cy.get('input[name="description"]').type('routeTestOne{enter}');
+ cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
});
diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js
index aed8dc85a..b59765ca6 100644
--- a/test/cypress/integration/ticket/ticketSale.spec.js
+++ b/test/cypress/integration/ticket/ticketSale.spec.js
@@ -1,122 +1,208 @@
///
describe('TicketSale', () => {
- beforeEach(() => {
- cy.login('developer');
- cy.viewport(1920, 1080);
- cy.visit('/#/ticket/31/sale');
- });
-
- const firstRow = 'tbody > :nth-child(1)';
-
- const selectFirstRow = () => {
- cy.waitForElement(firstRow);
- cy.get(firstRow).find('.q-checkbox__inner').click();
- };
-
- it('it should add item to basket', () => {
- cy.window().then((win) => {
- cy.stub(win, 'open').as('windowOpen');
+ describe.skip('Free ticket #31', () => {
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit('/#/ticket/31/sale');
});
- cy.dataCy('ticketSaleAddToBasketBtn').should('exist');
- cy.dataCy('ticketSaleAddToBasketBtn').click();
- cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/);
- });
- it('should send SMS', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.waitForElement('[data-cy="sendShortageSMSItem"]');
- cy.dataCy('sendShortageSMSItem').should('exist');
- cy.dataCy('sendShortageSMSItem').click();
- cy.dataCy('vnSmsDialog').should('exist');
- cy.dataCy('sendSmsBtn').click();
- cy.checkNotification('SMS sent');
- });
+ const firstRow = 'tbody > :nth-child(1)';
- it('should recalculate price when "Recalculate price" is clicked', () => {
- cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice');
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.waitForElement('[data-cy="recalculatePriceItem"]');
- cy.dataCy('recalculatePriceItem').should('exist');
- cy.dataCy('recalculatePriceItem').click();
- cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200);
- cy.checkNotification('Data saved');
- });
+ const selectFirstRow = () => {
+ cy.waitForElement(firstRow);
+ cy.get(firstRow).find('.q-checkbox__inner').click();
+ };
- it('should update discount when "Update discount" is clicked', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.waitForElement('[data-cy="updateDiscountItem"]');
- cy.dataCy('updateDiscountItem').should('exist');
- cy.dataCy('updateDiscountItem').click();
- cy.waitForElement('[data-cy="ticketSaleDiscountInput"]');
- cy.dataCy('ticketSaleDiscountInput').find('input').focus();
- cy.dataCy('ticketSaleDiscountInput').find('input').type('10');
- cy.dataCy('saveManaBtn').click();
- cy.waitForElement('.q-notification__message');
- cy.checkNotification('Data saved');
- });
+ it('it should add item to basket', () => {
+ cy.window().then((win) => {
+ cy.stub(win, 'open').as('windowOpen');
+ });
+ cy.dataCy('ticketSaleAddToBasketBtn').should('exist');
+ cy.dataCy('ticketSaleAddToBasketBtn').click();
+ cy.get('@windowOpen').should('be.calledWithMatch', /\/order\/\d+\/catalog/);
+ });
- it('adds claim', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.dataCy('createClaimItem').click();
- cy.dataCy('VnConfirm_confirm').click();
- cy.url().should('contain', 'claim/');
- // Delete created claim to avoid cluttering the database
- cy.dataCy('descriptor-more-opts').click();
- cy.dataCy('deleteClaim').click();
- cy.dataCy('VnConfirm_confirm').click();
- cy.checkNotification('Data deleted');
- });
+ it('should send SMS', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.waitForElement('[data-cy="sendShortageSMSItem"]');
+ cy.dataCy('sendShortageSMSItem').should('exist');
+ cy.dataCy('sendShortageSMSItem').click();
+ cy.dataCy('vnSmsDialog').should('exist');
+ cy.dataCy('sendSmsBtn').click();
+ cy.checkNotification('SMS sent');
+ });
- it('marks row as reserved', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.waitForElement('[data-cy="markAsReservedItem"]');
- cy.dataCy('markAsReservedItem').click();
- cy.dataCy('ticketSaleReservedIcon').should('exist');
- });
+ it('should recalculate price when "Recalculate price" is clicked', () => {
+ cy.intercept('POST', '**/recalculatePrice').as('recalculatePrice');
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.waitForElement('[data-cy="recalculatePriceItem"]');
+ cy.dataCy('recalculatePriceItem').should('exist');
+ cy.dataCy('recalculatePriceItem').click();
+ cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200);
+ cy.checkNotification('Data saved');
+ });
- it('unmarks row as reserved', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.waitForElement('[data-cy="unmarkAsReservedItem"]');
- cy.dataCy('unmarkAsReservedItem').click();
- cy.dataCy('ticketSaleReservedIcon').should('not.exist');
- });
+ it('should update discount when "Update discount" is clicked', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.waitForElement('[data-cy="updateDiscountItem"]');
+ cy.dataCy('updateDiscountItem').should('exist');
+ cy.dataCy('updateDiscountItem').click();
+ cy.waitForElement('[data-cy="ticketSaleDiscountInput"]');
+ cy.dataCy('ticketSaleDiscountInput').find('input').focus();
+ cy.dataCy('ticketSaleDiscountInput').find('input').type('10');
+ cy.dataCy('saveManaBtn').click();
+ cy.waitForElement('.q-notification__message');
+ cy.checkNotification('Data saved');
+ });
- it('refunds row with warehouse', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.dataCy('ticketSaleRefundItem').click();
- cy.dataCy('ticketSaleRefundWithWarehouse').click();
- cy.checkNotification('The following refund ticket have been created');
- });
+ it('adds claim', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.dataCy('createClaimItem').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.url().should('contain', 'claim/');
+ // Delete created claim to avoid cluttering the database
+ cy.dataCy('descriptor-more-opts').click();
+ cy.dataCy('deleteClaim').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('Data deleted');
+ });
- it('refunds row without warehouse', () => {
- selectFirstRow();
- cy.dataCy('ticketSaleMoreActionsDropdown').click();
- cy.dataCy('ticketSaleRefundItem').click();
- cy.dataCy('ticketSaleRefundWithoutWarehouse').click();
- cy.checkNotification('The following refund ticket have been created');
- });
+ it('marks row as reserved', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.waitForElement('[data-cy="markAsReservedItem"]');
+ cy.dataCy('markAsReservedItem').click();
+ cy.dataCy('ticketSaleReservedIcon').should('exist');
+ });
- it('transfer sale to a new ticket', () => {
- cy.visit('/#/ticket/32/sale');
- cy.get('.q-item > .q-item__label').should('have.text', ' #32');
- selectFirstRow();
- cy.dataCy('ticketSaleTransferBtn').click();
- cy.dataCy('ticketTransferPopup').should('exist');
- cy.dataCy('ticketTransferNewTicketBtn').click();
- //check the new ticket has been created succesfully
- cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
- });
+ it('unmarks row as reserved', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.waitForElement('[data-cy="unmarkAsReservedItem"]');
+ cy.dataCy('unmarkAsReservedItem').click();
+ cy.dataCy('ticketSaleReservedIcon').should('not.exist');
+ });
- it('should redirect to ticket logs', () => {
- cy.get(firstRow).find('.q-btn:last').click();
- cy.url().should('match', /\/ticket\/31\/log/);
+ it('refunds row with warehouse', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.dataCy('ticketSaleRefundItem').click();
+ cy.dataCy('ticketSaleRefundWithWarehouse').click();
+ cy.checkNotification('The following refund ticket have been created');
+ });
+
+ it('refunds row without warehouse', () => {
+ selectFirstRow();
+ cy.dataCy('ticketSaleMoreActionsDropdown').click();
+ cy.dataCy('ticketSaleRefundItem').click();
+ cy.dataCy('ticketSaleRefundWithoutWarehouse').click();
+ cy.checkNotification('The following refund ticket have been created');
+ });
+
+ it('transfer sale to a new ticket', () => {
+ cy.visit('/#/ticket/32/sale');
+ cy.get('.q-item > .q-item__label').should('have.text', ' #32');
+ selectFirstRow();
+ cy.dataCy('ticketSaleTransferBtn').click();
+ cy.dataCy('ticketTransferPopup').should('exist');
+ cy.dataCy('ticketTransferNewTicketBtn').click();
+ //check the new ticket has been created succesfully
+ cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
+ });
+
+ it('should redirect to ticket logs', () => {
+ cy.get(firstRow).find('.q-btn:last').click();
+ cy.url().should('match', /\/ticket\/31\/log/);
+ });
+ });
+ describe.skip('Ticket prepared #23', () => {
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit('/#/ticket/23/sale');
+ });
+
+ const firstRow = 'tbody > :nth-child(1)';
+
+ const selectFirstRow = () => {
+ cy.waitForElement(firstRow);
+ cy.get(firstRow).find('.q-checkbox__inner').click();
+ };
+
+ it('update price', () => {
+ const price = Number((Math.random() * 99 + 1).toFixed(2));
+ cy.waitForElement(firstRow);
+ cy.get(':nth-child(10) > .q-btn').click();
+ cy.waitForElement('[data-cy="ticketEditManaProxy"]');
+ cy.dataCy('ticketEditManaProxy').should('exist');
+ cy.waitForElement('[data-cy="Price_input"]');
+ cy.dataCy('Price_input').clear();
+ cy.dataCy('Price_input').type(price);
+ cy.dataCy('saveManaBtn').click();
+ handleVnConfirm();
+
+ cy.get(':nth-child(10) > .q-btn > .q-btn__content').should(
+ 'have.text',
+ `€${price}`,
+ );
+ });
+ it('update dicount', () => {
+ const discount = Math.floor(Math.random() * 100) + 1;
+ selectFirstRow();
+ cy.get(':nth-child(11) > .q-btn').click();
+ cy.waitForElement('[data-cy="ticketEditManaProxy"]');
+ cy.dataCy('ticketEditManaProxy').should('exist');
+ cy.waitForElement('[data-cy="Disc_input"]');
+ cy.dataCy('Disc_input').clear();
+ cy.dataCy('Disc_input').type(discount);
+ cy.dataCy('saveManaBtn').click();
+ handleVnConfirm();
+
+ cy.get(':nth-child(11) > .q-btn > .q-btn__content').should(
+ 'have.text',
+ `${discount}.00%`,
+ );
+ });
+
+ it('change concept', () => {
+ const quantity = Math.floor(Math.random() * 100) + 1;
+ cy.waitForElement(firstRow);
+ cy.get(':nth-child(8) > .row').click();
+ cy.get(
+ '.q-menu > [data-v-ca3f07a4=""] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="undefined_input"]',
+ )
+ .type(quantity)
+ .type('{enter}');
+ handleVnConfirm();
+
+ cy.get(':nth-child(8) >.row').should('contain.text', `${quantity}`);
+ });
+ it('changequantity ', () => {
+ const quantity = Math.floor(Math.random() * 100) + 1;
+ cy.waitForElement(firstRow);
+ cy.dataCy('ticketSaleQuantityInput').clear();
+ cy.dataCy('ticketSaleQuantityInput').type(quantity).trigger('tab');
+ cy.get('.q-page > :nth-child(6)').click();
+
+ handleVnConfirm();
+
+ cy.get('[data-cy="ticketSaleQuantityInput"]')
+ .find('[data-cy="undefined_input"]')
+ .should('have.value', `${quantity}`);
+ });
});
});
+
+function handleVnConfirm() {
+ cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
+ cy.waitForElement('.q-notification__message');
+
+ cy.get('.q-notification__message').should('be.visible');
+ cy.checkNotification('Data saved');
+}
diff --git a/test/cypress/integration/vnComponent/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js
index 751b3a065..292b2a395 100644
--- a/test/cypress/integration/vnComponent/VnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/VnLocation.spec.js
@@ -40,7 +40,7 @@ describe('VnLocation', () => {
cy.selectOption(countrySelector, country);
cy.dataCy('locationProvince').type(`${province}{enter}`);
cy.get(
- `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `,
).click();
cy.dataCy('locationProvince').should('have.value', province);
});
@@ -87,7 +87,7 @@ describe('VnLocation', () => {
.get(':nth-child(1)')
.should('have.length.at.least', 2);
cy.get(
- firstOption.concat(' > .q-item__section > .q-item__label--caption')
+ firstOption.concat(' > .q-item__section > .q-item__label--caption'),
).should('have.text', postCodeLabel);
cy.get(firstOption).click();
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
@@ -103,7 +103,7 @@ describe('VnLocation', () => {
cy.get('.q-card > h1').should('have.text', 'New postcode');
cy.selectOption(
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
- province
+ province,
);
cy.get(dialogInputs).eq(0).clear();
cy.get(dialogInputs).eq(0).type(postCode);
@@ -156,7 +156,7 @@ describe('VnLocation', () => {
cy.get(createLocationButton).click();
cy.selectOption(
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
- 'España'
+ 'España',
);
cy.dataCy('Province_icon').click();
diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
index 2cd43984a..49d7d9f01 100644
--- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
@@ -8,7 +8,7 @@ describe('WagonTypeCreate', () => {
it('should create a new wagon type and then delete it', () => {
cy.get('.q-page-sticky > div > .q-btn').click();
- cy.get('input').first().type('Example for testing');
+ cy.dataCy('Name_input').type('Example for testing');
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
diff --git a/test/cypress/integration/worker/workerCreate.spec.js b/test/cypress/integration/worker/workerCreate.spec.js
index 7f2810395..71fd6b347 100644
--- a/test/cypress/integration/worker/workerCreate.spec.js
+++ b/test/cypress/integration/worker/workerCreate.spec.js
@@ -2,9 +2,24 @@ describe('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)';
const developerBossId = 120;
const payMethodCross =
- '.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
+ ':nth-child(9) > .q-select > .q-field__inner > .q-field__control > :nth-child(2)';
const saveBtn = '.q-mt-lg > .q-btn--standard';
+ const internalWithOutPay = {
+ Fi: { val: '78457139E' },
+ 'Web user': { val: 'manolo' },
+ Name: { val: 'Manolo' },
+ 'Last name': { val: 'Hurtado' },
+ 'Personal email': { val: 'manolo@mydomain.com' },
+ Company: { val: 'VNL', type: 'select' },
+ Street: { val: 'S/ DEFAULTWORKERSTREET' },
+ Location: { val: 1, type: 'select' },
+ Phone: { val: '123456789' },
+ 'Worker code': { val: 'DWW' },
+ Boss: { val: developerBossId, type: 'select' },
+ Birth: { val: '11-12-2022', type: 'date' },
+ };
+
const internal = {
Fi: { val: '78457139E' },
'Web user': { val: 'manolo' },
@@ -14,6 +29,7 @@ describe('WorkerCreate', () => {
Company: { val: 'VNL', type: 'select' },
Street: { val: 'S/ DEFAULTWORKERSTREET' },
Location: { val: 1, type: 'select' },
+ 'Pay method': { val: 1, type: 'select' },
Phone: { val: '123456789' },
'Worker code': { val: 'DWW' },
Boss: { val: developerBossId, type: 'select' },
@@ -37,17 +53,14 @@ describe('WorkerCreate', () => {
});
it('should throw an error if a pay method has not been selected', () => {
- cy.fillInForm(internal);
+ cy.fillInForm(internalWithOutPay);
cy.get(payMethodCross).click();
cy.get(saveBtn).click();
cy.checkNotification('Payment method is required');
});
it('should create an internal', () => {
- cy.fillInForm({
- ...internal,
- 'Pay method': { val: 'PayMethod one', type: 'select' },
- });
+ cy.fillInForm(internal);
cy.get(saveBtn).click();
cy.checkNotification('Data created');
});
diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js
index f121b3894..0907cc4ad 100644
--- a/test/cypress/integration/worker/workerNotificationsManager.spec.js
+++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js
@@ -18,11 +18,11 @@ describe('WorkerNotificationsManager', () => {
cy.visit(`/#/worker/${salesPersonId}/notifications`);
cy.get(firstAvailableNotification).click();
cy.checkNotification(
- 'The notification subscription of this worker cant be modified'
+ 'The notification subscription of this worker cant be modified',
);
});
- it('should active a notification that is yours', () => {
+ it.skip('should active a notification that is yours', () => {
cy.login('developer');
cy.visit(`/#/worker/${developerId}/notifications`);
cy.waitForElement(activeList);
diff --git a/test/cypress/integration/worker/workerPit.spec.js b/test/cypress/integration/worker/workerPit.spec.js
index cc3a87637..19cbebc20 100644
--- a/test/cypress/integration/worker/workerPit.spec.js
+++ b/test/cypress/integration/worker/workerPit.spec.js
@@ -8,7 +8,8 @@ describe('WorkerPit', () => {
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
- const isDescendantSelect = '[data-cy="Descendant/Ascendant_select"]';
+ const isDescendantSelect = '[data-cy="Descendant/Ascendant"]';
+ const Descendant = 'Descendiente';
const birthedInput = '[data-cy="Birth Year_input"]';
const birthed = '2002';
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
@@ -28,11 +29,8 @@ describe('WorkerPit', () => {
cy.get(spouseNifInput).type(spouseNif);
cy.get(spousePensionInput).type(spousePension);
cy.get(savePIT).click();
- });
-
- it('complete relative', () => {
cy.get(addRelative).click();
- cy.get(isDescendantSelect).type('{downArrow}{downArrow}{enter}');
+ cy.get(isDescendantSelect).type(Descendant);
cy.get(birthedInput).type(birthed);
cy.get(adoptionYearInput).type(adoptionYear);
cy.get(saveRelative).click();
diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js
index 8d01d4e4e..68e924635 100644
--- a/test/cypress/integration/zone/zoneList.spec.js
+++ b/test/cypress/integration/zone/zoneList.spec.js
@@ -1,4 +1,5 @@
describe('ZoneList', () => {
+ const agency = 'inhouse pickup';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -6,11 +7,15 @@ describe('ZoneList', () => {
});
it('should filter by agency', () => {
- cy.get('input[aria-label="Agency"]').type('{downArrow}{enter}');
+ cy.dataCy('zoneFilterPanelNameInput').type('{downArrow}{enter}');
});
it('should open the zone summary', () => {
- cy.get('input[aria-label="Name"]').type('zone refund');
- cy.get('.q-scrollarea__content > .q-btn--standard > .q-btn__content').click();
+ cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
+ cy.get('.q-menu .q-item').contains(agency).click();
+ cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
+ 'include.text',
+ agency,
+ );
});
});
diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js
index 4a100a762..0f646f33a 100644
--- a/test/cypress/integration/zone/zoneWarehouse.spec.js
+++ b/test/cypress/integration/zone/zoneWarehouse.spec.js
@@ -3,7 +3,7 @@ describe('ZoneWarehouse', () => {
Warehouse: { val: 'Warehouse One', type: 'select' },
};
- const dataError = 'ER_DUP_ENTRY: Duplicate entry';
+ const dataError = 'The introduced warehouse already exists';
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
beforeEach(() => {
@@ -18,7 +18,7 @@ describe('ZoneWarehouse', () => {
cy.get(saveBtn).click();
cy.checkNotification(dataError);
});
-
+
it('should create & remove a warehouse', () => {
cy.addBtnClick();
cy.fillInForm(data);
diff --git a/test/cypress/storage/access/.keep b/test/cypress/storage/access/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/storage/dms/.keep b/test/cypress/storage/dms/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/storage/image/catalog/.keep b/test/cypress/storage/image/catalog/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/storage/image/user/.keep b/test/cypress/storage/image/user/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/storage/pdfs/invoice/.keep b/test/cypress/storage/pdfs/invoice/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/storage/tmp/.keep b/test/cypress/storage/tmp/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index aa4a1219e..bc8158b62 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -27,7 +27,9 @@
// DO NOT REMOVE
// Imports Quasar Cypress AE predefined commands
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
-Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, require('./waitUntil'));
+import waitUntil from './waitUntil';
+Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, waitUntil);
+
Cypress.Commands.add('resetDB', () => {
cy.exec('pnpm run resetDatabase');
});
@@ -57,7 +59,7 @@ Cypress.Commands.add('login', (user) => {
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
});
-Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
+Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
});
@@ -321,19 +323,14 @@ Cypress.Commands.add('clickButtonDescriptor', (id) => {
});
Cypress.Commands.add('openUserPanel', () => {
- cy.get(
- '.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',
- ).click();
+ cy.dataCy('userPanel_btn').click();
});
Cypress.Commands.add('checkNotification', (text) => {
- cy.get('.q-notification')
+ cy.get('.q-notification', { timeout: 10000 })
.should('be.visible')
- .last()
- .then(($lastNotification) => {
- if (!Cypress.$($lastNotification).text().includes(text))
- throw new Error(`Notification not found: "${text}"`);
- });
+ .filter((_, el) => Cypress.$(el).text().includes(text))
+ .should('have.length.greaterThan', 0);
});
Cypress.Commands.add('openActions', (row) => {
diff --git a/test/cypress/support/index.js b/test/cypress/support/index.js
index c57c1a303..075e0c8eb 100644
--- a/test/cypress/support/index.js
+++ b/test/cypress/support/index.js
@@ -27,7 +27,17 @@ function randomNumber(options = { length: 10 }) {
function randomizeValue(characterSet, options) {
return Array.from({ length: options.length }, () =>
- characterSet.charAt(Math.floor(Math.random() * characterSet.length))
+ characterSet.charAt(Math.floor(Math.random() * characterSet.length)),
).join('');
}
+
+const style = document.createElement('style');
+style.innerHTML = `
+ * {
+ transition: none !important;
+ animation: none !important;
+ }
+`;
+document.head.appendChild(style);
+
export { randomString, randomNumber, randomizeValue };
diff --git a/vitest.config.js b/vitest.config.js
index a465f0e2d..f856a1dc9 100644
--- a/vitest.config.js
+++ b/vitest.config.js
@@ -5,9 +5,21 @@ import jsconfigPaths from 'vite-jsconfig-paths';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import path from 'path';
+let reporters,
+ outputFile;
+
+if (process.env.CI) {
+ reporters = ['junit', 'default'];
+ outputFile = {junit: './junit/vitest.xml'};
+} else {
+ reporters = 'default';
+}
+
// https://vitejs.dev/config/
export default defineConfig({
test: {
+ reporters,
+ outputFile,
environment: 'happy-dom',
setupFiles: 'test/vitest/setup-file.js',
include: [