Closed fddayan closed 2 years ago
Hi @fddayan - would you be able to point me to a reproducible solution or an example of your AG grid implementation, please? Or if you can provide me with the DOM of your AG grid, that can help me debug this issue for you.
I am facing the same issue, getAgGridData() funtion returns empty array.
cy.get(agGridSelector,{timeout: 10000}).getAgGridData().then((actualTableData) => {
console.log(actualTableData)
});
Output:
[]
length: 0
Hi @rashmipatil9503 can you provide me an example of a grid that this is occurring on and your exact agGridSelector please? Unfortunately I will be unable to assist without a reproducible solution or more information on the DOM structure of your AG grid.
HI @kpmck attached is the file for you to reference.
and here is the value of adGridSelector
const agGridSelector = ".data-container";
Also, the getAgGridData() funtion gives the desired data when i used if after the agGridColumnFilterCheckboxMenu(). here is the example of the test:
it("able to filter column type designation", () => {
cy.get(agGridSelector, {
timeout: 10000,
}).agGridColumnFilterCheckboxMenu({
searchCriteria: {
columnName: "Col1",
filterValue: "100",
},
});
cy.get(agGridSelector)
.getAgGridData()
.then((actualTableData) => {
console.log(actualTableData);
cy.get(agGridSelector).agGridValidateRowsExactOrder(
actualTableData,
expectedFilterTableData
);
});
});
@rashmipatil9503 my best guess is you are attempting to get your grid data before it's fully loaded, so then it is showing 0 items in the collected array. Can you try putting the below command before trying to call cy.get(agGridSelector)...
?
cy.get('.ag-cell').should('be.visible')
hi again,
Now I get the desired data in the actualTableData
array.
Thank you for your help. :)
Regards, Rashmi
Glad to hear that, @rashmipatil9503!
closing this ticket out, but please feel free to reopen if you are still experiencing this, @fddayan.
I'm calling
getAgGridData
and I'm getting
I do see rows in the table. I'm using the react wrapper for ag table.