Skip to content

Commit

Permalink
Merge branch 'develop' into fb_win_premium_test_suite
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-chrisj committed Feb 27, 2025
2 parents 303332c + 9c1061d commit 0dd55ca
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 68 deletions.
91 changes: 89 additions & 2 deletions src/org/labkey/test/BaseWebDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.junit.runners.model.MultipleFailureException;
import org.junit.runners.model.Statement;
import org.junit.runners.model.TestTimedOutException;
import org.labkey.api.query.QueryKey;
import org.labkey.junit.rules.TestWatcher;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.CommandResponse;
Expand All @@ -64,6 +65,7 @@
import org.labkey.test.pages.query.NewQueryPage;
import org.labkey.test.pages.query.SourceQueryPage;
import org.labkey.test.pages.search.SearchResultsPage;
import org.labkey.test.params.FieldDefinition;
import org.labkey.test.teamcity.TeamCityUtils;
import org.labkey.test.util.APIAssayHelper;
import org.labkey.test.util.APIContainerHelper;
Expand Down Expand Up @@ -217,8 +219,7 @@ public abstract class BaseWebDriverTest extends LabKeySiteWrapper implements Cle

public static final double DELTA = 10E-10;

// See QueryKey.ILLEGAL TODO make that array public so it can be used here
public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = {"$", "/", "&", "}", "~", ",", "."};
public static final String[] ILLEGAL_QUERY_KEY_CHARACTERS = QueryKey.ILLEGAL;
public static final String ALL_ILLEGAL_QUERY_KEY_CHARACTERS = StringUtils.join(ILLEGAL_QUERY_KEY_CHARACTERS, "");
// See TSVWriter.shouldQuote. Generally we are not able to use the tab and new line characters when creating field names in the UI, but including here for completeness
public static final String[] TRICKY_IMPORT_FIELD_CHARACTERS = {"\\", "\"", "\\t", ",", "\\n", "\\r"};
Expand All @@ -230,6 +231,92 @@ public abstract class BaseWebDriverTest extends LabKeySiteWrapper implements Cle
public static final String INJECT_CHARS_1 = Crawler.injectScriptBlock;
public static final String INJECT_CHARS_2 = Crawler.injectAttributeScript;

public static final List<FieldDefinition> REALISTIC_ASSAY_FIELDS = List.of(
new FieldDefinition("Addition or Removal (0= addition, 1=removal)", FieldDefinition.ColumnType.Integer),
new FieldDefinition("Source (0=external, 1 = internal to system)", FieldDefinition.ColumnType.Integer),
new FieldDefinition("Raw Sample [Al] g/L", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Raw Sample [H+] g/L or %", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("KJ/Day", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("EE KCal/kg0.75", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Ratio EE in Kcal/Day to Lean Mass", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Feed %", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Consumption Rate, Glucose", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Measurement Date/Time", FieldDefinition.ColumnType.DateAndTime),
new FieldDefinition("A260/A280", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Nucleic Acid (ng/uL)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Concentration (by Qubit ng/uL)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Dead (cells/ml)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("PDGF-AA/BB", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Run End Data/Time", FieldDefinition.ColumnType.DateAndTime),
new FieldDefinition("Run Start Date/Time", FieldDefinition.ColumnType.DateAndTime),
new FieldDefinition("Algorithm Parameter: Calc. Top", FieldDefinition.ColumnType.Integer),
new FieldDefinition("1.0", FieldDefinition.ColumnType.Integer),
new FieldDefinition("2.0"),
new FieldDefinition("12.0"),
new FieldDefinition("FAM-Lambda..cp.Rxn."),
new FieldDefinition("VIC-Precision...1"),
new FieldDefinition("Product.Type"),
new FieldDefinition("Weight.Balance_%", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Cumulative.Yield.DCW/Glucose.Consumed_g/g", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Average.Volume.Productivity_g/L/day", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Cmol.Biomass/Cmol.Glucose.Consumed_%", FieldDefinition.ColumnType.Decimal)
);

public static final List<FieldDefinition> REALISTIC_SAMPLE_FIELDS = List.of(
new FieldDefinition("MW (g/mol)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Batch FW (g/mol)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Sequence (5'-3')"),
new FieldDefinition("Tumor%", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Viable_cells%", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Sample no."),
new FieldDefinition("Pass/Fail" , FieldDefinition.ColumnType.TextChoice).setTextChoiceValues(List.of("Pass", "Fail")),
new FieldDefinition("Final Positivity %", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Optimised Yes/No", FieldDefinition.ColumnType.Boolean),
new FieldDefinition("G-Band Pass/Fail", FieldDefinition.ColumnType.Boolean),
new FieldDefinition("Positivity/negativity notes"),
new FieldDefinition("Useful for R&D/Production ?", FieldDefinition.ColumnType.Boolean),
new FieldDefinition("NaCl Lot Number (External), 0.9% NaCl Expiry (In-House)"),
new FieldDefinition("'GURR' 6.8 buffer tablets Lot number (External)"),
new FieldDefinition("Giemsa Stain Lot number, Expiry"),
new FieldDefinition("Trypsin 2.5% Lot number (External), Expiry"),
new FieldDefinition("Lot No.", FieldDefinition.ColumnType.Integer),
new FieldDefinition("Sample Origin / Owner"),
new FieldDefinition("PSS Tracking No."),
new FieldDefinition("Product/bottle size", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Time point / Pull Date", FieldDefinition.ColumnType.DateAndTime),
new FieldDefinition("Cell Type (Epz, Spz, PS)"),
new FieldDefinition("Concentration (ng/uL)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Lot no. (Replacement tube) 1"),
new FieldDefinition("Date of Collection (DD/MMM/YYY)", FieldDefinition.ColumnType.Date),
new FieldDefinition("Freezer/Fridge ID"),
new FieldDefinition( "X Position (i.e., box row)", FieldDefinition.ColumnType.Integer),
new FieldDefinition("[Analysis 2] 2. Time In (Fridge)", FieldDefinition.ColumnType.Time),
new FieldDefinition("Aliquot_No._/_ID"),
new FieldDefinition("VIAL_ID/BARCODE/ACCESSION_No."),
new FieldDefinition("No.=_464"),
new FieldDefinition("Specimen_condition_(Hämolyse/insufficient_volume/…)", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("CHECKOUT_(x),_Removed_(1)"),
new FieldDefinition("Age <18 years of age or >65 years of age.", FieldDefinition.ColumnType.Boolean),
new FieldDefinition("CTS&L_LLS_Visit_Code_"),
new FieldDefinition("Collection Tube Type & Volume 1"),
new FieldDefinition("Row_&_Col"),
new FieldDefinition("The participant has received any investigational compound from a different trial within 30 days or 5 half-lives (whichever is greater)."),
new FieldDefinition("Barcode e.g FG30000A001"),
new FieldDefinition("Information pertaining to patient recruitment e.g advertisements, bulletins and information placed on the internet - TMAR"),
new FieldDefinition("Data Collection Tools (CRF's, Info Sheets, etc.)")
);

public static final List<FieldDefinition> REALISTIC_SOURCE_FIELDS = List.of(
new FieldDefinition("Patient Race / Ethnicity", FieldDefinition.ColumnType.TextChoice).setTextChoiceValues(List.of("American Indian or Alaska Native", "Asian", "Black", "Native Hawaiian or Pacific Islander", "White", "Other", "Unknown" )),
new FieldDefinition("Tumor%", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Viable_cells%", FieldDefinition.ColumnType.Decimal),
new FieldDefinition("Гемоглобін тех.", FieldDefinition.ColumnType.Date),
new FieldDefinition("Disposition (per SOW/MTA)", FieldDefinition.ColumnType.String),
new FieldDefinition("~ Height (T to B) (mm)", FieldDefinition.ColumnType.Integer),
new FieldDefinition("OD/DCW factor", FieldDefinition.ColumnType.String),
new FieldDefinition("Age (years)", FieldDefinition.ColumnType.Integer)
);

/** Have we already done a memory leak and error check in this test harness VM instance? */
protected static boolean _checkedLeaksAndErrors = false;
private static final String ACTION_SUMMARY_TABLE_NAME = "actions";
Expand Down
23 changes: 0 additions & 23 deletions src/org/labkey/test/categories/SignalData.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/org/labkey/test/pages/core/admin/ShowAdminPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void clickAnalyticsSettings()
clickAndWait(elementCache().analyticsSettingsLink);
}

public void clickExternalRedirectHosts()
public void clickAllowedExternalRedirectHosts()
{
goToSettingsSection();
clickAndWait(elementCache().externalRedirectHostLink);
Expand Down Expand Up @@ -273,7 +273,7 @@ protected class ElementCache extends LabKeyPage.ElementCache
protected WebElement sectionActiveUsers = Locator.linkWithText("Active Users").findWhenNeeded(this);

protected WebElement analyticsSettingsLink = Locator.linkWithText("analytics settings").findWhenNeeded(this);
protected WebElement externalRedirectHostLink = Locator.linkWithText("external redirect hosts").findElement(this);
protected WebElement externalRedirectHostLink = Locator.linkWithText("allowed external redirect hosts").findElement(this);
protected WebElement auditLogLink = Locator.linkWithText("audit log").findWhenNeeded(this);
protected WebElement auditLogMaintenanceLink = Locator.linkWithText("Audit Log Maintenance").findWhenNeeded(this);
protected WebElement authenticationLink = Locator.linkWithText("authentication").findWhenNeeded(this);
Expand Down
36 changes: 36 additions & 0 deletions src/org/labkey/test/params/FieldDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,42 @@ public FieldDefinition(String name)
this(name, ColumnType.String);
}

// See BaseColumnInfo.labelFromName
public static String labelFromName(String name)
{
if (name == null)
return null;

if (name.length() == 0)
return name;

StringBuilder buf = new StringBuilder(name.length() + 10);
char[] chars = new char[name.length()];
name.getChars(0, name.length(), chars, 0);
buf.append(Character.toUpperCase(chars[0]));
for (int i = 1; i < name.length(); i++)
{
char c = chars[i];
if (c == '_' && i < name.length() - 1)
{
buf.append(" ");
i++;
buf.append(Character.isLowerCase(chars[i]) ? Character.toUpperCase(chars[i]) : chars[i]);
}
else if (Character.isUpperCase(c) && Character.isLowerCase(chars[i - 1]))
{
buf.append(" ");
buf.append(c);
}
else
{
buf.append(c);
}
}

return buf.toString();
}

@Override
public Map<String, Object> getAllProperties()
{
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/test/tests/AdminConsoleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void testAppAdminRole()
public void testConfigureReturnURL()
{
String host = "google.com";
goToAdminConsole().clickExternalRedirectHosts();
goToAdminConsole().clickAllowedExternalRedirectHosts();

log("Verifying host cannot be blank ");
clickButton("Save");
Expand Down
Loading

0 comments on commit 0dd55ca

Please sign in to comment.