#8582 - test: e2e monitorTicket #1391

Merged
jsegarra merged 51 commits from e2e_monitor into dev 2025-04-15 21:04:49 +00:00
2 changed files with 15 additions and 6 deletions
Showing only changes of commit 80fb1eaf6a - Show all commits

View File

@ -1,20 +1,30 @@
const clientFk = `[data-cy="recentOrderActions"] [data-cy="column-filter-clientFk"]`;
/// <reference types="cypress" />
describe('Monitor Clients actions', () => {
beforeEach(() => {
cy.login('salesPerson');
cy.intercept('GET', '**/Departments**').as('departments');
cy.visit('/#/monitor/clients-actions');
cy.waitForElement('.q-page');
cy.wait('@departments').then((xhr) => {
cy.window().then((win) => {
const user = JSON.parse(win.sessionStorage.getItem('user'));
const { where } = JSON.parse(xhr.request.query.filter);
expect(where.id.like).to.include(user.departmentFk.toString());
});
});
cy.intercept('GET', '**/SalesMonitors/ordersFilter*').as('ordersFilter');
cy.intercept('GET', '**/SalesMonitors/clientsFilter*').as('clientsFilter');
});
it('Should filter by field', () => {
cy.get('.q-page').should('be.visible');
cy.dataCy('clientsOnWebsite')
.find('[data-cy="column-filter-departmentFk"] [data-cy="_select"]')
.click();
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
});
// cy.checkVisibleDescriptor('Customer');
cy.checkVisibleDescriptor('Customer');
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('departmentFk', 2)
@ -22,14 +32,12 @@ describe('Monitor Clients actions', () => {
.should('have.class', 'link')
.click();
});
cy.checkVisibleDescriptor('Department');
cy.dataCy('clientsOnWebsite')
Review

Estos dos tests que comprueban el título no le veo sentido.

Estos dos tests que comprueban el título no le veo sentido.
Review

Validan que las tablas tiene titulo de cabecera.
Me pareció interesante y es una validación que no ralentiza los tests.
Es cierto que no lo validamos pero creo que no hay mas casos como este.
Por darle más valor al test

Validan que las tablas tiene titulo de cabecera. Me pareció interesante y es una validación que no ralentiza los tests. Es cierto que no lo validamos pero creo que no hay mas casos como este. Por darle más valor al test
.find('.q-ml-md')
.should('have.text', 'Clients on website');
cy.dataCy('clientsOnWebsite')
.find('[data-cy="column-filter-departmentFk"] [data-cy="_select"]')
.should('have.value', 'EQUIPO ESPAÑA VIP');
cy.dataCy('recentOrderActions')
.find('.q-ml-md')
.should('have.text', 'Recent order actions');
jorgep marked this conversation as resolved Outdated

Creo que es mejor validar el contenido de las columnas. puedes usar validateVnTableCol creo que se llama el comando

Creo que es mejor validar el contenido de las columnas. puedes usar validateVnTableCol creo que se llama el comando

Porque es mucho trabajo y porque esa responsabilidad de devolver los datos correctos debe ser del back, de si las relaciones y los wheres estan bien configurados

Porque es mucho trabajo y porque esa responsabilidad de devolver los datos correctos debe ser del back, de si las relaciones y los wheres estan bien configurados

Si te cambian las fixtures , fallará el test, lo digo por eso. Con la fn que te digo no es mucho trabajo, si te refieres a que se gasta mucho tiempo en lanzar el test, eso sí. Pregunta a @juan

Si te cambian las fixtures , fallará el test, lo digo por eso. Con la fn que te digo no es mucho trabajo, si te refieres a que se gasta mucho tiempo en lanzar el test, eso sí. Pregunta a @juan

Lo hablamos el lunes

Lo hablamos el lunes

Cómo has quedado con Juan/Javi?

Cómo has quedado con Juan/Javi?

Te he pegado una captura de lo que he hablado con Javi/Alex

Te he pegado una captura de lo que he hablado con Javi/Alex

View File

@ -1,3 +1,4 @@
/// <reference types="cypress" />
describe('Monitor Tickets Table', () => {
beforeEach(() => {
cy.viewport(1920, 1080);