kpmck / cypress-ag-grid

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

"Select All" in _filterByCheckboxColumnMenu fails when using `localeText` #16

Closed pberden closed 2 years ago

pberden commented 2 years ago

We're using localeText to translate AG Grid labels in the UI. Therefore this line fails because cypress cannot find the 'Select All' checkbox: https://github.com/kpmck/cypress-ag-grid/blob/master/src/agGrid/agGridInteractions.js#L410

I might be able to help with a PR if you can provide a direction on how to solve this.

kpmck commented 2 years ago

Hello @pberden , thanks for filing this! I will take a look shortly and see if we can come up with a smart solution to resolve this.

kpmck commented 2 years ago

@pberden apologies for the delay. This has been fixed in PR https://github.com/kpmck/cypress-ag-grid/pull/20.

There is now an option to pass in selectAllLocaleText to .agGridColumnFilterCheckboxMenu (and this will be the only command where you will need to do this, since we need a way to de-select "Select All" here).

    cy.get("#myGrid").agGridColumnFilterCheckboxMenu({
      searchCriteria: {
        columnName: "Model",
        filterValue: "2002",
      },
      selectAllLocaleText: "Tout Sélectionner"
      hasApplyButton: true,
    });