#8582 - test: e2e monitorTicket #1391
|
@ -29,94 +29,104 @@ describe('Monitor Tickets Table', () => {
|
|||
cy.clickOption();
|
||||
});
|
||||
});
|
||||
it('should filter by filter panel', () => {
|
||||
// Client id - clientFk
|
||||
cy.dataCy('Client id_input').type('1101');
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'clientFk');
|
||||
cy.countTableRows('eq', 7);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Order id - orderFk
|
||||
cy.dataCy('Order id_input').type(7);
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'orderFk');
|
||||
cy.countTableRows('eq', 1);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Days onward - scopeDays
|
||||
cy.dataCy('Days onward_input').type(2);
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'scopeDays');
|
||||
cy.countTableRows('eq', 27);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Nickname
|
||||
cy.dataCy('Nickname_input').type('test');
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'nickname');
|
||||
cy.countTableRows('eq', 2);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Invoice
|
||||
cy.dataCy('Invoice_input').type('test');
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'refFk');
|
||||
cy.countTableRows('eq', 0);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Agency
|
||||
cy.dataCy('Agency_select').click();
|
||||
cy.get('.q-item__label').contains('inhouse pickup').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'agencyModeFk');
|
||||
cy.countTableRows('eq', 6);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// State
|
||||
cy.dataCy('State_select').click();
|
||||
cy.get('.q-item__label').contains('Libre').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'stateFk');
|
||||
cy.countTableRows('eq', 13);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// AlertLevel
|
||||
cy.dataCy('Grouped State_select').click();
|
||||
cy.get('.q-item__label').contains('Free').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'alertLevel');
|
||||
cy.countTableRows('eq', 18);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Country
|
||||
cy.dataCy('Country_select').click();
|
||||
cy.get('.q-item__label').contains('España').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'countryFk');
|
||||
cy.countTableRows('eq', 28);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// Province
|
||||
cy.dataCy('Warehouse_select').click();
|
||||
cy.get('.q-item__label').contains('Warehouse Two').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'warehouseFk');
|
||||
cy.countTableRows('eq', 1);
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
it.only('should filter by filter panel', () => {
|
||||
jorgep marked this conversation as resolved
Outdated
|
||||
const testCases = [
|
||||
{
|
||||
name: 'Client id',
|
||||
selector: 'Client id_input',
|
||||
value: '1101',
|
||||
urlParam: 'clientFk',
|
||||
rows: 7,
|
||||
intercept: () => interceptFilterClient(),
|
||||
wait: '@filterClient',
|
||||
},
|
||||
{
|
||||
name: 'Order id',
|
||||
selector: 'Order id_input',
|
||||
value: '7',
|
||||
urlParam: 'orderFk',
|
||||
rows: 1,
|
||||
},
|
||||
{
|
||||
name: 'Days onward',
|
||||
selector: 'Days onward_input',
|
||||
value: '2',
|
||||
urlParam: 'scopeDays',
|
||||
rows: 27,
|
||||
},
|
||||
// ... resto de casos como selects
|
||||
{
|
||||
name: 'Agency',
|
||||
selector: 'Agency_select',
|
||||
value: 'inhouse pickup',
|
||||
urlParam: 'agencyModeFk',
|
||||
rows: 6,
|
||||
isSelect: true,
|
||||
},
|
||||
{
|
||||
name: 'State',
|
||||
selector: 'State_select',
|
||||
value: 'Libre',
|
||||
urlParam: 'state',
|
||||
rows: 13,
|
||||
isSelect: true,
|
||||
},
|
||||
{
|
||||
name: 'Grouped State',
|
||||
selector: 'Grouped State_select',
|
||||
value: 'Free',
|
||||
urlParam: 'alertLevel',
|
||||
rows: 18,
|
||||
isSelect: true,
|
||||
},
|
||||
{
|
||||
name: 'Warehouse',
|
||||
selector: 'Warehouse_select',
|
||||
value: 'Warehouse Two',
|
||||
urlParam: 'warehouseFk',
|
||||
rows: 1,
|
||||
isSelect: true,
|
||||
},
|
||||
{
|
||||
name: 'ITP',
|
||||
selector: 'ITP_select',
|
||||
value: 'H',
|
||||
urlParam: 'packing',
|
||||
rows: 5,
|
||||
isSelect: true,
|
||||
},
|
||||
];
|
||||
|
||||
testCases.forEach(
|
||||
({ name, selector, value, urlParam, rows, intercept, wait, isSelect }) => {
|
||||
cy.log(`Testing ${name}`);
|
||||
|
||||
if (intercept) intercept();
|
||||
|
||||
if (isSelect) {
|
||||
cy.dataCy(selector).click();
|
||||
cy.get('.q-item__label').contains(value).click();
|
||||
} else {
|
||||
cy.dataCy(selector).type(value);
|
||||
}
|
||||
jsegarra marked this conversation as resolved
Outdated
jorgep
commented
should open the descriptorProxy and SummaryPopup. (o algo así) should open the descriptorProxy and SummaryPopup. (o algo así)
|
||||
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', urlParam);
|
||||
|
||||
if (wait) {
|
||||
cy.waitRequest(wait, () => cy.countTableRows('eq', rows));
|
||||
} else {
|
||||
cy.countTableRows('eq', rows);
|
||||
}
|
||||
|
||||
cy.cleanFilterPanel();
|
||||
},
|
||||
);
|
||||
// Department
|
||||
cy.selectOption('[data-cy="Department_select"]', 'EQUIPO ESPAÑA LEVANTE');
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'departmentFk');
|
||||
//
|
||||
cy.cleanFilterPanel();
|
||||
// ITP
|
||||
cy.dataCy('ITP_select').click();
|
||||
cy.get('.q-item__label').contains('H').click();
|
||||
cy.searchInFilterPanel();
|
||||
cy.url().should('include', 'packing');
|
||||
cy.countTableRows('eq', 5);
|
||||
});
|
||||
|
||||
it('Cols', () => {
|
||||
|
@ -171,3 +181,10 @@ function checkScopeDays(scopeDays) {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
function interceptFilterClient() {
|
||||
cy.intercept('GET', '**/Clients*').as('filterClient');
|
||||
}
|
||||
function waitRequest() {
|
||||
cy.wait('@filterClient');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Juan dijo que no testeáramos los filtros de cada sección , de todas maneras aquí solo estas comprobando que se han añadido/quitado los parámetros en la url(Parece más de VnFilterPanel). Sería ver que los datos han sido filtrados. El de daysAgo como tiene lógica si se podría testear.
En la reunión dijimos de no crear una tarea para hacer el test de todos los filtros, pero eso no quita que se haga donde haga falta no?
De todas maneras, veo correcto lo que comentas de que esa comprobación debería ser de MonitorTicketFilter usando vitest.
Si te parece, creo tarea para esto ultimo
Lo que te diga @juan
Lo he quitado, asi que no haria falta revisar nada mas
Sigues validando filtros, lo que te diga Juan
He hablado con Javi y Juan al respecto
Te adjunto una foto
Pero ya no deberían estar validándose
Solo hay 1, creo que es asumible
Alex dice en la foto que si es de vnTable no se validen. Juan y Javi que han dicho?