Cypress: How to scroll AG-Grid Table

Viewed 578

I would like to scroll to a specific column in the AG-Grid table Ag-Grid table. The cypress command scrollTo() doesn't work for me for this kind of tables. Do you have a idea how i can solve this problem?

Thank you!

2 Answers

did a work around for this by using keyboard command using .type

I have found a solution for my scroll problem. Now I use the AG-Grid API link.

Example:

Cypress.Commands.add('ensureColumnVisible', (component: string, colId: string): Cypress.Chainable<void> =>{
    return cy.getGridApi(component).then(api => {
        api.ensureColumnVisible(colId);
        return cy.log(`Scrolling column: '${colId}' was successfully!`);
    })
});

cy.ensureColumnVisible('nameOfgrid', 'colID');

Related