Skip to content

Commit

Permalink
Skyline: More screenshot tweaks (#3248)
Browse files Browse the repository at this point in the history
- FocusDocument and JiggleSelection for AbsoluteQuant and ExistingExperiments
- Moved JiggleSelection to AbstractFunctionalTest
- Made FormEx.ShowWithoutActivation conditional on not IsPauseForScreenShots
  • Loading branch information
brendanx67 authored Nov 28, 2024
1 parent 14db3eb commit feb07e1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions pwiz_tools/Skyline/TestTutorial/AbsoluteQuantTutorialTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ protected override void DoTest()

WaitForCondition(10 * 60 * 1000, // ten minutes
() => SkylineWindow.Document.Settings.HasResults && SkylineWindow.Document.Settings.MeasuredResults.IsLoaded);
FocusDocument();
PauseForScreenShot("Main window with imported data", 13);

// Analyzing SRM Data from FOXN1-GST Sample p. 14
Expand Down Expand Up @@ -242,6 +243,7 @@ protected override void DoTest()
});
RunUI(() => SkylineWindow.Size = new Size(1470, 656));
RestoreViewOnScreen(14);
FocusDocument();
PauseForScreenShot("Main window with Peak Areas, Retention Times and FOXN1-GST for light", 14);

RunUI(() => SkylineWindow.SelectedPath = SkylineWindow.DocumentUI.GetPathTo((int)SrmDocument.Level.TransitionGroups, 1));
Expand Down Expand Up @@ -357,6 +359,7 @@ protected override void DoTest()
calibrationFloatingWindow.Top = SkylineWindow.Top;
calibrationFloatingWindow.Left = SkylineWindow.Right + 20;
});
JiggleSelection(); // Otherwise, plot shows two legends
PauseForScreenShot<CalibrationForm>("View calibration curve", 18);
}

Expand Down
12 changes: 10 additions & 2 deletions pwiz_tools/Skyline/TestTutorial/ExistingExperimentsTutorialTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ private void DoMrmerTest()
SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SequenceTree.Nodes[0];
SkylineWindow.Size = new Size(1035, 511);
});
FocusDocument();
PauseForScreenShot("Main window with transitions added", 10);

FindNode("LWDVAT");
Expand Down Expand Up @@ -209,6 +210,7 @@ private void DoMrmerTest()
SkylineWindow.AutoZoomBestPeak();
SkylineWindow.SequenceTree.TopNode = SkylineWindow.SequenceTree.Nodes[5];
});
FocusDocument();
PauseForScreenShot("Main window with data imported", 13);

RunUI(() =>
Expand Down Expand Up @@ -456,6 +458,8 @@ private void DoStudy7Test()
FindNode("YEVQGEVFTKPQLWP");
}

FocusDocument();
JiggleSelection();
PauseForScreenShot("Main window with peaks and retention times showing", 27);
RunUI(SkylineWindow.EditDelete);
FindNode("IVGGWECEK"); // Not L10N
Expand Down Expand Up @@ -517,8 +521,8 @@ private void DoStudy7Test()
WaitForGraphs();
PauseForPeakAreaGraphScreenShot("Peak Areas graph metafile");


RunUI(() => SkylineWindow.NormalizeAreaGraphTo(NormalizeOption.TOTAL));
JiggleSelection();
PauseForPeakAreaGraphScreenShot("Peak Areas graph normalized metafile");

RunUI(() =>
Expand Down Expand Up @@ -613,13 +617,16 @@ private void DoStudy7Test()
RunUI(() =>
{
SkylineWindow.ShowGraphPeakArea(false);
SkylineWindow.Width = 920;
SkylineWindow.Width = 970;
SkylineWindow.ShowRTReplicateGraph();
});
// JiggleSelection();
PauseForRetentionTimeGraphScreenShot("Retention Times replicate graph metafile");

FindNode("INDISHTQSVSAK");
RunUI(SkylineWindow.ShowPeakAreaReplicateComparison);
RunUIForScreenShot(() => SkylineWindow.GraphPeakArea.Parent.Parent.Width = 720);
JiggleSelection();
PauseForPeakAreaGraphScreenShot("Peak Areas normalized to heave graph metafile");

if (IsCoverShotMode)
Expand All @@ -642,6 +649,7 @@ private void DoStudy7Test()

RunUI(() => SkylineWindow.NormalizeAreaGraphTo(NormalizeOption.NONE));
WaitForGraphs();
JiggleSelection();
PauseForPeakAreaGraphScreenShot("Peak Areas no normalization graph metafile");

FindNode(hgflprLight);
Expand Down
11 changes: 0 additions & 11 deletions pwiz_tools/Skyline/TestTutorial/GroupedStudies1TutorialTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,17 +544,6 @@ private void ExploreTopPeptides()
RunUI(SkylineWindow.EditDelete);
}

private static void JiggleSelection()
{
if (!IsPauseForScreenShots)
return;

// Node change apparently required to get x-axis labels in peak areas view the way they should be
RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.NextVisibleNode);
WaitForGraphs();
RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.PrevVisibleNode);
}

private void AddTruncatedPrecursorsView(DocumentGridForm documentGrid, bool initialTestExecution)
{
RunUI(() => documentGrid.ChooseView(Resources.SkylineViewContext_GetDocumentGridRowSources_Precursors));
Expand Down
11 changes: 11 additions & 0 deletions pwiz_tools/Skyline/TestUtil/TestFunctional.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,17 @@ protected static void FocusDocument()
RunUI(SkylineWindow.FocusDocument);
}

public static void JiggleSelection()
{
if (!IsPauseForScreenShots)
return;

// Node change apparently required to get x-axis labels in peak areas view the way they should be
RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.NextVisibleNode);
WaitForGraphs();
RunUI(() => SkylineWindow.SequenceTree.SelectedNode = SkylineWindow.SelectedNode.PrevVisibleNode);
}

protected static void SelectNode(SrmDocument.Level level, int iNode)
{
var pathSelect = SkylineWindow.Document.GetPathTo((int)level, iNode);
Expand Down
4 changes: 3 additions & 1 deletion pwiz_tools/Skyline/Util/FormEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ protected override void OnLoad(EventArgs e)

protected override bool ShowWithoutActivation
{
get { return Program.FunctionalTest || Program.SkylineOffscreen; }
// Avoid activating forms during test mode or when off-screen, but not when
// pausing to show Skyline as it normally functions.
get { return (Program.FunctionalTest || Program.SkylineOffscreen) && Program.PauseSeconds == 0; }
}

[Localizable(false)]
Expand Down

0 comments on commit feb07e1

Please sign in to comment.