Skip to content

Commit

Permalink
Test Fixes for Issue 49884, 49901, 49906, 49823 (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-danield authored Mar 27, 2024
1 parent 26d6f11 commit 1aa57a0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 51 deletions.
6 changes: 0 additions & 6 deletions src/org/labkey/test/tests/GpatAssayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@ public void testSteps()
// Set the date-only field type.
results.getField("DateOnly")
.setType(FieldDefinition.ColumnType.Date, false);

// Using a tsv and the data-pipeline to define the results fields sets the time-only field to a type of Text.
// A field of type Text cannot be converted to a Time type. The only way around this is to remove the field and
// add it back as a time-only type.
results.removeField("TimeOnly", false);
results.addField(new FieldDefinition("TimeOnly", FieldDefinition.ColumnType.Time));
assayDesignerPage.clickFinish();

clickButton("Next", defaultWaitForPage);
Expand Down
43 changes: 0 additions & 43 deletions src/org/labkey/test/tests/ParsingPatternForDateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.SimplePostCommand;
import org.labkey.test.BaseWebDriverTest;
import org.labkey.test.Locator;
import org.labkey.test.TestFileUtils;
Expand All @@ -22,7 +21,6 @@
import org.labkey.test.util.PortalHelper;
import org.labkey.test.util.StudyHelper;
import org.labkey.test.util.TestDataGenerator;
import org.labkey.test.util.TestLogger;

import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -211,47 +209,6 @@ public void testNonUSDateParsingMode() throws IOException, CommandException

checker().screenShotIfNewError("Non_US_Mode_Error");

listTable.checkAllOnPage();
listTable.clickDeleteAllButton();

log("Set an additional parsing patterns that is US format (MM/dd) but site setting is still Non-US.");
String dateTimePattern = "MM/dd/yy HH:mm";
String datePattern = "MM/dd/yy";
String timePattern = "HH:mm";
setSiteAdditionalParsingPatterns(dateTimePattern, datePattern, timePattern, false);
goToProjectHome();

// Additional parsing format should be applied first before non-US mode (?)
// Send in dates that are MM/dd format.

// This data fails to import because the date-only field is not parsed. The dateTime field with the same date
// format has no problems.
bulkData = String.format("%s\t%s\t%s\t%s\n", COL_NAME, COL_DATETIME, COL_DATE, COL_TIME)
+ "A\t12/23/24 14:45\t12/23/24\t14:45\n"
+ "B\t11/19/99 9:32:06.001\t11/19/99\t9:32:06.001\n"
+ "C\t3/2/1972 10:45 pm\t3/2/1972\t10:45 pm\n"
+ "D\t2-3-05 00:00\t2-3-05\t00:00\n"
+ "E\t19July1999 19:32:06\t07/19/99\t19:32:06\n";

clickAndWait(Locator.linkWithText(TEST_MODE));
listTable = new DataRegionTable("query", getDriver());
listTable.clickImportBulkData()
.setText(bulkData);
clickButton("Submit");

goToProjectHome();
clickAndWait(Locator.linkWithText(TEST_MODE));
listTable = new DataRegionTable("query", getDriver());

checker().verifyEquals("Values in " + COL_DATETIME + " are not as expected.",
expectedDateTimeCol, listTable.getColumnDataAsText(COL_DATETIME));

checker().verifyEquals("Values in " + COL_DATE + " are not as expected.",
expectedDateCol, listTable.getColumnDataAsText(COL_DATE));

checker().verifyEquals("Values in " + COL_TIME + " are not as expected.",
expectedTimeCol, listTable.getColumnDataAsText(COL_TIME));

}

private void createList(String listName) throws IOException, CommandException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.labkey.test.components.domain.DomainFormPanel;
import org.labkey.test.pages.ReactAssayDesignerPage;
import org.labkey.test.params.FieldDefinition;

import org.labkey.test.util.DataRegionExportHelper;
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.ExcelHelper;
Expand Down Expand Up @@ -62,7 +61,7 @@ public class AssayRenameExportImportTest extends BaseWebDriverTest
.build().getTime();

private SimpleDateFormat _defaultDateFormat = new SimpleDateFormat("yyyy-MM-dd");
private SimpleDateFormat _defaultTimeFormat = new SimpleDateFormat("HH:mm");
private SimpleDateFormat _defaultTimeFormat = new SimpleDateFormat("HH:mm:ss");
private SimpleDateFormat _defaultDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");

@BeforeClass
Expand Down

0 comments on commit 1aa57a0

Please sign in to comment.