Skip to content
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
Expand Up @@ -208,7 +208,7 @@ public String getTextField(CharSequence fieldIdentifier)
*/
public EntityBulkInsertDialog setNumericField(CharSequence fieldIdentifier, String value)
{
elementCache().numericInput(fieldIdentifier).set(value);
elementCache().textInput(fieldIdentifier).set(value);
return this;
}

Expand All @@ -218,7 +218,7 @@ public EntityBulkInsertDialog setNumericField(CharSequence fieldIdentifier, Stri
*/
public String getNumericField(CharSequence fieldIdentifier)
{
return elementCache().numericInput(fieldIdentifier).get();
return elementCache().textInput(fieldIdentifier).get();
}

/**
Expand Down Expand Up @@ -491,12 +491,6 @@ public Input textArea(CharSequence fieldIdentifier)
return new Input(inputEl, getDriver());
}

public Input numericInput(CharSequence fieldIdentifier)
{
WebElement inputEl = numberInputLoc.findElement(formRow(fieldIdentifier));
return new Input(inputEl, getDriver());
}

public ReactDateTimePicker dateInput(CharSequence fieldIdentifier)
{
return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver()).find(formRow(fieldIdentifier));
Expand Down Expand Up @@ -540,7 +534,6 @@ public List<WebElement> fieldLabels()
.findWhenNeeded(getComponentElement());

final Locator textInputLoc = Locator.tagWithAttribute("input", "type", "text");
final Locator numberInputLoc = Locator.tagWithAttribute("input", "type", "number");
final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");
final Locator fieldLabels = Locator.tag("hr").followingSibling("div").childTag("label");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public String getTextField(CharSequence fieldIdentifier)
*/
public EntityBulkUpdateDialog setNumericField(CharSequence fieldIdentifier, String value)
{
enableAndWait(fieldIdentifier, elementCache().numericInput(fieldIdentifier)).set(value);
enableAndWait(fieldIdentifier, elementCache().textInput(fieldIdentifier)).set(value);
return this;
}

Expand All @@ -227,7 +227,7 @@ public EntityBulkUpdateDialog setNumericField(CharSequence fieldIdentifier, Stri
*/
public String getNumericField(CharSequence fieldIdentifier)
{
return elementCache().numericInput(fieldIdentifier).get();
return elementCache().textInput(fieldIdentifier).get();
}

/**
Expand Down Expand Up @@ -453,12 +453,6 @@ public Input textArea(CharSequence fieldIdentifier)
return new Input(inputEl, getDriver());
}

public Input numericInput(CharSequence fieldIdentifier)
{
WebElement inputEl = numberInputLoc.waitForElement(formRow(fieldIdentifier), WAIT_TIMEOUT);
return new Input(inputEl, getDriver());
}

public ReactDateTimePicker dateInput(CharSequence fieldIdentifier)
{
return new ReactDateTimePicker.ReactDateTimeInputFinder(getDriver()).waitFor(formRow(fieldIdentifier));
Expand All @@ -475,7 +469,6 @@ public FileUploadField fileField(CharSequence fieldIdentifier)
}

final Locator textInputLoc = Locator.tagWithAttribute("input", "type", "text");
final Locator numberInputLoc = Locator.tagWithAttribute("input", "type", "number");
final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");
final Locator.XPathLocator commentInputLocator = Locator.tagWithId("textarea", "actionComments");
final WebElement commentInput = commentInputLocator.refindWhenNeeded(this);
Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/test/tests/SampleTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ public void testAmountsAndUnitsWithoutDisplayUnit()
clickButton("Cancel");
// bulk import with unit but not amount (error expected)
sampleHelper.bulkImportExpectingError(List.of(Map.of("Name", "AU-BULK-ERR-2", "Units", "mL")), SampleTypeHelper.IMPORT_OPTION);
assertTextPresent("An Amount value must be provided Units are provided.");
assertTextPresent("An Amount value must be provided when Units are provided.");
clickButton("Cancel");
// bulk import with both amount and unit (success expected)
sampleHelper.bulkImport(List.of(Map.of("Name", "AU-BULK-SUCCESS-1", "StoredAmount", "0", "Units", "L")));
Expand All @@ -2000,7 +2000,7 @@ private void verifySampleAmountUnitValues(String name, String expectedAmount, St
{
DataRegionTable drt = DataRegionTable.findDataRegionWithinWebpart(this, "Sample Type Contents");
drt.setFilter("Name", "Equals", name);
checker().verifyEquals("StoredAmount value not as expected for sample " + name, expectedAmount, drt.getDataAsText(0, "Amount"));
checker().verifyEquals("StoredAmount value not as expected for sample " + name, expectedAmount, drt.getDataAsText(0, "StoredAmount"));
checker().verifyEquals("Units value not as expected for sample " + name, expectedUnits, drt.getDataAsText(0, "Units"));
drt.clearAllFilters();
}
Expand Down
44 changes: 42 additions & 2 deletions src/org/labkey/test/tests/list/ListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.labkey.test.tests.list;

import org.apache.commons.lang3.StringUtils;
import org.hamcrest.CoreMatchers;
import org.hamcrest.MatcherAssert;
import org.junit.Before;
Expand Down Expand Up @@ -52,8 +51,8 @@
import org.labkey.test.pages.query.UpdateQueryRowPage;
import org.labkey.test.params.FieldDefinition;
import org.labkey.test.params.FieldDefinition.StringLookup;
import org.labkey.test.params.FieldInfo;
import org.labkey.test.params.FieldKey;
import org.labkey.test.params.list.IntListDefinition;
import org.labkey.test.params.list.VarListDefinition;
import org.labkey.test.tests.AuditLogTest;
import org.labkey.test.util.AbstractDataRegionExportOrSignHelper.ColumnHeaderType;
Expand Down Expand Up @@ -2160,6 +2159,47 @@ private void validateDetailsView(String listName, String pkCol) throws CommandEx
assertElementPresent(Locator.tagContainingText("td", pks.get(0)));
}

@Test // Issue 53979
public void testDecimalFieldFiniteValues()
{
String listName = "DecimalFieldList";
FieldInfo decField = FieldInfo.random("decimalField", ColumnType.Decimal);
String[][] data = new String[][]
{
{"1", "1.1"},
{"2", "1.7976931348623157e+308"},
{"3", "-1.7976931348623157e+308"},
{"4", "Infinity"},
{"5", "-Infinity"},
{"6", "Inf"},
{"7", "-Inf"},
{"8", "NaN"}
};
createList(listName, List.of(
new FieldDefinition("key", ColumnType.Integer),
decField.getFieldDefinition()
), data);

DataRegionTable table = new DataRegionTable("query", getDriver());
checker().verifyEquals("Decimal field values not as expected",
List.of("1.1", "1.7976931348623157E308", "-1.7976931348623157E308", "Infinity", "-Infinity", "Infinity", "-Infinity", "NaN"),
table.getColumnDataAsText(decField.getName()));

table.clickInsertNewRow();
setFormElement(Locator.name(EscapeUtil.getFormFieldName("key")), "9");
setFormElement(Locator.name(EscapeUtil.getFormFieldName(decField.getName())), "bogus");
clickButton("Submit");
assertTextPresent("Could not convert value: bogus");

setFormElement(Locator.name(EscapeUtil.getFormFieldName(decField.getName())), "1.7976931348623157e+309");
clickButton("Submit");
assertTextPresent("Could not convert value: 1.7976931348623157e+309");

setFormElement(Locator.name(EscapeUtil.getFormFieldName(decField.getName())), "-1.7976931348623157e+309");
clickButton("Submit");
assertTextPresent("Could not convert value: -1.7976931348623157e+309");
}

@Override
protected BrowserType bestBrowser()
{
Expand Down