fix: refs #8581 update invoiceInList tests to use waitTableScrollLoad for better synchronization
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-03-11 17:30:42 +01:00
parent 291946e78c
commit 0a41e0a93e
2 changed files with 14 additions and 2 deletions

View File

@ -53,6 +53,7 @@ describe('InvoiceInList', () => {
describe('right-panel', () => {
it('should filter by From param', () => {
cy.dataCy('From_inputDate').type('31/12/2000{enter}');
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [
{
@ -67,6 +68,7 @@ describe('InvoiceInList', () => {
it('should filter by To param', () => {
cy.dataCy('To_inputDate').type('31/12/2000{enter}');
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [
{
@ -81,6 +83,7 @@ describe('InvoiceInList', () => {
it('should filter by daysAgo param', () => {
cy.dataCy('Days ago_input').type('4{enter}');
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [
{
@ -99,6 +102,7 @@ describe('InvoiceInList', () => {
it('should filter by supplierFk param', () => {
cy.selectOption('[data-cy="vnSupplierSelect"]', 'farmer king');
cy.dataCy('vnSupplierSelect').type('{enter}');
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [{ name: 'supplierFk', val: 'Farmer King' }],
});
@ -107,12 +111,14 @@ describe('InvoiceInList', () => {
it('should filter by supplierRef param', () => {
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
cy.dataCy('Supplier ref_input').type('1239{enter}');
cy.waitTableScrollLoad();
cy.wait('@invoice').then(() => cy.validateDescriptor({ title: '1239' }));
});
it('should filter by FI param', () => {
const plantsSlTaxNumber = '06089160W';
cy.dataCy('FI_input').type(`${plantsSlTaxNumber}{enter}`);
cy.waitTableScrollLoad();
cy.validateVnTableRows({ cols: [{ name: 'supplierFk', val: 'plants sl' }] });
});
@ -124,6 +130,7 @@ describe('InvoiceInList', () => {
it('should filter by account param', () => {
const supplierAccount = '4100000001';
cy.dataCy('Ledger account_input').type(`${supplierAccount}{enter}`);
cy.waitTableScrollLoad();
cy.validateVnTableRows({ cols: [{ name: 'supplierFk', val: 'plants sl' }] });
});
@ -145,6 +152,7 @@ describe('InvoiceInList', () => {
it('should filter by company param', () => {
cy.selectOption('[data-cy="Company_select"]', '442');
cy.dataCy('Company_select').type('{enter}');
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [{ name: 'companyFk', val: 'vnl' }],
});
@ -152,10 +160,12 @@ describe('InvoiceInList', () => {
it('should filter by isBooked param', () => {
cy.dataCy('vnCheckboxIs booked').click();
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [{ name: 'isBooked', val: 'check' }],
});
cy.dataCy('vnCheckboxIs booked').click();
cy.waitTableScrollLoad();
cy.validateVnTableRows({
cols: [{ name: 'isBooked', val: 'close' }],
});
@ -168,7 +178,7 @@ describe('InvoiceInList', () => {
.its('length')
.then((firstCount) => {
cy.dataCy('vnCheckboxRectificative').click();
cy.waitTableLoad();
cy.waitTableScrollLoad();
cy.get('[data-cy="vnTable"] .q-virtual-scroll__content')
.children()
.its('length')

View File

@ -597,4 +597,6 @@ Cypress.Commands.add('checkQueryParams', (expectedParams = {}) => {
});
});
Cypress.Commands.add('waitTableLoad', () => cy.waitForElement('[data-q-vs-anchor]'));
Cypress.Commands.add('waitTableScrollLoad', () =>
cy.waitForElement('[data-q-vs-anchor]'),
);