From 2d5d41c3e051ee48097a43261ec7c47bd8ef3765 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 2 May 2025 15:42:33 -0500 Subject: [PATCH 1/4] DetailTableEdit valueCellWithName locator removal of toLowerCase() for data-fieldkey --- src/org/labkey/test/components/ui/grids/DetailTableEdit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/labkey/test/components/ui/grids/DetailTableEdit.java b/src/org/labkey/test/components/ui/grids/DetailTableEdit.java index dc7eb61dec..a7336805dc 100644 --- a/src/org/labkey/test/components/ui/grids/DetailTableEdit.java +++ b/src/org/labkey/test/components/ui/grids/DetailTableEdit.java @@ -592,7 +592,7 @@ public WebElement valueCellWithLabel(String label) public WebElement valueCellWithName(String fieldName) { - return Locator.tagWithAttribute("td", "data-fieldkey", EscapeUtil.fieldKeyEncodePart(fieldName).toLowerCase()).findElement(editPanel); + return Locator.tagWithAttribute("td", "data-fieldkey", EscapeUtil.fieldKeyEncodePart(fieldName)).findElement(editPanel); } public FileUploadField fileField(String label) From f6d45095f41e840c4ccff2f1bd64e2ce0676eac6 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 2 May 2025 17:04:51 -0500 Subject: [PATCH 2/4] FieldSelectionDialog location class name change to field-caption --- .../test/components/ui/grids/FieldSelectionDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/test/components/ui/grids/FieldSelectionDialog.java b/src/org/labkey/test/components/ui/grids/FieldSelectionDialog.java index 3dc0ccd311..115fdf49df 100644 --- a/src/org/labkey/test/components/ui/grids/FieldSelectionDialog.java +++ b/src/org/labkey/test/components/ui/grids/FieldSelectionDialog.java @@ -260,7 +260,7 @@ public String getActiveSelectedFieldLabel() if(active.isDisplayed()) { - return getTextContent(Locator.tagWithClass("div", "field-name").findElement(active)); + return getTextContent(Locator.tagWithClass("div", "field-caption").findElement(active)); } else { @@ -601,7 +601,7 @@ protected class ElementCache extends ModalDialog.ElementCache protected WebElement selectedFieldsPanel = contentPanelLocator.index(1).findWhenNeeded(this); // This is present to items in both panels. - protected final Locator listItemName = Locator.tagWithClass("div", "field-name"); + protected final Locator listItemName = Locator.tagWithClass("div", "field-caption"); protected final WebElement undoEditsButton = Locator.tagWithText("span", "Undo edits") .refindWhenNeeded(this); @@ -624,7 +624,7 @@ protected class ElementCache extends ModalDialog.ElementCache protected List getListItemElements(WebElement panel, String fieldLabel) { return Locator.tagWithClass("div", "list-group-item") - .withDescendant(Locator.tagWithClass("div", "field-name").withText(fieldLabel)) + .withDescendant(Locator.tagWithClass("div", "field-caption").withText(fieldLabel)) .findElements(panel); } @@ -632,7 +632,7 @@ protected List getListItemElements(WebElement panel, String fieldLab protected WebElement getListItemElement(WebElement panel, String fieldLabel) { return Locator.tagWithClass("div", "list-group-item") - .withDescendant(Locator.tagWithClass("div", "field-name").withText(fieldLabel)) + .withDescendant(Locator.tagWithClass("div", "field-caption").withText(fieldLabel)) .findElement(panel); } From 08371e9fa011955d6d550318c1f814fb5322a4eb Mon Sep 17 00:00:00 2001 From: cnathe Date: Sat, 3 May 2025 07:35:09 -0500 Subject: [PATCH 3/4] BatchUpdateSamplesDialog and EntityBulkInsertDialog update to helpers to get/set date/time fields based on fieldKey --- .../ui/entities/EntityBulkInsertDialog.java | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/org/labkey/test/components/ui/entities/EntityBulkInsertDialog.java b/src/org/labkey/test/components/ui/entities/EntityBulkInsertDialog.java index c2063f9deb..d2bdff4ce9 100644 --- a/src/org/labkey/test/components/ui/entities/EntityBulkInsertDialog.java +++ b/src/org/labkey/test/components/ui/entities/EntityBulkInsertDialog.java @@ -233,7 +233,7 @@ public void setInsertFieldValues(List fields, Map) value); else @@ -246,24 +246,20 @@ else if (field.getType() == FieldDefinition.ColumnType.TextChoice) * object to use the picker to set the field. If a text value is passed in it is used as a literal and jut typed * into the textbox. * - * @param fieldName Field to update. + * @param fieldKey Field to update. * @param dateTime A LocalDateTime, LocalDate, LocalTime or String. * @return A reference to this page. */ - public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime) + public EntityBulkInsertDialog setDateTimeField(String fieldKey, Object dateTime) { - return setDateTimeField(fieldName, dateTime, null); - } - public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime, @Nullable String fieldKey) - { - ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldName, fieldKey); + ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldKey); dateTimePicker.select(dateTime); return this; } - public String getDateTimeField(String fieldName, @Nullable String fieldKey) + public String getDateTimeField(String fieldKey) { - return elementCache().dateInput(fieldName, fieldKey).get(); + return elementCache().dateInput(fieldKey).get(); } public EntityBulkInsertDialog setBooleanField(String fieldKey, boolean checked) @@ -410,13 +406,10 @@ public Input numericInput(String fieldKey) return new Input(inputEl, getDriver()); } - public ReactDateTimePicker dateInput(String fieldName, @Nullable String fieldKey) + public ReactDateTimePicker dateInput(String fieldKey) { - if (fieldKey == null) - fieldKey = fieldName; - return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver()) - .withInputId(fieldKey).find(formRow(fieldName)); + .withInputId(fieldKey).find(formRow(fieldKey)); } public List fieldLabels() From 86433444be50c17ba731a1bcc7e4cb14c6ebfbc9 Mon Sep 17 00:00:00 2001 From: cnathe Date: Sat, 3 May 2025 20:35:29 -0500 Subject: [PATCH 4/4] EntityBulkUpdateDialog setDateField() to use fieldKey now --- .../components/ui/entities/EntityBulkUpdateDialog.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/org/labkey/test/components/ui/entities/EntityBulkUpdateDialog.java b/src/org/labkey/test/components/ui/entities/EntityBulkUpdateDialog.java index f71f51469f..fa1db324e2 100644 --- a/src/org/labkey/test/components/ui/entities/EntityBulkUpdateDialog.java +++ b/src/org/labkey/test/components/ui/entities/EntityBulkUpdateDialog.java @@ -85,7 +85,7 @@ public void setValue(FieldDefinition field, Object newValue) else if (field.getType() == FieldDefinition.ColumnType.Integer || field.getType() == FieldDefinition.ColumnType.Decimal || field.getType() == FieldDefinition.ColumnType.Double) setNumericField(EscapeUtil.fieldKeyEncodePart(field.getName()), String.valueOf(newValue)); else if (field.getType() == FieldDefinition.ColumnType.Date || field.getType() == FieldDefinition.ColumnType.DateAndTime || field.getType() == FieldDefinition.ColumnType.Time) - setDateField(field.getLabel() == null ? field.getName() : field.getLabel(), (String) newValue); + setDateField(EscapeUtil.fieldKeyEncodePart(field.getName()), (String) newValue); else if (field.getType() == FieldDefinition.ColumnType.Boolean) setBooleanField(EscapeUtil.fieldKeyEncodePart(field.getName()), (Boolean) newValue); else if (field.getType() == FieldDefinition.ColumnType.MultiLine) @@ -151,9 +151,9 @@ public String getNumericField(String fieldKey) return elementCache().numericInput(fieldKey).get(); } - public EntityBulkUpdateDialog setDateField(String fieldLabel, String dateString) + public EntityBulkUpdateDialog setDateField(String fieldKey, String dateString) { - enableAndWait(fieldLabel, elementCache().dateInput(fieldLabel)).set(dateString); + enableAndWait(fieldKey, elementCache().dateInput(fieldKey)).set(dateString); return this; } @@ -360,10 +360,10 @@ public Input numericInput(String fieldKey) return new Input(inputEl, getDriver()); } - public ReactDateTimePicker dateInput(String fieldLabel) + public ReactDateTimePicker dateInput(String fieldKey) { return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver()) - .withInputId(EscapeUtil.fieldKeyEncodePart(fieldLabel)).waitFor(formRow(fieldLabel)); + .withInputId(fieldKey).waitFor(formRow(fieldKey)); } public FileAttachmentContainer fileUploadField(String fieldKey)