Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/org/labkey/test/components/ui/grids/EditableGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,22 @@ public void dragFill(WebElement startCell, WebElement endCell)
{
dismissPopover();
Locator.XPathLocator selectionHandleLoc = Locator.byClass("cell-selection-handle");
WebElement selectionHandle = selectionHandleLoc.findElement(startCell);
// Get the value from the start cell
String fillValue = getCellValue(startCell);
WebElement selectionHandle = selectionHandleLoc.waitForElement(getComponentElement(), 2_000);
dragToCell(selectionHandle, endCell);
selectionHandleLoc.waitForElement(endCell, 5_000);

// Wait until endCell actually receives the fill value.
if (!WebDriverWrapper.waitFor(() -> fillValue.equals(getCellValue(endCell)), 3_000))
{
// Fill didn't complete on the first attempt — the drag likely extended the selection
// without triggering the fill. Re-click startCell to restore selection, then retry the drag.
startCell.click();
selectionHandle = selectionHandleLoc.waitForElement(getComponentElement(), 2_000);
dragToCell(selectionHandle, endCell);
WebDriverWrapper.waitFor(() -> fillValue.equals(getCellValue(endCell)),
"Drag fill did not populate end cell with value: " + fillValue, 5_000);
}
}

public void selectCellRange(WebElement startCell, WebElement endCell)
Expand All @@ -1045,7 +1058,7 @@ private void dragToCell(WebElement elementToDrag, WebElement destinationCell)
// WebDriver doesn't calculate correct location to click the cell selection handle
.moveToElement(elementToDrag, 0, 7)
.clickAndHold()
.pause(Duration.ofMillis(200))
.pause(Duration.ofMillis(500))
.moveToElement(destinationCell)
// Extra wiggle to get it to stick
.moveByOffset(0, -size.getHeight())
Expand Down
Loading