Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 23 additions & 10 deletions src/org/labkey/test/components/ui/Pager.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,41 @@ public int getCurrentPage() // only works on GridPanel

public Pager selectPageSize(String pageSize) // only works on GridPanel
{
int currentPageSize = getPageSize();
if(currentPageSize != Integer.parseInt(pageSize))
{
_pagedComponent.doAndWaitForUpdate(() -> elementCache().jumpToDropdown.clickSubMenu(false, pageSize));
}
pageSize(pageSize);
return this;
}

public int getPageSize() // only works on GridPanel
{
// Changing the jumpToDropdown button from the deprecated DropdownButtonGroup class to a MultiMenu type has changed
// the way that various text from the control is gathered. Getting the current page size now requires that the dropdown
return pageSize(null);
}

/**
* Sets the page size if required (pageSize is specified and doesn't match the current page size)
* @return returns the initial page size
*/
private int pageSize(String pageSize) // only works on GridPanel
{
// Getting the current page size requires that the dropdown
// be expanded and the selected page size found in the list.
elementCache().jumpToDropdown.expand();

// Find the selected li element in the page size list
WebElement activeLi = Locator.byClass("active").findElement(elementCache().jumpToDropdown);

int size = Integer.parseInt(activeLi.getText());
elementCache().jumpToDropdown.collapse();
int initialSize = Integer.parseInt(activeLi.getText());

if (pageSize != null && initialSize != Integer.parseInt(pageSize))
{
_pagedComponent.doAndWaitForUpdate(() -> elementCache().jumpToDropdown.clickSubMenu(false, pageSize));
}
else
{
// Tooltip sometimes blocks button. Click active option to dismiss menu.
activeLi.click();
}

return size;
return initialSize;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/org/labkey/test/components/ui/grids/EditableGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ public EditableGrid shiftSelectRange(int start, int end)
var checkBoxes = Locator.tag("tr").child("td")
.child(Locator.tagWithAttribute("input", "type", "checkbox"))
.findElements(elementCache().table);
getWrapper().scrollIntoView(checkBoxes.get(start)); // Make sure the header isn't in the way
checkBoxes.get(start).click();
getWrapper().scrollIntoView(checkBoxes.get(end), true); // Actions.click() doesn't scroll
getWrapper().scrollIntoView(checkBoxes.get(end)); // Actions.click() doesn't scroll
new Actions(getDriver())
.keyDown(Keys.SHIFT)
.click(checkBoxes.get(end))
Expand Down