diff --git a/src/org/labkey/test/util/ext4cmp/Ext4GridRef.java b/src/org/labkey/test/util/ext4cmp/Ext4GridRef.java index 49a208823f..c7b5a0316f 100644 --- a/src/org/labkey/test/util/ext4cmp/Ext4GridRef.java +++ b/src/org/labkey/test/util/ext4cmp/Ext4GridRef.java @@ -330,4 +330,23 @@ public Ext4FieldRef getActiveEditor(int rowIdx, String colName) return new Ext4FieldRef(fieldId, _test); } + + private boolean isCollapsed() + { + return Locator.xpath("//*[@id='" + this._id + "']//img[contains(@class, 'x4-tool-expand-bottom')]").isDisplayed(_test.getDriver()); + } + + // Handle collapsible grids + public void expand() + { + // If collapsed indicator is not present then the grid is either not collapsible or already expanded + if (isCollapsed()) + { + Locator.xpath("//*[@id='" + this._id + "']//img[contains(@class, 'x4-tool-expand-bottom')]"). + findElement(_test.getDriver()).click(); + + WebDriverWrapper.waitFor(() -> !isCollapsed(), + "Grid could not be expanded", 100000); + } + } }