-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add re-tryability to getAgGridData #25
Comments
Hi @westonsankey - for grids where the data takes a bit to load, you will need to wait for a cell to render. If you add the following before getting the data, it will work:
I can work on a solution to have this baked in, but this check would fail on grids that are purposely empty. I’ll look into a reasonable solution and what may work best. |
I've just started using this package on a project using
Unfortunately, the workaround no longer seems to apply. I was able to modify your source to add re-tryability with the e.g. and then something like this -
I forked your code and would create a PR for info, but then it caught my eye that the |
Hi @BrookyNBS - Are you saying you are not able to successfully wait for a cell to render? We are using Cypress v13 and a newer version of ag-grid-angular, so you may possibly have a different selector other than |
Hey @kpmck - I'll see if I can review this again with newer versions, but iirc while the grid was loading, there was an empty cell with with this class 'ag-grid-cell' and I couldn't find an alternative selector. In the end, rather than change the library, I opted for some kind of check on the number of rows being displayed, this kept us moving at the time, but we were aware it wasn't bullet proof. |
@BrookyNBS one thing we do at my org is we wait for the ag grid loaders to not exist before attempting any grid validations. This has been consistently successful for us - can you try and apply this check? For us, it looks like this: waitForGridToLoad(): void {
cy.log("waiting for Ag Grid to fully load data...").then(()=>{
const loaderSelector = 'ag-loading-text';
if (Cypress.$(loaderSelector){
cy.get(loaderSelector).should('not.exist', { timeout: 60000 });
}
})
} |
hey @kpmck - I've just integrated that code and i'm running a few test cycles to see if they consistently pass. Your response was really timely as we've recently encountered a problem where when checking that data was ordered properly, our current tests were pulling back the grid data prior to it being properly rendered - so we were getting arrays of empty strings that were passing the ordering checks! I was having to force a short wait to help 'guarantee' the data was available. So far so good though! |
Couldn't this check cause race issues if the loader itself doesn't show up in time? |
It would be great if re-tryability was built into the
getAgGridData
function. Currently, the following example from the docs will fail if the grid data hasn't fully rendered at execution time.I have a scenario using this exact syntax that fails intermittently, and it would be resolved if retries were built in.
The text was updated successfully, but these errors were encountered: