Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fixes after fixes merged from 24.11 for special characters in field names #2251

Merged
merged 3 commits into from
Jan 29, 2025
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.labkey.test.components.ui.entities;

import org.jetbrains.annotations.Nullable;
import org.labkey.test.BootstrapLocators;
import org.labkey.test.Locator;
import org.labkey.test.WebDriverWrapper;
Expand Down Expand Up @@ -221,20 +222,24 @@ public String getFieldWithId(String id)
* 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 fieldKey Field to update.
* @param fieldName Field to update.
* @param dateTime A LocalDateTime, LocalDate, LocalTime or String.
* @return A reference to this page.
*/
public EntityBulkInsertDialog setDateTimeField(String fieldKey, Object dateTime)
public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime)
{
ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldKey);
return setDateTimeField(fieldName, dateTime, null);
}
public EntityBulkInsertDialog setDateTimeField(String fieldName, Object dateTime, @Nullable String fieldKey)
{
ReactDateTimePicker dateTimePicker = elementCache().dateInput(fieldName, fieldKey);
dateTimePicker.select(dateTime);
return this;
}

public String getDateTimeField(String fieldKey)
public String getDateTimeField(String fieldName, @Nullable String fieldKey)
{
return elementCache().dateInput(fieldKey).get();
return elementCache().dateInput(fieldName, fieldKey).get();
}

public EntityBulkInsertDialog setBooleanField(String fieldKey, boolean checked)
Expand Down Expand Up @@ -381,10 +386,13 @@ public Input numericInput(String fieldKey)
return new Input(inputEl, getDriver());
}

public ReactDateTimePicker dateInput(String fieldKey)
public ReactDateTimePicker dateInput(String fieldName, @Nullable String fieldKey)
{
if (fieldKey == null)
fieldKey = fieldName;

return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver())
.withInputId(fieldKey).find(formRow(fieldKey));
.withInputId(fieldKey).find(formRow(fieldName));
cnathe marked this conversation as resolved.
Show resolved Hide resolved
}

public List<WebElement> fieldNames()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ private String expandAvailableFields(String... fields)

while(iterator.hasNext())
{
String field = iterator.next().trim();
String fieldEncoded = field.contains("$D") ? field : EscapeUtil.fieldKeyEncodePart(field);
fieldKey.append(fieldEncoded);
fieldKey.append(iterator.next().trim());

// If this isn't the last item in the collection keep expanding and building the expected data-fieldkey value.
if(iterator.hasNext())
Expand Down