I'm starting to write tests for a new feature that uses ag-grid. If anyone has done this and has learned lessons the hard way, I'd appreciate tips so I don't make the same mistakes. I'm new to both ag-grid and Playwright; I've worked with custom table implementations and Selenium in the past.
My primary concern with ag-grid is that it loads and unloads cells as you scroll around the table. This makes finding cells in a test complex as you can't use a simple locator with row and column indexes unless you know with absolute certainty that the rows and columns are in the viewport at those exact positions. In practice, this means a small table that always fits in the viewport and no scrolling. For larger tables I've been getting around entering data with scrolling using tab navigation but I do need to verify values in the cells later in the test. The load/unload means that I can't get all cells as an array then use a list assertion because not all cells will be present. Playwright can't tell us how many cells are displayed, so I can't break this into chunks.
I'm currently thinking of using a hotkey to navigate to the first column with a value, then tab to each cell and check the value. That's inefficient, but might work. Said hotkey is not yet implemented so I can't test it.
Does anyone have a better approach?
This thread is trying to answer question "What are some effective strategies for testing a new feature using ag-grid and Playwright?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.