Merge branch 'dev' into 8621-createCmrListE2eTest
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-03-17 13:07:12 +01:00
commit aa9e0bb2a2
9 changed files with 31 additions and 42 deletions

View File

@ -57,13 +57,7 @@ const columns = computed(() => [
cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
columnFilter: false,
},
{
align: 'left',
name: 'agencyModeFk',
label: t('globals.agency'),
format: ({ agencyName }) => agencyName,
cardVisible: true,
width: '100px',
},
{
label: t('globals.agency'),
@ -78,20 +72,12 @@ const columns = computed(() => [
},
},
create: true,
columnFilter: false,
visible: false,
},
{
align: 'left',
name: 'vehicleFk',
label: t('globals.vehicle'),
format: ({ vehiclePlateNumber }) => vehiclePlateNumber,
columnFilter: true,
cardVisible: true,
},
{
name: 'vehicleFk',
label: t('globals.vehicle'),
cardVisible: true,
component: 'select',
attrs: {
url: 'vehicles',
@ -104,8 +90,8 @@ const columns = computed(() => [
},
},
create: true,
columnFilter: false,
visible: false,
columnFilter: true,
cardVisible: true,
},
{
align: 'center',

View File

@ -1,4 +1,4 @@
describe('EntryDms', () => {
describe.skip('EntryDms', () => {
const entryId = 1;
beforeEach(() => {
@ -30,7 +30,7 @@ describe('EntryDms', () => {
const textAreaSelector =
'.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
cy.get(
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`,
).click();
cy.get(textAreaSelector).clear();

View File

@ -1,4 +1,4 @@
describe('Entry', () => {
describe.skip('Entry', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
@ -20,7 +20,7 @@ describe('Entry', () => {
);
});
it.skip('Create entry, modify travel and add buys', () => {
it('Create entry, modify travel and add buys', () => {
createEntryAndBuy();
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
selectTravel('two');

View File

@ -1,4 +1,4 @@
describe('EntryStockBought', () => {
describe.skip('EntryStockBought', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');

View File

@ -1,4 +1,4 @@
describe.skip('AgencyWorkCenter', () => {
describe('AgencyWorkCenter', () => {
const selectors = {
workCenter: 'workCenter_select',
popupSave: 'FormModelPopup_save',
@ -9,7 +9,7 @@ describe.skip('AgencyWorkCenter', () => {
const messages = {
dataCreated: 'Data created',
alreadyAssigned: 'This workCenter is already assigned to this agency',
removed: 'WorkCenter removed successfully',
removed: 'Work center removed successfully',
};
beforeEach(() => {

View File

@ -1,4 +1,4 @@
describe.skip('RouteAutonomous', () => {
describe('RouteAutonomous', () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;

View File

@ -8,6 +8,8 @@ describe('Route extended list', () => {
date: getSelector('dated'),
description: getSelector('description'),
served: getSelector('isOk'),
firstRowSelectCheckBox:
'tbody > tr:first-child > :nth-child(1) .q-checkbox__inner',
lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
removeBtn: '[title="Remove"]',
resetBtn: '[title="Reset"]',
@ -19,7 +21,7 @@ describe('Route extended list', () => {
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',
'.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
};
const checkboxState = {
@ -117,12 +119,21 @@ describe('Route extended list', () => {
});
});
it('Should clone selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
it('Should clone selected route and add ticket', () => {
cy.get(selectors.firstRowSelectCheckBox).click();
cy.get(selectors.cloneBtn).click();
cy.dataCy('Starting date_inputDate').type('10-05-2001');
cy.dataCy('Starting date_inputDate').type('01-01-2001');
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
cy.validateContent(selectors.date, '05/10/2001');
cy.validateContent(selectors.date, '01/01/2001');
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);
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.removeBtn).click();
cy.dataCy(selectors.confirmBtn).click();
});
it('Should download selected route', () => {
@ -145,20 +156,12 @@ describe('Route extended list', () => {
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 add ticket to route', () => {
cy.dataCy('tableAction-0').first().click();
cy.get(selectors.firstTicketsRowSelectCheckBox).click();
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
cy.checkNotification(dataSaved);
});
it('Should save changes in route', () => {
updateFields.forEach(({ selector, type, value }) => {
fillField(selector, type, value);

View File

@ -2,11 +2,11 @@ describe('Vehicle', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('deliveryAssistant');
cy.visit(`/#/route/vehicle/7`);
cy.visit(`/#/route/vehicle/7/summary`);
});
it('should delete a vehicle', () => {
cy.openActionsDescriptor();
cy.dataCy('descriptor-more-opts').click();
cy.get('[data-cy="delete"]').click();
cy.checkNotification('Vehicle removed');
});

View File

@ -184,7 +184,7 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
cy.get('.q-time .q-time__link').contains(val.x).click();
break;
default:
cy.wrap(el).type(val);
cy.wrap(el).type(`{selectall}${val}`, { delay: 0 });
break;
}
});