kpmck / cypress-ag-grid

Cypress plugin for interacting with ag grid
30 stars 17 forks source link

Question: Is Ag Grid QuickFilter supported? #33

Closed cccs-joel closed 1 year ago

cccs-joel commented 2 years ago

Hi there, just discovered your plugin. Nice!

We use the QuickFilter feature of Ag Grid in our application, (https://ag-grid.com/react-data-grid/filter-quick/). Is there way I can set this using your plugin? I read the doc and can't find any reference. If my test types some text present in some rows only in the quick filter box, getAgGridData() returns all rows, no filter applied.

kpmck commented 2 years ago

Hey @cccs-joel apologies for the delayed response. Please allow me a few days to investigate and I will respond as soon as I am able.

cccs-joel commented 1 year ago

@kpmck Did you get any chance to look into this?

kpmck commented 1 year ago

Hey there @cccs-joel apologies again for the delay - it's been a slammed couple of months, but I will be looking into this today!

kpmck commented 1 year ago

On investigation, I do not believe I would be able to implement this feature in a meaningful way for this plugin. From what I have read and seen in examples, the quick filter is defined by the team and not the AG Grid implementation. This means there isn't a unified identifier for us to use in this plugin, and instead would be specific to a client's implementation.

What I would suggest (and what others have done) is to have your own custom Cypress command that will set the quick filter, and you would be able to use the plugin to verify and/or interact with the filtered results:

Cypress.commands.add('agGridQuickFilter', (quickFilterText)=>{
  cy.get('yourQuickFilterElementId').type(quickFilterText);
})