Skip to content

Commit 68f697b

Browse files
authored
GitHub Issue 778: Track selection loading state on DataRegion so we can disable buttons and prevent another click (#2848)
- DataRegion.assertSelectionText
1 parent 88bb415 commit 68f697b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/org/labkey/test/util/DataRegionTable.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,20 @@ public void assertPaginationText(int firstRow, int lastRow, int totalRows)
278278
assertEquals("Wrong pagination text", expected, fullPaginationText);
279279
}
280280

281+
/**
282+
* Assert that a Data Region has expected selection text (e.g. "Selected 100,000 of 1,234,567")
283+
* @param selectedRows number of selected rows
284+
* @param totalRows total number of rows in data behind the dataregion
285+
*/
286+
public void assertSelectionText(int selectedRows, int totalRows)
287+
{
288+
String expected = "Selected " + String.format("%,d", selectedRows) + " of " + String.format("%,d", totalRows) + " rows.";
289+
String fullSelectionText = Locator.tagWithAttribute("div", "data-msgpart", "selection")
290+
.findElement(this).getText();
291+
292+
assertTrue("Expected text to start with: " + expected + " Full text: " + fullSelectionText, fullSelectionText.startsWith(expected));
293+
}
294+
281295
/**
282296
* @deprecated Renamed. Use {@link #getRowIndex(CharSequence, String)}
283297
*/

0 commit comments

Comments
 (0)