Skip to content
Open
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 @@ -16,6 +16,7 @@
package org.labkey.test.tests.luminex;

import org.apache.commons.lang3.ArrayUtils;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.labkey.test.BaseWebDriverTest;
Expand All @@ -24,8 +25,10 @@
import org.labkey.test.categories.Assays;
import org.labkey.test.categories.Daily;
import org.labkey.test.components.assay.AssayConstants;
import org.labkey.test.pages.ReactAssayDesignerPage;
import org.labkey.test.util.LogMethod;
import org.labkey.test.util.LoggedParam;
import org.labkey.test.util.TestDataGenerator;
import org.openqa.selenium.WebElement;

import java.net.URL;
Expand All @@ -40,6 +43,22 @@
@BaseWebDriverTest.ClassTimeout(minutes = 9)
public final class LuminexMultipleCurvesTest extends LuminexTest
{
@BeforeClass
public static void updateAssayDefinition()
{
LuminexMultipleCurvesTest init = getCurrentTest();

// add the R transform script to the assay, fuzz testing so we test with and without the transform script
boolean shouldAddTransformScript = TestDataGenerator.randomBoolean();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little conflicted about this. I'm not sure that it is better to have a dedicated test, or to randomly select (like you do here), or alternate based on the date (or some other criteria).

I see the advantages to using the fuzz testing here. A dedicate test would be a duplicate and have a lot of set up for minimal functional testing.

One disadvantage to this approach is that it assumes the person doing Test Status knows about this. They might run the test locally, it passes, and they then say "must be random, I'll see how it does tomorrow", and then it passes on the next TC run.

At minimum the test should log weather or not it is adding a transform script.

Maybe we can discuss a little bit about benefits and disadvantages.

if (shouldAddTransformScript)
{
init.goToTestAssayHome();
ReactAssayDesignerPage assayDesigner = init._assayHelper.clickEditAssayDesign();
assayDesigner.addTransformScript(RTRANSFORM_SCRIPT_FILE_NOOP);
assayDesigner.clickFinish();
}
}

/**
* Test our ability to upload multiple files and set multiple standards
*
Expand Down Expand Up @@ -69,6 +88,9 @@ public void testMultipleCurve() throws Exception
int runId = Integer.parseInt(WebTestHelper.parseUrlQuery(new URL(runLink.getAttribute("href"))).get("runId"));
clickAndWait(runLink);

// GitHub Issue #875: verify that all data rows from the multiple file case are imported to assay run results
waitForElement(Locator.css(".labkey-pagination").containing("1 - 100 of 370"));

//edit view to show Analyte Standard
_customizeViewsHelper.openCustomizeViewPanel();
_customizeViewsHelper.addColumn("Analyte/Standard");
Expand All @@ -83,7 +105,7 @@ public void testMultipleCurve() throws Exception
assertTrue("BioPlex curve fit for ENV6 (97) in plate 1, 2, or 3",
isTextPresent("FI = 0.465914 + (1.5417E+006 - 0.465914) / ((1 + (Conc / 122.733)^-0.173373))^7.64039") ||
isTextPresent("FI = 0.582906 + (167.081 - 0.582906) / ((1 + (Conc / 0.531813)^-5.30023))^0.1"));
assertTrue("BioPlex FitProb for ENV6 (97) in plate 1, 2, or 3", isTextPresent("0.9667") || isTextPresent("0.4790"));
assertTrue("BioPlex FitProb for ENV6 (97) in plate 1, 2, or 3", isTextPresent("0.9667") || isTextPresent("0.4790") || isTextPresent("0.479"));
assertTrue("BioPlex ResVar for ENV6 (97) in plate 1, 2, 3", isTextPresent("0.1895") || isTextPresent("0.8266"));

assertAnalytesHaveCorrectStandards(TEST_ASSAY_LUM, runId, analytesAndStandardsConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public abstract class LuminexTest extends BaseWebDriverTest

public static final File RTRANSFORM_SCRIPT_FILE_LABKEY = new File(TestFileUtils.getLabKeyRoot(), "server/modules/commonAssays/luminex/resources/transformscripts/labkey_luminex_transform.R");
public static final File RTRANSFORM_SCRIPT_FILE_LAB = new File(TestFileUtils.getLabKeyRoot(), "server/modules/commonAssays/luminex/resources/transformscripts/tomaras_luminex_transform.R");
public static final File RTRANSFORM_SCRIPT_FILE_NOOP = TestFileUtils.getSampleData("qc/noopTransform.R");

public static final String ASSAY_DATA_FILE_LOCATION_MULTIPLE_FIELD = "__primaryFile__";

Expand Down