feat: refs #8600 added deliveryDays and modified warehouse E2Es
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
7f8f527035
commit
1fcdbd4a3a
|
@ -17,9 +17,15 @@ describe('ZoneDeliveryDays', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should query for delivery', () => {
|
it('should query for delivery', () => {
|
||||||
cy.intercept('GET', /\/api\/Zones\/getEvents/).as('events');
|
cy.intercept('GET', /\/api\/Zones\/getEvents/, (req) => {
|
||||||
|
req.headers['cache-control'] = 'no-cache';
|
||||||
cy.selectOption('[data-cy="ZoneDeliveryDaysPostcodeSelect"]', postcode);
|
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.dataCy('ZoneDeliveryDaysPostcodeSelect').type(postcode);
|
||||||
cy.get('.q-menu .q-item').contains(postcode).click();
|
cy.get('.q-menu .q-item').contains(postcode).click();
|
||||||
|
@ -48,9 +54,8 @@ describe('ZoneDeliveryDays', () => {
|
||||||
cy.get(submitForm).click();
|
cy.get(submitForm).click();
|
||||||
cy.wait('@events').then((interception) => {
|
cy.wait('@events').then((interception) => {
|
||||||
cy.log('interception: ', interception);
|
cy.log('interception: ', interception);
|
||||||
//TODO: interceptar llamada y comprobar que el objeto de los eventos no está vacío
|
const data = interception.response.body.events;
|
||||||
// const data = interception.response.body;
|
expect(data.length).to.be.greaterThan(0);
|
||||||
// expect(data.hasComponentLack).to.equal(1);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,7 @@ describe('ZoneWarehouse', () => {
|
||||||
const data = {
|
const data = {
|
||||||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||||
};
|
};
|
||||||
|
const dataError = 'The introduced warehouse already exists';
|
||||||
const dataError = 'ER_DUP_ENTRY: Duplicate entry';
|
|
||||||
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -18,7 +17,7 @@ describe('ZoneWarehouse', () => {
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.checkNotification(dataError);
|
cy.checkNotification(dataError);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create & remove a warehouse', () => {
|
it('should create & remove a warehouse', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
cy.fillInForm(data);
|
cy.fillInForm(data);
|
||||||
|
@ -26,7 +25,5 @@ describe('ZoneWarehouse', () => {
|
||||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
|
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
|
||||||
cy.get('[title="Confirm"]').click();
|
cy.get('[title="Confirm"]').click();
|
||||||
|
|
||||||
cy.reload();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue