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
4 changes: 2 additions & 2 deletions resources/views/configureQCGroups.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
LABKEY.QueryWebPart.standardButtons.print,
LABKEY.QueryWebPart.standardButtons.pageSize,
{
text: 'Mark As Included',
text: 'Include',
requiresSelection: 'true',
handler: markPrecursorAsIncludedHandler
},
{
text: 'Mark As Excluded',
text: 'Exclude',
requiresSelection: 'true',
handler: markPrecursorAsExcludedHandler
}
Expand Down
3 changes: 2 additions & 1 deletion src/org/labkey/targetedms/view/qcTrendPlotReport.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
String plotPanelId = "tiledPlotPanel-" + uid;
String plotPaginationPanelId = "plotPaginationPanel-" + uid;
%>

<!-- Help ExtJS plot controls reliably grab the width they need -->
<div style="height: 1px; width: 1250px;"></div>
<div id="<%=h(reportPanelId)%>"></div>
<div id="<%=h(plotPaginationPanelId)%>" class="plotPaginationHeaderPanel"></div>
<div id="<%=h(plotPanelId)%>" class="tiledPlotPanel"></div>
Expand Down
129 changes: 97 additions & 32 deletions test/src/org/labkey/test/components/targetedms/QCPlotsWebPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.labkey.test.Locators;
import org.labkey.test.WebDriverWrapper;
import org.labkey.test.components.BodyWebPart;
import org.labkey.test.components.ext4.Checkbox;
import org.labkey.test.components.ext4.ComboBox;
import org.labkey.test.components.ext4.RadioButton;
import org.labkey.test.components.ext4.Window;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.LogMethod;
Expand Down Expand Up @@ -252,22 +252,44 @@ public Set<QCPlotType> getCurrentQCPlotTypes()

public void setGroupXAxisValuesByDate(boolean check)
{
if (elementCache().groupedXCheckbox.get() != check)
if (isGroupXAxisValuesByDateChecked() != check)
{
doAndWaitForUpdate(() -> elementCache().groupedXCheckbox.set(check));
if (check)
doAndWaitForUpdate(() -> elementCache().xAxisGroupingDateRadio.check());
else
doAndWaitForUpdate(() -> elementCache().xAxisGroupingReplicateRadio.check());
}
}

public boolean isGroupXAxisValuesByDateChecked()
{
return elementCache().groupedXCheckbox.isChecked();
try
{
return elementCache().xAxisGroupingDateRadio.isSelected();
}
catch (NoSuchElementException | StaleElementReferenceException e)
{
// Fallback: if radios are not present yet, assume unchecked
return false;
}
}

public void setShowAllPeptidesInSinglePlot(boolean check)
{
if (elementCache().singlePlotCheckbox.get() != check)
// 'check' means show all series combined in a single plot
try
{
doAndWaitForUpdate(() -> elementCache().singlePlotCheckbox.set(check));
if (isShowAllPeptidesInSinglePlotChecked() != check)
{
if (check)
doAndWaitForUpdate(() -> elementCache().plotsCombinedRadio.check());
else
doAndWaitForUpdate(() -> elementCache().plotsPerPrecursorRadio.check());
}
}
catch (NoSuchElementException | StaleElementReferenceException e)
{
// Fallback: ignore if control not present yet
}
}

Expand All @@ -282,32 +304,63 @@ public void setShowAllPeptidesInSinglePlot(boolean check, int expectedPlotCount)

public void setShowExcludedPoints(boolean check)
{
elementCache().showExcludedCheckbox.set(check);
if (check)
{
elementCache().excludedReplicatesShow.check();
}
else
{
elementCache().excludedReplicatesHide.check();
}
}

public boolean isShowExcludedPointsChecked()
{
return elementCache().showExcludedCheckbox.isChecked();
return elementCache().excludedReplicatesShow.isChecked();
}

public void setShowReferenceGuideSet(boolean check)
{
elementCache().showReferenceGuideSet.set(check);
if (isShowReferenceGuideSetChecked() != check)
{
if (check)
{
elementCache().referenceGuideSetShow.check();
}
else
{
elementCache().referenceGuideSetHide.check();
}
}
}

public void setShowExcludedPrecursors(boolean check)
{
elementCache().showExcludedPrecursors.set(check);
if (check)
{
elementCache().excludedPrecursorsShow.check();
}
else
{
elementCache().excludedPrecursorsHide.check();
}
}

public boolean isShowReferenceGuideSetChecked()
{
return elementCache().showReferenceGuideSet.isChecked();
return elementCache().referenceGuideSetShow.isChecked();
}

public boolean isShowAllPeptidesInSinglePlotChecked()
{
return elementCache().singlePlotCheckbox.isChecked();
try
{
return elementCache().plotsCombinedRadio.isSelected();
}
catch (NoSuchElementException | StaleElementReferenceException e)
{
return false;
}
}

public QCPlotsWebPart saveAsDefaultView()
Expand All @@ -323,11 +376,6 @@ public QCPlotsWebPart revertToDefaultView()
return this;
}

public void applyRange()
{
doAndWaitForUpdate(() -> elementCache().applyRangeButton.click());
}

public void waitForPlots(Integer plotCount)
{
if (plotCount > 0)
Expand All @@ -341,6 +389,11 @@ public void waitForPlots(Integer plotCount)
}
}

public boolean isCombinedPlotControlVisible()
{
return elementCache().plotsCombinedRadio.isDisplayed();
}

public List<QCPlot> getPlots()
{
return elementCache().findSeriesPanels().stream().map(QCPlot::new).toList();
Expand Down Expand Up @@ -374,7 +427,7 @@ public void filterQCPlotsToInitialData(int expectedPlotCount, boolean resetForm)
resetInitialQCPlotFields();
}

filterQCPlots("2013-08-09", "2013-08-27", expectedPlotCount);
filterQCPlots("2013-08-09", "2013-08-27", resetForm);
}

@LogMethod
Expand All @@ -391,13 +444,18 @@ public void resetInitialQCPlotFields()
}

@LogMethod
public void filterQCPlots(@LoggedParam String startDate, @LoggedParam String endDate, int expectedPlotCount)
public void filterQCPlots(@LoggedParam String startDate, @LoggedParam String endDate, boolean waitForPlotsToRefresh)
{
setDateRangeOffset(DateRangeOffset.CUSTOM);
setStartDate(startDate);
setEndDate(endDate);
applyRange();
waitForPlots(expectedPlotCount);
if (waitForPlotsToRefresh)
{
doAndWaitForUpdate(() -> setEndDate(endDate));
}
else
{
setEndDate(endDate);
}
}

public int getGuideSetTrainingRectCount()
Expand Down Expand Up @@ -871,17 +929,24 @@ public class Elements extends BodyWebPart<?>.ElementCache

ComboBox qcPlotTypeCombo = new ComboBox.ComboBoxFinder(getDriver()).withIdPrefix("qc-plot-type-with-y-options")
.findWhenNeeded(this).setMatcher(Ext4Helper.TextMatchTechnique.CONTAINS).setMultiSelect(true);
Checkbox groupedXCheckbox = new Checkbox(Locator.css("#grouped-x-field input")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT));
Checkbox singlePlotCheckbox = new Checkbox(Locator.css("#peptides-single-plot input")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT));
Checkbox showExcludedCheckbox = new Checkbox(Locator.css("#show-excluded-points input")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT));
Checkbox showReferenceGuideSet = new Checkbox(Locator.css("#show-oorange-gs input")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT));
Checkbox showExcludedPrecursors = new Checkbox(Locator.css("#show-excluded-precursors input")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT));
WebElement groupedXPerReplicate = Locator.css("#grouped-x-field input[value=replicate]").findWhenNeeded(this);

RadioButton xAxisGroupingReplicateRadio = new RadioButton.RadioButtonFinder().withLabel("per replicate").findWhenNeeded(getDriver());
RadioButton xAxisGroupingDateRadio = new RadioButton.RadioButtonFinder().withLabel("per date").findWhenNeeded(getDriver());

RadioButton plotsCombinedRadio = new RadioButton.RadioButtonFinder().withLabel("combined").findWhenNeeded(getDriver());
RadioButton plotsPerPrecursorRadio = new RadioButton.RadioButtonFinder().withLabel("per precursor").findWhenNeeded(getDriver());

// These have the same label as another group, but are first in the page
RadioButton excludedReplicatesShow = new RadioButton.RadioButtonFinder().withLabel("show").findWhenNeeded(getDriver());
RadioButton excludedReplicatesHide = new RadioButton.RadioButtonFinder().withLabel("hide").findWhenNeeded(getDriver());

// Note that these two won't work with the isChecked() call but they have the same labels as the ones above so we can't simply check by label
RadioButton excludedPrecursorsShow = new RadioButton(Locator.id("excluded-precursors-show").findWhenNeeded(getDriver()));
RadioButton excludedPrecursorsHide = new RadioButton(Locator.id("excluded-precursors-hide").findWhenNeeded(getDriver()));

RadioButton referenceGuideSetShow = new RadioButton.RadioButtonFinder().withLabel("always show").findWhenNeeded(getDriver());
RadioButton referenceGuideSetHide = new RadioButton.RadioButtonFinder().withLabel("when in date range").findWhenNeeded(getDriver());

WebElement plotPanel = Locator.css("div.tiledPlotPanel").findWhenNeeded(this);
WebElement paginationPanel = Locator.css("div.plotPaginationHeaderPanel").findWhenNeeded(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ private void excludePeptideOrMolecule(String folderName, int rowIndex, String ac
DataRegionTable table = gotoIncludeExcludeMenu();
table.checkCheckbox(rowIndex);
if (action.equals("Excluded"))
table.doAndWaitForUpdate(() -> table.clickHeaderButton("Mark As Excluded"));
table.doAndWaitForUpdate(() -> table.clickHeaderButton("Exclude"));
else
table.doAndWaitForUpdate(() -> table.clickHeaderButton("Mark As Included"));
table.doAndWaitForUpdate(() -> table.clickHeaderButton("Include"));
checker().withScreenshot("MarkedAsColumnUpdate_" + folderName).verifyEquals("Marked As column not updated with selection of action", action, table.getDataAsText(rowIndex, "markedAs"));

log("Verifying targetedms.ExcludedPrecursors table gets updated with action");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ private void excludePrecursors(String projectName, int rowNum)
qcSummaryWebPart.clickMenuItem("Configure Included and Excluded Precursors");
DataRegionTable table = new DataRegionTable.DataRegionFinder(getDriver()).waitFor();
table.checkCheckbox(rowNum);
table.clickHeaderButton("Mark As Excluded");
table.clickHeaderButton("Exclude");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void testLinkExperimentalQC()

String testStartDate = "2013-08-18";
String testEndDate = "2013-08-27";
qcPlotsWebPart.filterQCPlots(testStartDate, testEndDate, 7);
qcPlotsWebPart.filterQCPlots(testStartDate, testEndDate, true);

checker().verifyTrue("The graph is not divided by line separator",
isElementPresent(Locator.tagWithAttribute("line", "class", "separator")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class TargetedMSIrtTest extends TargetedMSTest
private static final String SCHEMA = "targetedms";
private static final String QUERY = "iRTPeptide";

// All tests use varations of this test dataset.
// All tests use variations of this test dataset.
protected static final String SKY_FILE = "iRT Human+Standard Calibrate.zip";
protected static final int PEPTIDE_COUNT = 716;
protected static final double DELTA = 0.00001;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testHeatMapColorAndValues()
qcPlotsWebPart = new PanoramaDashboard(this).getQcPlotsWebPart();
qcPlotsWebPart.waitForReady();
assertEquals("Date Range Offset not set to default value", QCPlotsWebPart.DateRangeOffset.LAST_7_DAYS, qcPlotsWebPart.getCurrentDateRangeOffset());
qcPlotsWebPart.filterQCPlots("2013-08-10", "2013-08-15", 7);
qcPlotsWebPart.filterQCPlots("2013-08-10", "2013-08-15", true);

// Now navigate through the link instead of the custom tab and webpart
waitAndClickAndWait(Locator.linkContainingText("View all 47 replicates"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ public void testGuideSetPlotDisplay()
qcPlotsWebPart.setGroupXAxisValuesByDate(false);

// filter plot by start/end date to check reference points without training points in view
qcPlotsWebPart.filterQCPlots("2013-08-19", "2013-08-19", PRECURSORS.length);
qcPlotsWebPart.filterQCPlots("2013-08-19", "2013-08-19", true);
shapeCounts = new ArrayList<>();
shapeCounts.add(Pair.of(SvgShapes.CIRCLE.getPathPrefix(), 14));
qcPlotsWebPart = new QCPlotsWebPart(getDriver());
verifyGuideSetRelatedElementsForPlots(qcPlotsWebPart, 0, shapeCounts, 2);
}

Expand Down
20 changes: 11 additions & 9 deletions test/src/org/labkey/test/tests/targetedms/TargetedMSQCTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import static org.labkey.test.components.targetedms.QCPlotsWebPart.QCPlotType.MetricValue;
import static org.labkey.test.components.targetedms.QCPlotsWebPart.QCPlotType.MovingRange;
import static org.labkey.test.components.targetedms.QCPlotsWebPart.QCPlotType.TrailingCV;
import static org.labkey.test.components.targetedms.QCPlotsWebPart.QCPlotType.TrailingMean;
import static org.labkey.test.util.PermissionsHelper.READER_ROLE;

@Category({})
Expand Down Expand Up @@ -190,6 +189,9 @@ private void doInit()
public void preTest()
{
goToProjectHome();
PanoramaDashboard qcDashboard = new PanoramaDashboard(this);
QCPlotsWebPart qcPlotsWebPart = qcDashboard.getQcPlotsWebPart();
qcPlotsWebPart.revertToDefaultView();
}

@Test
Expand Down Expand Up @@ -346,7 +348,7 @@ public void testQCPlotInputsPersistence()
qcPlotsWebPart.setScale(QCPlotsWebPart.Scale.PERCENT_OF_MEAN);
qcPlotsWebPart.setGroupXAxisValuesByDate(true);
qcPlotsWebPart.setShowAllPeptidesInSinglePlot(true, 1);
qcPlotsWebPart.filterQCPlots(testDateStr, testDateStr, 1);
qcPlotsWebPart.filterQCPlots(testDateStr, testDateStr, true);
int count = qcPlotsWebPart.getPointElements("d", SvgShapes.CIRCLE.getPathPrefix(), true).size();
assertEquals("Unexpected number of points for '" + testDateStr + "'", 21, count);

Expand Down Expand Up @@ -543,10 +545,10 @@ public void testBadPlotDateRange()
QCPlotsWebPart qcPlotsWebPart = qcDashboard.getQcPlotsWebPart();
qcPlotsWebPart.filterQCPlotsToInitialData(PRECURSORS.length, true);

qcPlotsWebPart.filterQCPlots("2014-08-09", "2014-08-27", 0);

// reset to avoid test case dependency
qcPlotsWebPart.resetInitialQCPlotFields();
qcPlotsWebPart.filterQCPlots("2015-08-09", "2014-08-27", false);
waitForText("Please enter an end date that does not occur before the start date.");
qcPlotsWebPart.filterQCPlots("2014-08-09", "2014-08-27", false);
waitForText("There were no records found");
}

@Test
Expand Down Expand Up @@ -697,10 +699,10 @@ public void testRunScopedMetric()
String ticPlotSVGText = qcPlotsWebPart.getSVGPlotText("precursorPlot0");
assertFalse(ticPlotSVGText.isEmpty());

log("Verifying Show All Series Checkbox");
assertElementNotVisible(Locator.tagContainingText("label", "Show All Series in a Single Plot"));
log("Verifying combined/per-precursor plot controls");
assertFalse(qcPlotsWebPart.isCombinedPlotControlVisible());
qcPlotsWebPart.setMetric1Type(QCPlotsWebPart.MetricType.RETENTION);
assertElementVisible(Locator.tagContainingText("label", "Show All Series in a Single Plot"));
assertTrue(qcPlotsWebPart.isCombinedPlotControlVisible());

log("Verifying tic_area information in hover plot");
qcPlotsWebPart.setMetric1Type(QCPlotsWebPart.MetricType.TIC_AREA);
Expand Down
Loading