Skip to content

Commit a56522e

Browse files
expose grid headers to tests (#2508)
1 parent fe409c9 commit a56522e

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

src/org/labkey/test/components/ui/grids/ResponsiveGrid.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,24 @@ public List<String> getColumnLabels()
642642
return elementCache().getColumnLabels();
643643
}
644644

645+
/**
646+
*
647+
* @return a List&#60;String&#62; containing the names of the fields for each column header
648+
*/
649+
public List<String> getColumnNames()
650+
{
651+
return elementCache().getColumnNames();
652+
}
653+
654+
/**
655+
*
656+
* @return a List&#60;FieldKey&#62; containing the fieldKeys for each column header
657+
*/
658+
public List<FieldKey> getColumnFieldKeys()
659+
{
660+
return elementCache().getColumnFieldKeys();
661+
}
662+
645663
/**
646664
* Get data from a row
647665
* @param rowIndex the index of the desired row
@@ -773,7 +791,7 @@ public Optional<String> getGridEmptyMessage()
773791
return msg;
774792
}
775793

776-
List<FieldReference> getHeaders()
794+
public List<FieldReference> getHeaders()
777795
{
778796
return Collections.unmodifiableList(elementCache().findHeaders());
779797
}
@@ -861,6 +879,16 @@ protected List<String> getColumnLabels()
861879
return findHeaders().stream().map(FieldReferenceManager.FieldReference::getLabel).collect(Collectors.toList());
862880
}
863881

882+
protected List<String> getColumnNames()
883+
{
884+
return findHeaders().stream().map(FieldReferenceManager.FieldReference::getName).collect(Collectors.toList());
885+
}
886+
887+
protected List<FieldKey> getColumnFieldKeys()
888+
{
889+
return findHeaders().stream().map(FieldReferenceManager.FieldReference::getFieldKey).collect(Collectors.toList());
890+
}
891+
864892
protected GridRow getRow(int index)
865893
{
866894
return getRows().get(index);

0 commit comments

Comments
 (0)