RedHatQE / widgetastic.core

Making testing of UIs fantastic.
Other
36 stars 43 forks source link

[RFR] Reset table tree if table element changes #170

Closed bsquizz closed 4 years ago

bsquizz commented 4 years ago

We see cases where tables dynamically refresh on a page after selecting different filters or searching for items.

In these cases, the table has refreshed in the DOM but the table tree built by widgetastic is still cached in the Table instance. This means if you try to iterate over the rows of the table, if the number of rows has changed dynamically since the time the table tree was stored, the iterator won't correctly iterate on all the rows.

An example is:

This PR changes the table_tree property to check if the selenium element ID of the table has changed, and if so, the table tree is re-generated.

bsquizz commented 4 years ago

Not sure how this broke the tests, will investigate .. ;)