diff --git a/Jenkinsfile b/Jenkinsfile
index dc5acc84e..63577dad5 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -122,7 +122,7 @@ pipeline {
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
- image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
+ image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
sh 'sh test/cypress/cypressParallel.sh 2'
}
}
diff --git a/src/components/common/SendEmailDialog.vue b/src/components/common/SendEmailDialog.vue
index d73133921..254eb9cf9 100644
--- a/src/components/common/SendEmailDialog.vue
+++ b/src/components/common/SendEmailDialog.vue
@@ -56,7 +56,12 @@ async function confirm() {
{{ t('The notification will be sent to the following address') }}
-
+
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
index dfaf6c109..9b5215986 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
@@ -70,6 +70,7 @@ function ticketFilter(invoice) {
icon="vn:client"
color="primary"
:to="{ name: 'CustomerCard', params: { id: entity.client.id } }"
+ data-cy="invoiceOutDescriptorCustomerCard"
>
{{ t('invoiceOut.card.customerCard') }}
@@ -81,6 +82,7 @@ function ticketFilter(invoice) {
name: 'TicketList',
query: { table: ticketFilter(entity) },
}"
+ data-cy="invoiceOutDescriptorTicketList"
>
{{ t('invoiceOut.card.ticketList') }}
diff --git a/src/pages/Zone/Card/ZoneBasicData.vue b/src/pages/Zone/Card/ZoneBasicData.vue
index 2f771642e..9107a2c28 100644
--- a/src/pages/Zone/Card/ZoneBasicData.vue
+++ b/src/pages/Zone/Card/ZoneBasicData.vue
@@ -29,10 +29,10 @@ const setFilteredAddresses = (data) => {
@@ -75,7 +75,6 @@ const setFilteredAddresses = (data) => {
min="0"
/>
-
{
/>
-
{
min="0"
:required="true"
clearable
+ data-cy="ZoneBasicDataPrice"
/>
-
+
{{ t('deleteZone') }}
-
+
diff --git a/src/pages/Zone/Card/ZoneEventInclusionForm.vue b/src/pages/Zone/Card/ZoneEventInclusionForm.vue
index 805d03b27..88f8b30e4 100644
--- a/src/pages/Zone/Card/ZoneEventInclusionForm.vue
+++ b/src/pages/Zone/Card/ZoneEventInclusionForm.vue
@@ -58,7 +58,7 @@ const arrayData = useArrayData('ZoneEvents');
const createEvent = async () => {
eventInclusionFormData.value.weekDays = weekdayStore.toSet(
- eventInclusionFormData.value.wdays
+ eventInclusionFormData.value.wdays,
);
if (inclusionType.value == 'day') eventInclusionFormData.value.weekDays = '';
@@ -74,7 +74,7 @@ const createEvent = async () => {
else
await axios.put(
`Zones/${route.params.id}/events/${props.event?.id}`,
- eventInclusionFormData.value
+ eventInclusionFormData.value,
);
await refetchEvents();
@@ -123,12 +123,14 @@ onMounted(() => {
dense
val="day"
:label="t('eventsInclusionForm.oneDay')"
+ data-cy="ZoneEventInclusionDayRadio"
/>
{
val="range"
:label="t('eventsInclusionForm.rangeOfDates')"
class="q-mb-sm"
+ data-cy="ZoneEventInclusionRangeRadio"
/>
@@ -156,10 +159,12 @@ onMounted(() => {
@@ -221,7 +226,7 @@ onMounted(() => {
openConfirmationModal(
t('zone.deleteTitle'),
t('zone.deleteSubtitle'),
- () => deleteEvent()
+ () => deleteEvent(),
)
"
/>
diff --git a/src/pages/Zone/ZoneCalendar.vue b/src/pages/Zone/ZoneCalendar.vue
index c2abd15ff..7cae59698 100644
--- a/src/pages/Zone/ZoneCalendar.vue
+++ b/src/pages/Zone/ZoneCalendar.vue
@@ -185,6 +185,7 @@ const handleDateClick = (timestamp) => {
:class="{
'--today': isToday(timestamp),
}"
+ data-cy="ZoneCalendarDay"
>
@@ -98,6 +98,7 @@ watch(
outlined
rounded
map-key="geoFk"
+ data-cy="ZoneDeliveryDaysPostcodeSelect"
>
@@ -129,6 +130,7 @@ watch(
dense
outlined
rounded
+ data-cy="ZoneDeliveryDaysAgencySelect"
/>
{
cy.checkNotification('Data saved');
cy.get('.q-virtual-scroll__content > :nth-child(1) > :nth-child(3)').click();
cy.get(':nth-child(8) > .value > .link').click();
- cy.get('.header > :nth-child(3) > .q-btn__content').click();
+ cy.get('.q-menu > .descriptor > .header').should('be.visible');
+ cy.get(
+ '.q-menu > .descriptor > .header > [data-cy="descriptor-more-opts"] > .q-btn__content',
+ ).click();
+ cy.get('[data-cy="descriptor-more-opts-menu"] > .q-list > :nth-child(4)').click();
+ cy.dataCy('VnConfirm_confirm').click();
});
});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
index c0231457a..63e828f55 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -7,7 +7,6 @@ describe('InvoiceOut summary', () => {
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';
@@ -25,8 +24,8 @@ describe('InvoiceOut summary', () => {
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
- it('should open the client summary and the ticket list', () => {
- cy.get(toCustomerSummary).click();
+ it('should open the client summary', () => {
+ cy.dataCy('invoiceOutDescriptorCustomerCard').click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
@@ -51,6 +50,7 @@ describe('InvoiceOut summary', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
+ cy.dataCy('SendEmailNotifiactionDialogInput').should('be.visible');
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
@@ -59,18 +59,11 @@ describe('InvoiceOut summary', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
+ cy.dataCy('SendEmailNotifiactionDialogInput').should('be.visible');
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(selectMenuOption(4)).click();
- cy.dataCy('VnConfirm_confirm').click();
- cy.checkNotification('InvoiceOut deleted');
- });
-
it('should book the invoice', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(5)).click();
diff --git a/test/cypress/integration/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
index 11d9bbe6a..8fed23643 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -27,7 +27,7 @@ describe('VnSearchBar', () => {
const searchAndCheck = (searchTerm, expectedText) => {
cy.clearSearchbar();
cy.typeSearchbar(`${searchTerm}{enter}`);
- cy.get(idGap).should('have.text', expectedText);
+ cy.get(idGap).should('include.text', expectedText);
};
const checkTableLength = (expectedLength) => {
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
index 6db39b072..2d255d959 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -1,5 +1,5 @@
describe('ZoneBasicData', () => {
- const priceBasicData = '[data-cy="Price_input"]';
+ const priceBasicData = '[data-cy="ZoneBasicDataPrice"]';
const saveBtn = '.q-btn-group > .q-btn--standard';
beforeEach(() => {
@@ -8,20 +8,13 @@ describe('ZoneBasicData', () => {
cy.visit('/#/zone/4/basic-data');
});
- it('should throw an error if the name is empty', () => {
- cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
-
- cy.get(saveBtn).click();
- cy.checkNotification("can't be blank");
- });
-
it('should throw an error if the price is empty', () => {
cy.get(priceBasicData).clear();
cy.get(saveBtn).click();
- cy.checkNotification('cannot be blank');
+ cy.get('.q-field__messages > div').should('have.text', 'Field required');
});
- it("should edit the basicData's zone", () => {
+ it("should edit the basicData's zone name", () => {
cy.get('.q-card > :nth-child(1)').type(' modified');
cy.get(saveBtn).click();
cy.checkNotification('Data saved');
diff --git a/test/cypress/integration/zone/zoneCalendar.spec.js b/test/cypress/integration/zone/zoneCalendar.spec.js
new file mode 100644
index 000000000..d71c29142
--- /dev/null
+++ b/test/cypress/integration/zone/zoneCalendar.spec.js
@@ -0,0 +1,53 @@
+describe('ZoneCalendar', () => {
+ const addEventBtn = '.q-page-sticky > div > .q-btn';
+ const submitBtn = '.q-mt-lg > .q-btn--standard';
+ const deleteBtn = '.q-item__section--side > .q-btn';
+ const from = '.q-field__control-container > [data-cy="ZoneEventsFromDate"]';
+ const to = '.q-field__control-container > [data-cy="ZoneEventsToDate"]';
+
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit(`/#/zone/11/events`);
+ });
+
+ it('should include a one day event, then delete it', () => {
+ cy.get(addEventBtn).click();
+ cy.dataCy('ZoneEventInclusionDayRadio').click();
+ cy.get('.q-card > :nth-child(5)').type('02/04/2001');
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should include an indefinitely event for monday and tuesday', () => {
+ cy.get(addEventBtn).click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(2)').click();
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should include a range of dates event', () => {
+ cy.get(addEventBtn).click();
+ cy.dataCy('ZoneEventInclusionRangeRadio').click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
+ cy.dataCy('From_inputDate').type('01/01/2001');
+ cy.dataCy('To_inputDate').type('31/01/2001');
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should exclude an event', () => {
+ cy.get('.q-mb-sm > .q-radio__inner').click();
+ cy.get('.q-current-day > .q-calendar-month__day--label__wrapper').click();
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.get(
+ '.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]',
+ ).click();
+ cy.get('.q-mt-lg > :nth-child(2)').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+});
diff --git a/test/cypress/integration/zone/zoneDeliveryDays.spec.js b/test/cypress/integration/zone/zoneDeliveryDays.spec.js
index 1e1fc8ff5..291c20ce3 100644
--- a/test/cypress/integration/zone/zoneDeliveryDays.spec.js
+++ b/test/cypress/integration/zone/zoneDeliveryDays.spec.js
@@ -1,15 +1,61 @@
describe('ZoneDeliveryDays', () => {
+ const postcode = '46680';
+ const agency = 'Gotham247Expensive';
+ const submitForm = '.q-form > .q-btn > .q-btn__content';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit(`/#/zone/delivery-days`);
});
- it('should query for the day', () => {
+ it('should return no data when querying without params', () => {
cy.get('.q-form > .q-btn > .q-btn__content').click();
cy.get('.q-notification__message').should(
'have.text',
- 'No service for the specified zone'
+ 'No service for the specified zone',
);
});
+
+ it('should query for delivery', () => {
+ cy.intercept('GET', /\/api\/Zones\/getEvents/, (req) => {
+ req.headers['cache-control'] = 'no-cache';
+ req.headers['pragma'] = 'no-cache';
+ req.headers['expires'] = '0';
+ req.on('response', (res) => {
+ delete res.headers['if-none-match'];
+ delete res.headers['if-modified-since'];
+ });
+ }).as('events');
+
+ cy.dataCy('ZoneDeliveryDaysPostcodeSelect').type(postcode);
+ cy.get('.q-menu .q-item').contains(postcode).click();
+ cy.get('.q-menu').then(($menu) => {
+ if ($menu.is(':visible')) {
+ cy.get('[data-cy="ZoneDeliveryDaysPostcodeSelect"]')
+ .as('focusedElement')
+ .focus();
+ cy.get('@focusedElement').blur();
+ }
+ });
+ cy.get('.q-menu').should('not.exist');
+
+ cy.dataCy('ZoneDeliveryDaysAgencySelect').type(agency);
+ cy.get('.q-menu .q-item').contains(agency).click();
+ cy.get('.q-menu').then(($menu) => {
+ if ($menu.is(':visible')) {
+ cy.get('[data-cy="ZoneDeliveryDaysAgencySelect"]')
+ .as('focusedElement')
+ .focus();
+ cy.get('@focusedElement').blur();
+ }
+ });
+ cy.get('.q-menu').should('not.exist');
+
+ cy.get(submitForm).click();
+ cy.wait('@events').then((interception) => {
+ cy.log('interception: ', interception);
+ const data = interception.response.body.events;
+ expect(data.length).to.be.greaterThan(0);
+ });
+ });
});
diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js
index 68e924635..b1b0db3fc 100644
--- a/test/cypress/integration/zone/zoneList.spec.js
+++ b/test/cypress/integration/zone/zoneList.spec.js
@@ -7,10 +7,6 @@ describe('ZoneList', () => {
});
it('should filter by agency', () => {
- cy.dataCy('zoneFilterPanelNameInput').type('{downArrow}{enter}');
- });
-
- it('should open the zone summary', () => {
cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
cy.get('.q-menu .q-item').contains(agency).click();
cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
@@ -18,4 +14,22 @@ describe('ZoneList', () => {
agency,
);
});
+
+ it('should open the zone summary', () => {
+ cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
+ cy.get('.q-menu .q-item').contains(agency).click();
+ cy.dataCy('tableAction-0').eq(1).click();
+ cy.get('.header > .q-icon').click();
+ cy.url().should('include', 'zone/2/summary');
+ });
+
+ it('should clone the zone', () => {
+ cy.get('.router-link-active > .q-icon').click();
+ cy.dataCy('tableAction-1').eq(1).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.url().should('not.include', 'zone/2/');
+ cy.url().should('match', /zone\/\d+\/basic-data/);
+ cy.get('.list-box > :nth-child(1)').should('include.text', agency);
+ cy.get('.title > span').should('include.text', 'Zone pickup B');
+ });
});
diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js
new file mode 100644
index 000000000..04b7f1991
--- /dev/null
+++ b/test/cypress/integration/zone/zoneLocations.spec.js
@@ -0,0 +1,23 @@
+describe('ZoneLocations', () => {
+ const data = {
+ Warehouse: { val: 'Warehouse One', type: 'select' },
+ };
+
+ const postalCode = '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children'
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/zone/2/location`);
+ });
+
+ it('should show all locations on entry', () => {
+ cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)').children().should('have.length', 9);
+ });
+
+ it('should be able to search by postal code', () => {
+ cy.get('#searchbarForm').type('46680');
+ cy.get('.router-link-active > .q-icon').click();
+ cy.get(postalCode).should('include.text', '46680')
+ });
+});
diff --git a/test/cypress/integration/zone/zoneSummary.spec.js b/test/cypress/integration/zone/zoneSummary.spec.js
new file mode 100644
index 000000000..fa9c5353c
--- /dev/null
+++ b/test/cypress/integration/zone/zoneSummary.spec.js
@@ -0,0 +1,22 @@
+describe('ZoneSummary', () => {
+ const agency = 'inhouse pickup';
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/zone/2/summary');
+ });
+
+ it('should clone the zone, then delete it', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.dataCy('Clone_button').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.url().should('not.include', 'zone/2/');
+ cy.url().should('match', /zone\/\d+\/basic-data/);
+ cy.get('.list-box > :nth-child(1)').should('include.text', agency);
+ cy.get('.title > span').should('include.text', 'Zone pickup B');
+ cy.get('.q-page').should('exist');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.dataCy('Delete_button').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+});
diff --git a/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js b/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
index 28e2222d4..576b2ea70 100644
--- a/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
+++ b/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
@@ -1,9 +1,17 @@
describe('ZoneUpcomingDeliveries', () => {
+ const tableFields = (opt) =>
+ `:nth-child(1) > .q-table__container > .q-table__middle > .q-table > thead > tr > :nth-child(${opt})`;
+
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit(`/#/zone/upcoming-deliveries`);
});
- it('should show the page', () => {});
+ it('should show the page', () => {
+ cy.get('.q-card').should('be.visible');
+ cy.get(tableFields(1)).should('be.visible').should('have.text', 'Province');
+ cy.get(tableFields(2)).should('be.visible').should('have.text', 'Closing');
+ cy.get(tableFields(3)).should('be.visible').should('have.text', 'Id');
+ });
});
diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js
index f231ecd4f..b2c1c1ed2 100644
--- a/test/cypress/integration/zone/zoneWarehouse.spec.js
+++ b/test/cypress/integration/zone/zoneWarehouse.spec.js
@@ -1,20 +1,19 @@
describe.skip('ZoneWarehouse', () => {
const data = {
- Warehouse: { val: 'Warehouse One', type: 'select' },
+ Warehouse: { val: 'Warehouse Two', type: 'select' },
};
-
const dataError = 'The introduced warehouse already exists';
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit(`/#/zone/2/warehouses`);
+ cy.visit(`/#/zone/1/warehouses`);
});
it('should throw an error if the warehouse chosen is already put in the zone', () => {
cy.addBtnClick();
- cy.dataCy('Warehouse_select').type('Warehouse Two{enter}');
+ cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
cy.get(saveBtn).click();
cy.checkNotification(dataError);
});
@@ -26,7 +25,5 @@ describe.skip('ZoneWarehouse', () => {
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
cy.get('[title="Confirm"]').click();
-
- cy.reload();
});
});