Skip to content

Commit 04a1229

Browse files
committed
Missed some
1 parent 1577528 commit 04a1229

3 files changed

Lines changed: 35 additions & 44 deletions

File tree

src/org/labkey/test/components/CustomizeView.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private Locator.XPathLocator itemXPath(ViewItemType type)
463463
return Locator.tagWithClass("table", "labkey-customview-" + type.toString().toLowerCase() + "-item");
464464
}
465465

466-
private void removeItem(String fieldKey, ViewItemType type)
466+
private void removeItem(CharSequence fieldKey, ViewItemType type)
467467
{
468468
changeTab(type);
469469

@@ -520,19 +520,19 @@ public void addSort(String[] fieldKeyParts, SortDirection order)
520520
addSort(String.join("/", fieldKeyParts), order);
521521
}
522522

523-
public void removeColumn(String fieldKey)
523+
public void removeColumn(CharSequence fieldKey)
524524
{
525525
_driver.log("Removing " + fieldKey + " column");
526526
removeItem(fieldKey, ViewItemType.Columns);
527527
}
528528

529-
public void removeFilter(String fieldKey)
529+
public void removeFilter(CharSequence fieldKey)
530530
{
531531
_driver.log("Removing " + fieldKey + " filter");
532532
removeItem(fieldKey, ViewItemType.Filter);
533533
}
534534

535-
public void removeSort(String fieldKey)
535+
public void removeSort(CharSequence fieldKey)
536536
{
537537
_driver.log("Removing " + fieldKey + " sort");
538538
removeItem(fieldKey, ViewItemType.Sort);
@@ -584,25 +584,25 @@ public void setFolderFilter(@LoggedParam String folderFilter)
584584
_driver._ext4Helper.selectComboBoxItem("Folder Filter:", folderFilter);
585585
}
586586

587-
public void moveColumn(String fieldKey, boolean moveUp)
587+
public void moveColumn(CharSequence fieldKey, boolean moveUp)
588588
{
589589
_driver.log("Moving filter, " + fieldKey + " " + (moveUp ? "up." : "down."));
590590
moveItem(fieldKey, moveUp, ViewItemType.Columns);
591591
}
592592

593-
public void moveFilter(String fieldKey, boolean moveUp)
593+
public void moveFilter(CharSequence fieldKey, boolean moveUp)
594594
{
595595
_driver.log("Moving filter, " + fieldKey + " " + (moveUp ? "up." : "down."));
596596
moveItem(fieldKey, moveUp, ViewItemType.Filter);
597597
}
598598

599-
public void moveSort(String fieldKey, boolean moveUp)
599+
public void moveSort(CharSequence fieldKey, boolean moveUp)
600600
{
601601
_driver.log("Moving sort, " + fieldKey + " " + (moveUp ? "up." : "down."));
602602
moveItem(fieldKey, moveUp, ViewItemType.Sort);
603603
}
604604

605-
private void moveItem(String fieldKey, boolean moveUp, ViewItemType type)
605+
private void moveItem(CharSequence fieldKey, boolean moveUp, ViewItemType type)
606606
{
607607
changeTab(type);
608608
final int itemIndex = _driver.getElementIndex(itemXPath(type, fieldKey).findElement(this));
@@ -624,7 +624,7 @@ private void moveItem(int field_index, boolean moveUp, ViewItemType type)
624624
builder.dragAndDrop(fromItem, toItem).build().perform();
625625
}
626626

627-
public void removeColumnTitle(String fieldKey)
627+
public void removeColumnTitle(CharSequence fieldKey)
628628
{
629629
setColumnTitle(fieldKey, null);
630630
}
@@ -634,7 +634,7 @@ public void removeColumnTitle(String fieldKey)
634634
* @param fieldKey The field key of the column to change. Note that the column should already be in the selected column list.
635635
* @param caption The caption value or null to unset the column caption.
636636
*/
637-
public void setColumnTitle(String fieldKey, String caption)
637+
public void setColumnTitle(CharSequence fieldKey, String caption)
638638
{
639639
String msg = "Setting column " + fieldKey;
640640
if (caption != null)
@@ -643,15 +643,14 @@ public void setColumnTitle(String fieldKey, String caption)
643643

644644
changeTab(ViewItemType.Columns);
645645

646-
Window window = new SelectedColumnRow(fieldKey).clickEdit();
646+
Window<?> window = new SelectedColumnRow(fieldKey).clickEdit();
647647

648648
if (caption == null)
649649
caption = "";
650650
_driver.setFormElement(Locator.name("title").findElement(window), caption);
651651
Locator.xpath("//label").findElement(window).click();
652652

653-
window.clickButton("OK", 0);
654-
window.waitForClose();
653+
window.clickButton("OK", true);
655654
}
656655

657656
/** Check that a column is present. */
@@ -718,11 +717,11 @@ protected class Elements extends Component<?>.ElementCache
718717
private class SelectedItemRow extends Component<Component<?>.ElementCache>
719718
{
720719
private final WebElement _element;
721-
private final String _fieldKey;
720+
private final FieldKey _fieldKey;
722721

723-
protected SelectedItemRow(ViewItemType itemType, String fieldkey)
722+
protected SelectedItemRow(ViewItemType itemType, CharSequence fieldkey)
724723
{
725-
_fieldKey = fieldkey;
724+
_fieldKey = FieldKey.fromFieldKey(fieldkey);
726725
_element = itemXPath(itemType, fieldkey).findElement(CustomizeView.this);
727726
}
728727

@@ -732,7 +731,7 @@ public WebElement getComponentElement()
732731
return _element;
733732
}
734733

735-
protected String getFieldKey()
734+
protected FieldKey getFieldKey()
736735
{
737736
return _fieldKey;
738737
}
@@ -746,7 +745,7 @@ public void clickDelete()
746745

747746
private class SelectedColumnRow extends SelectedItemRow
748747
{
749-
public SelectedColumnRow(String fieldkey)
748+
public SelectedColumnRow(CharSequence fieldkey)
750749
{
751750
super(ViewItemType.Columns, fieldkey);
752751
}
@@ -762,7 +761,7 @@ public Window clickEdit()
762761

763762
private class SelectedFilterRow extends SelectedItemRow
764763
{
765-
public SelectedFilterRow(String fieldkey)
764+
public SelectedFilterRow(CharSequence fieldkey)
766765
{
767766
super(ViewItemType.Filter, fieldkey);
768767
}
@@ -775,7 +774,7 @@ public void setFilter(Filter filter)
775774

776775
private class SelectedSortRow extends SelectedItemRow
777776
{
778-
public SelectedSortRow(String fieldkey)
777+
public SelectedSortRow(CharSequence fieldkey)
779778
{
780779
super(ViewItemType.Sort, fieldkey);
781780
}

src/org/labkey/test/tests/TimeChartAPITest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,16 @@ protected void doCreateSteps()
152152

153153
final List<Pair<String, List<Object>>> GETDATA_API_TEST_VISITLABEL = new ArrayList<>()
154154
{{
155-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
156-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
157155
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
158156
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
159-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 2", "Month 2", "Month 3", "Month 3", "Month 3", "Month 4", "Month 4", "Month 4", "Month 7", "Month 7", "Month 7", "Month 9", "Month 9", "Month 9")));
157+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
158+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
159+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 2", "Month 2", "Month 3", "Month 3", "Month 3", "Month 4", "Month 4", "Month 4", "Month 7", "Month 7", "Month 7", "Month 9", "Month 9", "Month 9")));
160160
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 2", "Month 2", "Month 3", "Month 3", "Month 3", "Month 4", "Month 4", "Month 4", "Month 7", "Month 7", "Month 7", "Month 9", "Month 9", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
161-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9")));
161+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9")));
162+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
163+
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 2", "Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
162164
add(Pair.of("study_Lab Results_ParticipantVisit_Visit_Label", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
163-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 2", "Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
164-
add(Pair.of("VisitLabel", Arrays.asList("Month 2", "Month 3", "Month 4", "Month 7", "Month 9", "Month 10", "Month 10", "Month 11", "Month 12", "Month 13")));
165165
}};
166166

167167
testVisApi(TestFileUtils.getSampleData("api/getDataVisitTest.html"), GETDATA_API_TEST_TITLES, GETDATA_API_TEST_NUMROWS, GETDATA_API_VISITTEST_COLNAMES, null, GETDATA_API_TEST_VISITLABEL,

src/org/labkey/test/tests/list/ListTest.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.labkey.test.pages.list.GridPage;
5252
import org.labkey.test.params.FieldDefinition;
5353
import org.labkey.test.params.FieldDefinition.StringLookup;
54+
import org.labkey.test.params.FieldKey;
5455
import org.labkey.test.params.list.VarListDefinition;
5556
import org.labkey.test.tests.AuditLogTest;
5657
import org.labkey.test.util.AbstractDataRegionExportOrSignHelper.ColumnHeaderType;
@@ -570,10 +571,8 @@ public void testCustomViews()
570571
clickAndWait(Locator.linkWithText(LIST_NAME_COLORS));
571572
_customizeViewsHelper.openCustomizeViewPanel();
572573
_customizeViewsHelper.removeColumn(_listColGood.getName());
573-
String fieldKey6 = _listColGood.getName();
574-
_customizeViewsHelper.addFilter(fieldKey6, "Is Less Than", "10");
575-
String fieldKey8 = _listColMonth.getName();
576-
_customizeViewsHelper.addSort(fieldKey8, SortDirection.ASC);
574+
_customizeViewsHelper.addFilter(_listColGood.getName(), "Is Less Than", "10");
575+
_customizeViewsHelper.addSort(_listColMonth.getName(), SortDirection.ASC);
577576
_customizeViewsHelper.saveCustomView(TEST_VIEW);
578577

579578
log("Check Customize View worked");
@@ -692,20 +691,13 @@ public void testCustomViews()
692691

693692
log("Check that reference worked");
694693
_customizeViewsHelper.openCustomizeViewPanel();
695-
String fieldKey4 = EscapeUtil.fieldKeyEncodePart(_list2Col1.getName()) + "/" + _listColDesc.getName();
696-
_customizeViewsHelper.addColumn(fieldKey4);
697-
String fieldKey3 = EscapeUtil.fieldKeyEncodePart(_list2Col1.getName()) + "/" + _listColMonth.getName();
698-
_customizeViewsHelper.addColumn(fieldKey3);
699-
String fieldKey2 = EscapeUtil.fieldKeyEncodePart(_list2Col1.getName()) + "/" + _listColGood.getName();
700-
_customizeViewsHelper.addColumn(fieldKey2);
701-
String fieldKey5 = EscapeUtil.fieldKeyEncodePart(_list2Col1.getName()) + "/" + _listColGood.getName();
702-
_customizeViewsHelper.addFilter(fieldKey5, "Is Less Than", "10");
703-
String fieldKey7 = EscapeUtil.fieldKeyEncodePart(_list2Col1.getName()) + "/" + _listColGood.getName();
704-
_customizeViewsHelper.addSort(fieldKey7, SortDirection.ASC);
705-
String fieldKey1 = _list3Col1.getName() + "/" + _list3Col1.getName();
706-
_customizeViewsHelper.addColumn(fieldKey1);
707-
String fieldKey = _list3Col1.getName() + "/" + _list3Col2.getName();
708-
_customizeViewsHelper.addColumn(fieldKey);
694+
_customizeViewsHelper.addColumn(FieldKey.fromParts(_list2Col1.getName(), _listColDesc.getName()));
695+
_customizeViewsHelper.addColumn(FieldKey.fromParts(_list2Col1.getName(), _listColMonth.getName()));
696+
_customizeViewsHelper.addColumn(FieldKey.fromParts(_list2Col1.getName(), _listColGood.getName()));
697+
_customizeViewsHelper.addFilter(FieldKey.fromParts(_list2Col1.getName(), _listColGood.getName()), "Is Less Than", "10");
698+
_customizeViewsHelper.addSort(FieldKey.fromParts(_list2Col1.getName(), _listColGood.getName()), SortDirection.ASC);
699+
_customizeViewsHelper.addColumn(_list3Col1.getName() + "/" + _list3Col1.getName());
700+
_customizeViewsHelper.addColumn(_list3Col1.getName() + "/" + _list3Col2.getName());
709701
_customizeViewsHelper.saveCustomView(TEST_VIEW);
710702

711703
log("Check adding referenced fields worked");

0 commit comments

Comments
 (0)