From b61a0b618238f9d9f5a9fa45597300882d5f0613 Mon Sep 17 00:00:00 2001 From: Brendan MacLean Date: Sun, 24 Nov 2024 06:50:22 -0800 Subject: [PATCH] Skyline: Fixes for auto-screenshot mode for several tests - small molecules intro, method dev, quant, hi res - irt and spectral library explorer - fixed to preview English screenshots when no translation is available - improved default sizing of AddIrtPeptidesDlg to work better for all languages - fixed screenshot taking for any control in any form - SkylineTester improved to default tutorials to off and add Run (F5) and Stop (SHift-F5) shortcuts --- .../ImportTransitionListColumnSelectDlg.cs | 7 + .../Skyline/FileUI/OpenDataSourceDialog.cs | 5 + .../Irt/AddIrtPeptidesDlg.Designer.cs | 2 +- .../SettingsUI/Irt/AddIrtPeptidesDlg.ja.resx | 26 ++-- .../SettingsUI/Irt/AddIrtPeptidesDlg.resx | 26 ++-- .../Irt/AddIrtPeptidesDlg.zh-CHS.resx | 26 ++-- .../Skyline/SettingsUI/ViewLibraryDlg.cs | 1 + pwiz_tools/Skyline/SkylineGraphs.cs | 6 +- .../SkylineTesterWindow.Designer.cs | 2 + .../SkylineTester/SkylineTesterWindow.cs | 19 ++- .../TestPerf/HiResMetabolomicsTutorial.cs | 46 +++--- .../HiResMetabolomicsViews.data/cover.view | 144 ++++++++++++++++++ .../HiResMetabolomicsViews.data/p05.view | 35 +++++ .../HiResMetabolomicsViews.data/p09.view | 127 +++++++++++++++ .../HiResMetabolomicsViews.data/p14.view | 127 +++++++++++++++ .../HiResMetabolomicsViews.data/p15.view | 127 +++++++++++++++ .../TestPerf/HiResMetabolomicsViews.zip | Bin 6571 -> 0 bytes .../Skyline/TestTutorial/IrtTutorialTest.cs | 29 ++-- .../LibraryExplorerTutorialTest.cs | 32 +++- .../SmallMolMethodDevCEOptTutorial.cs | 37 ++--- .../SmallMoleculesQuantificationTutorial.cs | 24 ++- .../TestTutorial/SmallMoleculesTutorial.cs | 6 +- .../TestUtil/AbstractFunctionalTestEx.cs | 34 +++-- .../Skyline/TestUtil/ScreenshotManager.cs | 36 ++++- pwiz_tools/Skyline/TestUtil/TestFunctional.cs | 52 ++++++- 25 files changed, 838 insertions(+), 138 deletions(-) create mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/cover.view create mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p05.view create mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p09.view create mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p14.view create mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p15.view delete mode 100644 pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.zip diff --git a/pwiz_tools/Skyline/FileUI/ImportTransitionListColumnSelectDlg.cs b/pwiz_tools/Skyline/FileUI/ImportTransitionListColumnSelectDlg.cs index 0a772e305b7..734895fd0f6 100644 --- a/pwiz_tools/Skyline/FileUI/ImportTransitionListColumnSelectDlg.cs +++ b/pwiz_tools/Skyline/FileUI/ImportTransitionListColumnSelectDlg.cs @@ -1664,7 +1664,14 @@ private bool UpdateProteinAssociationState(AssociateProteinsMode mode) } #region testing support + public bool AssociateProteinsPreviewCompleted => checkBoxAssociateProteins.Checked && isAssociated; + + public void SetColumnWidth(int columnIndex, int width) + { + dataGrid.Columns[columnIndex].Width = width; + } + #endregion } diff --git a/pwiz_tools/Skyline/FileUI/OpenDataSourceDialog.cs b/pwiz_tools/Skyline/FileUI/OpenDataSourceDialog.cs index ada2ad26404..e579e91c0f1 100644 --- a/pwiz_tools/Skyline/FileUI/OpenDataSourceDialog.cs +++ b/pwiz_tools/Skyline/FileUI/OpenDataSourceDialog.cs @@ -284,6 +284,11 @@ public IEnumerable SelectedFiles } } + public void EnsureListViewItemVisible(int item) + { + listView.EnsureVisible(item); + } + public View ListView { get { return listView.View; } diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.Designer.cs b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.Designer.cs index 207e1572d20..0e4e5634da9 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.Designer.cs +++ b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.Designer.cs @@ -213,7 +213,7 @@ private void InitializeComponent() // // R // - this.R.FillWeight = 25F; + this.R.FillWeight = 20F; resources.ApplyResources(this.R, "R"); this.R.Name = "R"; this.R.ReadOnly = true; diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.ja.resx b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.ja.resx index f25d5ff55d5..20508998c41 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.ja.resx +++ b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.ja.resx @@ -129,7 +129,7 @@ - 497, 14 + 595, 14 75, 23 @@ -160,7 +160,7 @@ NoControl - 497, 44 + 595, 44 75, 23 @@ -199,7 +199,7 @@ ポイント数 - 32 + 80 True @@ -208,7 +208,7 @@ - 38 + 100 True @@ -217,7 +217,7 @@ R - 25 + 30 True @@ -232,7 +232,7 @@ 5, 73 - 481, 106 + 579, 106 3 @@ -280,7 +280,7 @@ 5, 306 - 481, 121 + 579, 121 5 @@ -323,7 +323,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 7, 32 - 437, 69 + 535, 69 1 @@ -449,7 +449,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 5, 185 - 481, 121 + 579, 121 4 @@ -492,7 +492,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 7, 32 - 437, 69 + 535, 69 1 @@ -576,7 +576,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 5, 427 - 481, 180 + 579, 180 6 @@ -702,7 +702,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 7, 19 - 437, 56 + 535, 56 1 @@ -714,7 +714,7 @@ MS/MSスキャンから計算されたより新しいiRT値は無視されます 6, 13 - 584, 613 + 682, 613 CenterParent diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.resx b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.resx index 5e32e3a54a3..9b83925dac7 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.resx +++ b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.resx @@ -129,7 +129,7 @@ - 497, 14 + 595, 14 75, 23 @@ -160,7 +160,7 @@ NoControl - 497, 44 + 595, 44 75, 23 @@ -199,7 +199,7 @@ Points - 24 + 30 True @@ -208,7 +208,7 @@ Equation - 38 + 100 True @@ -217,7 +217,7 @@ R - 25 + 30 True @@ -232,7 +232,7 @@ 5, 73 - 481, 106 + 579, 106 3 @@ -280,7 +280,7 @@ 5, 306 - 481, 121 + 579, 121 5 @@ -323,7 +323,7 @@ and newer iRT values calculated from MS/MS scans ignored: 7, 32 - 437, 69 + 535, 69 1 @@ -449,7 +449,7 @@ and newer iRT values calculated from MS/MS scans ignored: 5, 185 - 481, 121 + 579, 121 4 @@ -492,7 +492,7 @@ with iRT values calculated from chromatogram peaks: 7, 32 - 437, 69 + 535, 69 1 @@ -576,7 +576,7 @@ with iRT values calculated from chromatogram peaks: 5, 427 - 481, 180 + 579, 180 6 @@ -702,7 +702,7 @@ with iRT values calculated from chromatogram peaks: 7, 19 - 437, 56 + 535, 56 1 @@ -714,7 +714,7 @@ with iRT values calculated from chromatogram peaks: 6, 13 - 584, 613 + 682, 613 CenterParent diff --git a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.zh-CHS.resx b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.zh-CHS.resx index 6380823f8a6..d105b38a6cf 100644 --- a/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.zh-CHS.resx +++ b/pwiz_tools/Skyline/SettingsUI/Irt/AddIrtPeptidesDlg.zh-CHS.resx @@ -129,7 +129,7 @@ - 497, 14 + 595, 14 75, 23 @@ -160,7 +160,7 @@ NoControl - 497, 44 + 595, 44 75, 23 @@ -199,7 +199,7 @@ - 32 + 30 True @@ -208,7 +208,7 @@ 方程式 - 38 + 100 True @@ -217,7 +217,7 @@ R - 25 + 30 True @@ -232,7 +232,7 @@ 5, 73 - 481, 106 + 579, 106 3 @@ -280,7 +280,7 @@ 5, 306 - 481, 121 + 579, 121 5 @@ -323,7 +323,7 @@ 7, 32 - 437, 69 + 535, 69 1 @@ -449,7 +449,7 @@ 5, 185 - 481, 121 + 579, 121 4 @@ -492,7 +492,7 @@ 7, 32 - 437, 69 + 535, 69 1 @@ -576,7 +576,7 @@ 5, 427 - 481, 180 + 579, 180 6 @@ -702,7 +702,7 @@ 7, 19 - 437, 56 + 535, 56 1 @@ -714,7 +714,7 @@ 6, 13 - 584, 613 + 682, 613 CenterParent diff --git a/pwiz_tools/Skyline/SettingsUI/ViewLibraryDlg.cs b/pwiz_tools/Skyline/SettingsUI/ViewLibraryDlg.cs index a2bd0fd22e5..908305553f2 100644 --- a/pwiz_tools/Skyline/SettingsUI/ViewLibraryDlg.cs +++ b/pwiz_tools/Skyline/SettingsUI/ViewLibraryDlg.cs @@ -137,6 +137,7 @@ private MSGraphControl GraphControl get { return msGraphExtension1.Graph; } } + public Control ListControl => listPeptide; /// /// Constructor for the View Library dialog. diff --git a/pwiz_tools/Skyline/SkylineGraphs.cs b/pwiz_tools/Skyline/SkylineGraphs.cs index 11276dfb6dc..c41428a9464 100644 --- a/pwiz_tools/Skyline/SkylineGraphs.cs +++ b/pwiz_tools/Skyline/SkylineGraphs.cs @@ -470,7 +470,6 @@ public void UpdateGraphSpectrumEnabled() private void RemoveGraphChromFromList(GraphChromatogram graphChrom) { - _listGraphChrom.Remove(graphChrom); DestroyGraphChrom(graphChrom); } @@ -517,9 +516,8 @@ private void LoadLayoutLocked(Stream layoutStream) DestroyImmediateWindow(); HideFindResults(true); - foreach (GraphChromatogram graphChrom in _listGraphChrom) + foreach (var graphChrom in _listGraphChrom.ToArray()) DestroyGraphChrom(graphChrom); - _listGraphChrom.Clear(); DestroyGraphFullScan(); dockPanel.LoadFromXml(layoutStream, DeserializeForm); // SequenceTree resizes often prior to display, so we must restore its scrolling after @@ -1948,6 +1946,8 @@ private GraphChromatogram CreateGraphChrom(string name) private void DestroyGraphChrom(GraphChromatogram graphChrom) { + _listGraphChrom.Remove(graphChrom); + // Detach event handlers and dispose graphChrom.FormClosed -= graphChromatogram_FormClosed; graphChrom.PickedPeak -= graphChromatogram_PickedPeak; diff --git a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.Designer.cs b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.Designer.cs index cc9fb297d3b..13a937c3cdb 100644 --- a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.Designer.cs +++ b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.Designer.cs @@ -3312,12 +3312,14 @@ private void InitializeComponent() this.Controls.Add(this.mainPanel); this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MainMenuStrip = this.menuStrip1; this.Margin = new System.Windows.Forms.Padding(4); this.MinimumSize = new System.Drawing.Size(700, 700); this.Name = "SkylineTesterWindow"; this.Text = "Skyline Tester"; this.Load += new System.EventHandler(this.SkylineTesterWindow_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SkylineTesterWindow_KeyDown); this.Move += new System.EventHandler(this.SkylineTesterWindow_Move); this.Resize += new System.EventHandler(this.SkylineTesterWindow_Resize); this.mainPanel.ResumeLayout(false); diff --git a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs index 6d88a0c6a26..ba778868abf 100644 --- a/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs +++ b/pwiz_tools/Skyline/SkylineTester/SkylineTesterWindow.cs @@ -426,8 +426,9 @@ private void BackgroundLoad(object sender, DoWorkEventArgs e) tutorialsTree.Nodes.Clear(); tutorialsTree.Nodes.Add(new TreeNode("Tutorial tests", tutorialNodes)); tutorialsTree.ExpandAll(); - tutorialsTree.Nodes[0].Checked = true; - TabTests.CheckAllChildNodes(tutorialsTree.Nodes[0], true); + // More common to choose just one tutorial to run on the tutorials tab + // tutorialsTree.Nodes[0].Checked = true; + // TabTests.CheckAllChildNodes(tutorialsTree.Nodes[0], true); // Add forms to forms tree view. _tabForms.CreateFormsGrid(); @@ -1995,5 +1996,19 @@ private void runMode_SelectedIndexChanged(object sender, EventArgs e) } #endregion Control events + + private void SkylineTesterWindow_KeyDown(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + if (e.Shift) + Stop(); + else + Run(); + e.Handled = true; + break; + } + } } } diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs index 82848d7fd62..b8037afb430 100644 --- a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsTutorial.cs @@ -19,10 +19,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using pwiz.Common.DataBinding; -using pwiz.Skyline; using pwiz.Skyline.Controls; using pwiz.Skyline.Controls.Databinding; -using pwiz.Skyline.Controls.SeqNode; using pwiz.Skyline.FileUI; using pwiz.Skyline.Model; using pwiz.Skyline.Model.DocSettings; @@ -41,6 +39,7 @@ using System.Linq; using System.Windows.Forms; using pwiz.Skyline.Alerts; +using pwiz.Skyline.Controls.Graphs.Calibration; namespace TestPerf // This would be in TestTutorials if it didn't involve a 2GB download { @@ -121,16 +120,20 @@ protected override void DoTest() var importDialog = ShowDialog(SkylineWindow.ShowPasteTransitionListDlg); - RunUI(() => importDialog.Size = new Size(600, 300)); + RunUIForScreenShot(() => ResizeFormOnScreen(importDialog, 600, 300)); PauseForScreenShot("Insert Transition List ready to accept paste of transition list", 6); var text = GetCsvFileText(GetTestPath("PUFA_TransitionList.csv")); var col4Dlg = ShowDialog(() => importDialog.TransitionListText = text); - RunUI(() => { - col4Dlg.radioMolecule.PerformClick(); + RunUI(col4Dlg.radioMolecule.PerformClick); + RunUIForScreenShot(() => + { + col4Dlg.SetColumnWidth(0, 120); // To show "Molecule List Name" fully + col4Dlg.SetColumnWidth(1, 125); // To show the precursor names fully + col4Dlg.SetColumnWidth(2, 120); // To show "Molecule Formula" fully + col4Dlg.SetColumnWidth(5, 135); // To reduce wrapping to just 2 rows }); - PauseForScreenShot("Insert Transition List column picker", 6); var errDlg = ShowDialog(col4Dlg.CheckForErrors); @@ -144,7 +147,7 @@ protected override void DoTest() OkDialog(col4Dlg, col4Dlg.OkDialog); var autoSelectDlg = WaitForOpenForm(); - PauseForScreenShot("Auto-select query", 8); + PauseForScreenShot("Auto-select query", 8); OkDialog(autoSelectDlg, autoSelectDlg.OkDialog); docTargets = WaitForDocumentChange(docTargets); @@ -160,21 +163,14 @@ protected override void DoTest() }); RestoreViewOnScreen(5); - PauseForScreenShot("Skyline with 14 transition - show the right-click menu for setting DHA to be a surrogate standard", 9); + PauseForScreenShot("Skyline with 14 transition - show the right-click menu for setting DHA to be a surrogate standard", 9); // Set the standard type of the surrogate standards to StandardType.SURROGATE_STANDARD - RunUI(() => - { - List pathsToSelect = SkylineWindow.SequenceTree.Nodes.OfType() - .SelectMany(peptideGroup => peptideGroup.Nodes.OfType()) - .Where(peptideTreeNode => peptideTreeNode.DocNode.RawTextId.Contains("(DHA)")) - .Select(treeNode => treeNode.Path) - .ToList(); - SkylineWindow.SequenceTree.SelectedPaths = pathsToSelect; - SkylineWindow.SetStandardType(StandardType.SURROGATE_STANDARD); - }); - + SelectNode(SrmDocument.Level.Molecules, 3); + // TODO: Show right-click menu with "Surrogate Standard" selected + RunUI(() => SkylineWindow.SetStandardType(StandardType.SURROGATE_STANDARD)); + PauseForScreenShot("Skyline with 4 molecules and one set as surrogate standard"); RunUI(() => SkylineWindow.SaveDocument(GetTestPath("FattyAcids_demo.sky"))); using (new WaitDocumentChange(1, true)) @@ -189,14 +185,13 @@ protected override void DoTest() }); PauseForScreenShot("Import Results Files form", 10); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); - OkDialog(importResultsDlg1,importResultsDlg1.OkDialog); } SelectNode(SrmDocument.Level.Molecules, 0); SelectNode(SrmDocument.Level.MoleculeGroups, 0); - - PauseForScreenShot("Skyline window multi-target graph", 11); + RunUI(SkylineWindow.CollapsePrecursors); + PauseForScreenShot("Skyline window multi-target graph", 11); var docResults = SkylineWindow.Document; @@ -239,7 +234,7 @@ protected override void DoTest() RunUI(() => documentGrid.DataboundGridControl.ChooseView(new ViewName(ViewGroup.BUILT_IN.Id, Resources.SkylineViewContext_GetDocumentGridRowSources_Molecules))); } - PauseForScreenShot("Skyline window multi-replicate layout", 12); + PauseForScreenShot("Skyline window multi-replicate layout", 12); if (IsCoverShotMode) { @@ -277,7 +272,7 @@ protected override void DoTest() RunUI(() => { - peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Quantification - 2; + peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Quantification; peptideSettingsUI.QuantRegressionFit = RegressionFit.LINEAR_THROUGH_ZERO; peptideSettingsUI.QuantNormalizationMethod = new NormalizationMethod.RatioToLabel(IsotopeLabelType.heavy); @@ -348,9 +343,8 @@ protected override void DoTest() RunUI(() => SkylineWindow.ShowCalibrationForm()); SelectNode(SrmDocument.Level.Molecules, 0); WaitForGraphs(); - PauseForScreenShot("Calibration curve", 15); + PauseForScreenShot("Calibration curve", 15); } - } } } diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/cover.view b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/cover.view new file mode 100644 index 00000000000..ba215d235ef --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/cover.view @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p05.view b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p05.view new file mode 100644 index 00000000000..ba99a7c01f6 --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p05.view @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p09.view b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p09.view new file mode 100644 index 00000000000..df3d9822ec8 --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p09.view @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p14.view b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p14.view new file mode 100644 index 00000000000..56d233e224b --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p14.view @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p15.view b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p15.view new file mode 100644 index 00000000000..bbb3176a23e --- /dev/null +++ b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.data/p15.view @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.zip b/pwiz_tools/Skyline/TestPerf/HiResMetabolomicsViews.zip deleted file mode 100644 index 0aefcde977670a2971f9a3c71b17ea79cce7bd7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6571 zcmb`LcQjmWyT;WBLUhqv^pfbEDAA+F1QQ}UWAr|H^fr@_L9_&82%?T&UJ0W2ZV)Xp zdKdk8^L^hr&iT&y@9e$Sb+2ddwSN1L{jBS`?@M1B7mo@H3+pb{nGRCFFivLG3LgtA z;t3WO(alq9S07ssAsR8(L-8 zBA$b1{Py|L_t0_XA*Z962hcRub=ms7Zz^_cWpF2`L305^nOLau3KLP_rN!c)Y~7$s zt2xZM&+p z#G6Axn8KMhtCeDnT#RGYPKA9BbKT*V51@`H@h!on?j4YqBdgw}6Bnla(*ea}}W& z>J$C6O*XJrPX3nOWK{#tIhKek+qp?kKisAfCSFLq28)En%SOwIbkqXek|Izi8*hJz z_3-^Bt^P?=!=_uxO7bJb;*C{Ybw&V&It93E??!o6-Qwy1C0TPf39u(hqO@efB1BBd z;G(66rkL&7))b1}F{>|s$_|+jxUiVzJPwC`^Wo<8Op0x?YbsQADk3dedaSCxxu-me z?2_*kPgEnGx`>+6J3M{Rckz*YtwQjTK5|!`hnO%wb-JI^ZZyfd8i z5Jmd*q0O^}^_PMKd>Cl+FN6uNnbsaB!~CNFO?dY|l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w`GG!oRuOv9Yj*Y5!jR2lpXff&c&j diff --git a/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs index a2572eafb7d..0583390327d 100644 --- a/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/IrtTutorialTest.cs @@ -110,7 +110,7 @@ protected override void DoTest() }); // Page 3. - PauseForScreenShot("RT graph metafile", 3); // Peptide RT graph + PauseForRetentionTimeGraphScreenShot("RT graph metafile", 3); // Peptide RT graph RunUI(() => { @@ -224,7 +224,7 @@ protected override void DoTest() WaitForRegression(); RestoreViewOnScreen(9); - PauseForScreenShot("Retention Times Regression graph metafile", 9); // RT Regression graph + PauseForRetentionTimeGraphScreenShot("Retention Times Regression graph metafile", 9); // RT Regression graph RunUI(() => { @@ -261,7 +261,7 @@ protected override void DoTest() WaitForProteinMetadataBackgroundLoaderCompletedUI(); // let peptide metadata background loader do its work RestoreViewOnScreen(10); - PauseForScreenShot("Targets tree clipped out of main window", 10); // Target tree + PauseForTargetsScreenShot("Targets tree clipped out of main window"); // Target tree RunUI(() => { @@ -298,7 +298,7 @@ protected override void DoTest() regressionDlg.SetTimeWindow(5); }); - PauseForScreenShot("Edit Retention Time Predictor form", 11); // Edit retention time predictor form + PauseForScreenShot("Edit Retention Time Predictor form", 11); // Edit retention time predictor form OkDialog(regressionDlg, regressionDlg.OkDialog); OkDialog(peptideSettingsUI1, peptideSettingsUI2.OkDialog); @@ -333,7 +333,7 @@ protected override void DoTest() RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 14); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 14); RunUI(() => { @@ -389,11 +389,11 @@ protected override void DoTest() if (i == 1) { - PauseForScreenShot("Chromatogram graph metafile (1 of 2)", 16); // Chromatogram graph + PauseForChromGraphScreenShot("Chromatogram graph metafile (1 of 2)"); // Chromatogram graph } if (i == 2) { - PauseForScreenShot("Chromatogram graph metafile (2 of 2)", 16); + PauseForChromGraphScreenShot("Chromatogram graph metafile (2 of 2)"); } if (i == 3) { @@ -464,7 +464,7 @@ protected override void DoTest() // Check the RT regression, p. 19 WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 19); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 19); RunUI(() => { @@ -509,7 +509,7 @@ protected override void DoTest() // Verify regression graph, p. 19 RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 22); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 22); RunUI(() => { VerifyRTRegression(0.40, 24.77, 0.9998); @@ -525,7 +525,7 @@ protected override void DoTest() }); WaitForGraphs(); - PauseForScreenShot("RT Scheduling graph metafile", 23); + PauseForRetentionTimeGraphScreenShot("RT Scheduling graph metafile", 23); // Export new 90-minute scheduled transition list, p. 22 const string scheduledBasename = "iRT Human+Standard"; // Not L10N @@ -560,7 +560,7 @@ protected override void DoTest() RunUI(SkylineWindow.ShowRTRegressionGraphScoreToRun); WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 26); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 26); // Review regression and outliers, p. 24 RunUI(() => @@ -574,8 +574,9 @@ protected override void DoTest() thresholdDlg.Threshold = 0.998; thresholdDlg.OkDialog(); }); + WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 27); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 27); // Verify 2 outliers highlighted and removed, p. 25 WaitForConditionUI(() => SkylineWindow.RTGraphController.Outliers.Length == 2); @@ -588,7 +589,7 @@ protected override void DoTest() }); WaitForRegression(); - PauseForScreenShot("RT Regression graph metafile", 28); + PauseForRetentionTimeGraphScreenShot("RT Regression graph metafile", 28); if (IsCoverShotMode) { @@ -648,7 +649,7 @@ protected override void DoTest() }); WaitForGraphs(); - PauseForScreenShot("Chromatogram graph metafile", 29); // Chromatogram graph + PauseForChromGraphScreenShot("Chromatogram graph metafile"); // Chromatogram graph RunUI(() => { diff --git a/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs b/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs index f1b530dcbc7..e6dc972a581 100644 --- a/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs +++ b/pwiz_tools/Skyline/TestTutorial/LibraryExplorerTutorialTest.cs @@ -20,9 +20,9 @@ using System.Drawing; using System.IO; using System.Linq; +using System.Windows.Forms; using Microsoft.VisualStudio.TestTools.UnitTesting; using pwiz.Common.SystemUtil; -using pwiz.Skyline.Controls.Graphs; using pwiz.Skyline.Model; using pwiz.Skyline.Model.Lib; using pwiz.Skyline.Model.Proteome; @@ -111,7 +111,7 @@ protected override void DoTest() viewLibraryDlg.FilterString = "Q"; // Not L10N Assert.AreEqual(7, viewLibraryDlg.PeptideDisplayCount); }); - PauseForScreenShot("Library Explorere filtered for peptides beginning with Q", 6); + PauseForScreenShot("Library Explorer filtered for peptides beginning with Q", 6); RunUI(() => { @@ -174,7 +174,14 @@ protected override void DoTest() Assert.IsTrue(WaitForCondition(() => SkylineWindow.Document.Settings.PeptideSettings.Modifications.StaticModifications.Count > 0 && SkylineWindow.Document.Settings.PeptideSettings.Modifications.AllHeavyModifications.Any())); - PauseForScreenShot("Peptide list clipped from Library Explorer", 11); + RunUIForScreenShot(() => + { + // CONSIDER: Find a way to scroll without changing selection. SetScrollPos does not work on the list + int entryCount = viewLibraryDlg.PeptideDisplayCount; + viewLibraryDlg.SelectedIndex = entryCount - 1; + viewLibraryDlg.SelectedIndex = entryCount - 19; + }); + PauseForScreenShot(viewLibraryDlg.ListControl,"Peptide list clipped from Library Explorer", 11); if (IsCoverShotMode) { @@ -230,7 +237,15 @@ protected override void DoTest() SkylineWindow.Size = new Size(918, 553); }); RestoreViewOnScreen(12); + Point locationSaved = Point.Empty; + RunUIForScreenShot(() => + { + // Move the library explorer out of the way for the screenshot + locationSaved = viewLibraryDlg.Location; + viewLibraryDlg.Location = new Point(SkylineWindow.Right + 20, SkylineWindow.Top); + }); PauseForScreenShot("Main window", 12); + RunUIForScreenShot(() => viewLibraryDlg.Location = locationSaved); // Adding DNAGAATEEFIKR++ (has ok) const string peptideSequence3 = "DNAGAATEEFIKR"; // Not L10N @@ -321,13 +336,13 @@ protected override void DoTest() Assert.AreEqual(2, viewLibraryDlg1.PeptideDisplayCount); Assert.AreEqual(countLabels1, viewLibraryDlg1.GraphItem.IonLabels.Count()); }); - PauseForScreenShot("Spectrum graph metafile", 16); // p. 16, figure 1a + PauseForGraphScreenShot("Spectrum graph metafile", viewLibraryDlg1.GraphExtensionControl, 16); // p. 16, figure 1a RunUI(() => { viewLibraryDlg1.SelectedIndex = 1; Assert.AreEqual(countLabels2, viewLibraryDlg1.GraphItem.IonLabels.Count()); }); - PauseForScreenShot("Spectrum graph metafile", 16); // p. 16, figure 1b + PauseForGraphScreenShot("Spectrum graph metafile", viewLibraryDlg1.GraphExtensionControl, 16); // p. 16, figure 1b docInitial = SkylineWindow.Document; @@ -364,7 +379,7 @@ protected override void DoTest() Assert.IsTrue(labelsPhospho.Contains(label => label.Contains(string.Format("{0} {1}", IonType.precursor.GetLocalizedString(), lossText)))); Assert.AreEqual(countLabels1 + countLossLabels1 + countPrecursors1, labelsPhospho.Count); }); - PauseForScreenShot("Spectrum graph metafile", 18); // p. 18, figure 1a. + PauseForGraphScreenShot("Spectrum graph metafile", viewLibraryDlg1.GraphExtensionControl, 18); // p. 18, figure 1a. RunUI(() => { @@ -374,7 +389,7 @@ protected override void DoTest() Assert.IsTrue(labelsPhospho.Contains(label => label.Contains(string.Format("{0} {1}", IonType.precursor.GetLocalizedString(), lossText)))); Assert.AreEqual(countLabels2 + countLossLabels2 + countPrecursors2, labelsPhospho.Count); }); - PauseForScreenShot("Spectrum graph metafile", 18); // p. 18, figure 1b. + PauseForGraphScreenShot("Spectrum graph metafile", viewLibraryDlg1.GraphExtensionControl, 18); // p. 18, figure 1b. // Matching Library Peptides to Proteins p. 18 var peptideSettingsUI3 = ShowDialog(SkylineWindow.ShowPeptideSettingsUI); @@ -432,7 +447,7 @@ protected override void DoTest() { var msgDlg = ShowDialog(filterMatchedPeptidesDlg.OkDialog); - PauseForScreenShot("Message form", 20); // p. 20, figure 2 + PauseForScreenShot("Message form", 20); // p. 20, figure 2 OkDialog(msgDlg, msgDlg.Btn1Click); } @@ -443,6 +458,7 @@ protected override void DoTest() AssertEx.IsDocumentState(docProteins, null, 250, 346, 347, 1041); RestoreViewOnScreen(21); + RunUIForScreenShot(() => SkylineWindow.SequenceTree.SetScrollPos(Orientation.Horizontal, 0)); PauseForScreenShot("Main window", 21); OkDialog(viewLibraryDlg, viewLibraryDlg.Close); diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs index 1b347d42ac7..97c8152b493 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs @@ -23,7 +23,6 @@ using System.IO; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; -using pwiz.Skyline; using pwiz.Skyline.Controls; using pwiz.Skyline.Controls.Databinding; using pwiz.Skyline.Controls.Graphs; @@ -45,7 +44,7 @@ namespace pwiz.SkylineTestTutorial { [TestClass] - public class SmallMolMethodDevCEOptTutorialTest : AbstractFunctionalTest + public class SmallMolMethodDevCEOptTutorialTest : AbstractFunctionalTestEx { protected override bool UseRawFiles { @@ -90,6 +89,7 @@ protected override void DoTest() SetCsvFileClipboardText(GetTestPath("Energy_TransitionList.csv")); var confirmHeadersDlg = ShowDialog(SkylineWindow.Paste); + RunUIForScreenShot(() => ResizeFormOnScreen(confirmHeadersDlg, 1070, null)); PauseForScreenShot("Confirming column headers", 5); OkDialog(confirmHeadersDlg, confirmHeadersDlg.OkDialog); @@ -98,7 +98,7 @@ protected override void DoTest() AdjustSequenceTreePanelWidth(); }); - PauseForScreenShot("Main window after paste from csv", 5); + PauseForScreenShot("Main window after paste from csv", 5); var docTargets = WaitForDocumentChange(doc); @@ -181,14 +181,16 @@ protected override void DoTest() SelectNode(SrmDocument.Level.Molecules, 0); SelectNode(SrmDocument.Level.MoleculeGroups, 0); + FocusDocument(); - PauseForScreenShot("Skyline window multi-target graph", 13); + PauseForScreenShot("Skyline window multi-target graph", 13); // Renaming replicates { var manageResultsDlg = ShowDialog(SkylineWindow.ManageResults); string[] repNames = new[] { "2 min", "5 min" }; RunUI(() => manageResultsDlg.Left = SkylineWindow.Right + 50); + RunUIForScreenShot(() => manageResultsDlg.Width += 40); // Easier to get both forms if this is wider for (var i = 0; i < 2; i++) { doc = SkylineWindow.Document; @@ -202,13 +204,14 @@ protected override void DoTest() var renameDlg = ShowDialog(manageResultsDlg.RenameResult); RunUI(() => renameDlg.ReplicateName = repNames[i]); if (i == 0) - PauseForScreenShot("Manage Results and Rename Replicate (PrtScn and select in Paint)", 14); + PauseForScreenShot("Manage Results and Rename Replicate (PrtScn and select in Paint)", 14); OkDialog(renameDlg, renameDlg.OkDialog); } OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); } - PauseForScreenShot("Skyline window (renamed)", 15); + FocusDocument(); + PauseForScreenShot("Skyline window (renamed)", 15); var docResults = SkylineWindow.Document; @@ -241,7 +244,7 @@ protected override void DoTest() AdjustSequenceTreePanelWidth(true); }); - PauseForScreenShot("Skyline window multi-replicate layout", 16); + PauseForScreenShot("Skyline window multi-replicate layout", 16); // Set zoom to show better peak separation in 5 minute run for (var i = 0; i < 2; i++) @@ -250,7 +253,7 @@ protected override void DoTest() RunUI(() => SkylineWindow.GraphChromatograms.ToArray()[i].ZoomTo(.8, 1.8, 1.39e+8)); WaitForGraphs(); } - PauseForScreenShot("Skyline window showing relative peak separation", 17); + PauseForScreenShot("Skyline window showing relative peak separation", 17); // Set time window { @@ -258,7 +261,7 @@ protected override void DoTest() RunUI(() => { // ReSharper disable once RedundantCast - peptideSettingsDlg.SelectedTab = (PeptideSettingsUI.TABS)0; //regular enum does not work because of the hidden tabs in the Small Molecule mode. + peptideSettingsDlg.SelectedTab = PeptideSettingsUI.TABS.Prediction; //regular enum does not work because of the hidden tabs in the Small Molecule mode. peptideSettingsDlg.TimeWindow = 1; }); PauseForScreenShot("Setting scheduled transition list time window", 18); @@ -312,7 +315,7 @@ protected override void DoTest() var manageResultsDlg = ShowDialog(SkylineWindow.ManageResults); SelectReplicate(manageResultsDlg, 0); - PauseForScreenShot("Manage Results removing 2 min", 21); + PauseForScreenShot("Manage Results removing 2 min", 21); RunUI(manageResultsDlg.RemoveReplicates); @@ -326,7 +329,7 @@ protected override void DoTest() }); } - PauseForScreenShot("Manage Results replicate renamed", 22); + PauseForScreenShot("Manage Results replicate renamed", 22); OkDialog(manageResultsDlg, manageResultsDlg.OkDialog); } @@ -340,7 +343,7 @@ protected override void DoTest() molNode.Nodes[1].Expand(); SkylineWindow.ArrangeGraphsTabbed(); }); - PauseForScreenShot("Skyline window with calibration data", 23); + PauseForScreenShot("Skyline window with calibration data", 23); // Linearity var documentGrid = ShowDialog(() => SkylineWindow.ShowDocumentGrid(true)); @@ -368,7 +371,7 @@ protected override void DoTest() RunUI(() => { // ReSharper disable once RedundantCast - peptideSettingsUI.SelectedTab = (PeptideSettingsUI.TABS)3; + peptideSettingsUI.SelectedTab = PeptideSettingsUI.TABS.Quantification; peptideSettingsUI.QuantRegressionFit = RegressionFit.LINEAR; peptideSettingsUI.QuantNormalizationMethod = new NormalizationMethod.RatioToLabel(IsotopeLabelType.heavy); @@ -453,7 +456,7 @@ protected override void DoTest() OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); } - PauseForScreenShot("Skyline shows new replicate \"CE Optimization\"", 32); + PauseForScreenShot("Skyline shows new replicate \"CE Optimization\"", 32); RunUI(() => { SkylineWindow.Size = new Size(1600, 960); @@ -463,19 +466,19 @@ protected override void DoTest() SkylineWindow.ShowSingleTransition(); SkylineWindow.ShowSplitChromatogramGraph(true); }); - PauseForScreenShot("Split graph", 33); + PauseForScreenShot("Split graph", 33); RunUI(() => { SkylineWindow.ShowPeakAreaLegend(false); }); - PauseForScreenShot("No legend", 34); + PauseForScreenShot("No legend", 34); TestAsymmetricOptimization(); // Show Pentose-P SelectNode(SrmDocument.Level.Molecules, 6); - PauseForScreenShot("Pentose-P", 35); + PauseForScreenShot("Pentose-P", 35); if (IsCoverShotMode) { diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs index 92c9e15459c..44d40b4774d 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs @@ -92,10 +92,9 @@ protected override void DoTest() var doc = SkylineWindow.Document; var importDialog = ShowDialog(SkylineWindow.ShowPasteTransitionListDlg); - RunUI(() => importDialog.Size = new Size(600, 300)); + RunUIForScreenShot(() => ResizeFormOnScreen(importDialog, 600, 300)); PauseForScreenShot("Insert Transition List form", 4); - var text = "DrugX,Drug,light,283.04,1,129.96,1,26,16,2.7\r\nDrugX,Drug,heavy,286.04,1,133.00,1,26,16,2.7\r\n"; text = text.Replace(',', TextUtil.CsvSeparator).Replace(".", LocalizationHelper.CurrentCulture.NumberFormat.NumberDecimalSeparator); var col4Dlg = ShowDialog(() => importDialog.TransitionListText = text); @@ -326,6 +325,8 @@ protected override void DoTest() documentGrid.DataGridView.SendPaste(); }); + RunUIForScreenShot(() => ResizeFloatingFrame(documentGrid, null, 857)); + //SetDocumentGridSampleTypesAndConcentrations(sampleTypes); PauseForScreenShot("Document Grid - sample types - enlarge for screenshot so rows 95_0_1_1_00_1021523636 to end can be seen", 22); foreach (var chromatogramSet in SkylineWindow.Document.MeasuredResults.Chromatograms) @@ -365,7 +366,7 @@ protected override void DoTest() PauseForScreenShot("Custom document grid -scroll to end so same rows are in screenshot", 23); SetDocumentGridExcludeFromCalibration(); - PauseForScreenShot("Calibration Curve - outliers disabled", 24); + PauseForGraphScreenShot("Calibration Curve - outliers disabled", 24); if (IsCoverShotMode) { @@ -401,7 +402,8 @@ protected override void DoTest() documentGrid.DataGridView.Sort(colReplicate, ListSortDirection.Ascending); }); - PauseForScreenShot("Document Grid - Molecule Ratio Results - manually widen to show all columns", 25); + RunUIForScreenShot(() => ResizeFloatingFrame(documentGrid, 780, null)); + PauseForScreenShot("Document Grid - Molecule Ratio Results", 25); RunUI(() => { Settings.Default.CalibrationCurveOptions = Settings.Default.CalibrationCurveOptions @@ -410,7 +412,7 @@ protected override void DoTest() }); var calibrationForm = FindOpenForm(); - RunUI(()=>calibrationForm.UpdateUI(false)); + RunUI(() => calibrationForm.UpdateUI(false)); PauseForScreenShot("Calibration Curve: Log", 26); } @@ -436,8 +438,16 @@ private void ImportReplicates(bool isFirstPass) RunUI(() => { openDataSourceDialog1.CurrentDirectory = new MsDataFilePath(GetTestPath()); - openDataSourceDialog1.SelectAllFileType(ExtWatersRaw, - path => isFirstPass ? firstPassMatches.Any(path.Contains) : !firstPassMatches.Any(path.Contains)); + openDataSourceDialog1.SelectAllFileType(ExtWatersRaw, path => isFirstPass + ? firstPassMatches.Any(path.Contains) + : !firstPassMatches.Any(path.Contains)); + }); + RunUIForScreenShot(() => + { + openDataSourceDialog1.Size = new Size(800, 430); + int lastIndex = openDataSourceDialog1.ListItemNames.Count() - 1; + openDataSourceDialog1.EnsureListViewItemVisible(lastIndex); + openDataSourceDialog1.EnsureListViewItemVisible(lastIndex - 46); }); if (isFirstPass) { diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs index 19bd6f5afaf..dc2c8f81cea 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs @@ -156,7 +156,7 @@ protected override void DoTest() openDataSourceDialog1.CurrentDirectory = new MsDataFilePath(GetTestPath()); openDataSourceDialog1.SelectAllFileType(ExtWatersRaw); }); - PauseForScreenShot("Import Results Files form", 7); + PauseForScreenShot("Import Results Files form", 7); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); var importResultsNameDlg = ShowDialog(importResultsDlg1.OkDialog); @@ -165,7 +165,7 @@ protected override void DoTest() SelectNode(SrmDocument.Level.MoleculeGroups, 0); - PauseForScreenShot("Skyline window multi-target graph", 9); + PauseForScreenShot("Skyline window multi-target graph", 9); var docResults = SkylineWindow.Document; @@ -204,7 +204,7 @@ protected override void DoTest() if (!string.IsNullOrEmpty(msg)) Assert.IsTrue(string.IsNullOrEmpty(msg), msg); RestoreViewOnScreen(9); - PauseForScreenShot("Skyline window multi-replicate layout", 10); + PauseForScreenShot("Skyline window multi-replicate layout", 10); if (IsCoverShotMode) { diff --git a/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs b/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs index 945599088c8..8d0068cea90 100644 --- a/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs +++ b/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs @@ -27,10 +27,12 @@ using pwiz.Skyline.Controls.Graphs; using System.Windows.Forms; using System.Xml.Serialization; +using DigitalRune.Windows.Docking; using pwiz.Common.DataBinding; using pwiz.Common.DataBinding.Controls.Editor; using pwiz.MSGraph; using pwiz.ProteowizardWrapper; +using pwiz.Skyline; using pwiz.Skyline.Alerts; using pwiz.Skyline.Controls.Databinding; using pwiz.Skyline.Controls.GroupComparison; @@ -45,6 +47,7 @@ using pwiz.Skyline.Properties; using pwiz.Skyline.SettingsUI; using pwiz.Skyline.ToolsUI; +using pwiz.Skyline.Util; using ZedGraph; namespace pwiz.SkylineTestUtil @@ -174,7 +177,7 @@ public void ImportResultsAsync(string[] dataFiles, LockMassParameters lockMassPa { var doc = SkylineWindow.Document; ImportResultsDlg importResultsDlg; - if (!Skyline.SkylineWindow.ShouldPromptForDecoys(SkylineWindow.Document)) + if (!SkylineWindow.ShouldPromptForDecoys(SkylineWindow.Document)) { importResultsDlg = ShowDialog(SkylineWindow.ImportResults); } @@ -229,13 +232,6 @@ public void ImportResultsAsync(string[] dataFiles, LockMassParameters lockMassPa WaitForDocumentChange(doc); } - public void WaitForRegression() - { - WaitForGraphs(); - WaitForConditionUI(() => SkylineWindow.RTGraphController != null); - WaitForPaneCondition(SkylineWindow.RTGraphController.GraphSummary, pane => !pane.IsCalculating); - } - /// /// Wait for the built library to be loaded, and contain the expected /// number of spectra. @@ -486,7 +482,7 @@ public Tool( { Settings.Default.ToolList.Clear(); - _movedDirectory = new MovedDirectory(ToolDescriptionHelpers.GetToolsDirectory(), Skyline.Program.StressTest); + _movedDirectory = new MovedDirectory(ToolDescriptionHelpers.GetToolsDirectory(), Program.StressTest); _toolPath = toolPath; RunDlg(SkylineWindow.ShowConfigureToolsDlg, configureToolsDlg => { @@ -618,6 +614,26 @@ private static void ZoomAxis(ZedGraphControl graphControl, Func( diff --git a/pwiz_tools/Skyline/TestUtil/ScreenshotManager.cs b/pwiz_tools/Skyline/TestUtil/ScreenshotManager.cs index a1d9ef4aaa5..efa43c68046 100644 --- a/pwiz_tools/Skyline/TestUtil/ScreenshotManager.cs +++ b/pwiz_tools/Skyline/TestUtil/ScreenshotManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using System.Globalization; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -55,7 +56,7 @@ public static Rectangle GetWindowRectangle(Control ctrl, bool fullScreen = false var origin = Point.Empty; dockableForm.Invoke((Action) (() => { - origin = dockableForm.Pane.PointToScreen(new Point(0, 0)); + origin = dockableForm.Pane.PointToScreen(Point.Empty); snapshotBounds = new Rectangle(origin, dockableForm.Pane.Size); })); } @@ -70,8 +71,18 @@ public static Rectangle GetWindowRectangle(Control ctrl, bool fullScreen = false { int width = (ctrl as Form)?.DesktopBounds.Width ?? ctrl.Width; int frameWidth = (width - ctrl.ClientRectangle.Width) / 2 - SystemInformation.Border3DSize.Width + SystemInformation.BorderSize.Width; - Size imageSize = ctrl.Size + new PointAdditive(-2 * frameWidth, -frameWidth); - Point sourcePoint = ctrl.Location + new PointAdditive(frameWidth, 0); + Size imageSize; + Point sourcePoint; + if (ctrl is Form) + { + imageSize = ctrl.Size + new PointAdditive(-2 * frameWidth, -frameWidth); + sourcePoint = ctrl.Location + new PointAdditive(frameWidth, 0); + } + else + { + imageSize = ctrl.Size; + sourcePoint = ctrl.Parent.PointToScreen(ctrl.Location); + } snapshotBounds = new Rectangle(sourcePoint, imageSize); })); } @@ -110,6 +121,7 @@ public static PointFactor GetScalingFactor() return new PointFactor(ScreenScalingFactor); // 1.25 = 125% } + private abstract class SkylineScreenshot { /** @@ -152,7 +164,7 @@ public override Bitmap Take() try { graphCapture.CopyFromScreen(shotFrame.Location, - new Point(0, 0), shotFrame.Size); + Point.Empty, shotFrame.Size); captured = true; } catch (Exception) @@ -189,7 +201,21 @@ public override Bitmap Take() public ScreenshotManager([NotNull] SkylineWindow pSkylineWindow, string tutorialPath) { _skylineWindow = pSkylineWindow; - _tutorialPath = tutorialPath; + _tutorialPath = GetAvailableTutorialPath(tutorialPath); + } + + private string GetAvailableTutorialPath(string tutorialPath) + { + if (!string.IsNullOrEmpty(tutorialPath) && !Directory.Exists(tutorialPath)) + { + var langLetters = AbstractFunctionalTest.GetFolderNameForLanguage(CultureInfo.CurrentCulture); + var langLettersInvariant = AbstractFunctionalTest.GetFolderNameForLanguage(CultureInfo.InvariantCulture); + if (!Equals(langLettersInvariant, langLetters) && tutorialPath.EndsWith(langLetters)) + { + tutorialPath = tutorialPath.Substring(0, tutorialPath.Length - langLetters.Length) + langLettersInvariant; + } + } + return tutorialPath; } private SkylineWindow SkylineWindow => Program.MainWindow; diff --git a/pwiz_tools/Skyline/TestUtil/TestFunctional.cs b/pwiz_tools/Skyline/TestUtil/TestFunctional.cs index 7f6b12bdfad..e2adbf044a4 100644 --- a/pwiz_tools/Skyline/TestUtil/TestFunctional.cs +++ b/pwiz_tools/Skyline/TestUtil/TestFunctional.cs @@ -308,6 +308,11 @@ protected static TDlg ShowNestedDlg(Action act) where TDlg : Form return result; } + public static void RunUIForScreenShot([InstantHandle] Action act) + { + if (IsPauseForScreenShots) + RunUI(act); + } public static void RunUI([InstantHandle] Action act) { @@ -417,6 +422,11 @@ protected static void ShowAndCancelDlg(Action showAction) where TDlg : For ShowAndDismissDlg(showAction, dlg=>dlg.CancelButton.PerformClick()); } + protected static void FocusDocument() + { + RunUI(SkylineWindow.FocusDocument); + } + protected static void SelectNode(SrmDocument.Level level, int iNode) { var pathSelect = SkylineWindow.Document.GetPathTo((int)level, iNode); @@ -1125,6 +1135,13 @@ public static void WaitForGraphs(bool throwOnProgramException = true) WaitForConditionUI(WAIT_TIME, () => !SkylineWindow.IsGraphUpdatePending, null, true, false); } + public static void WaitForRegression() + { + WaitForGraphs(); + WaitForConditionUI(() => SkylineWindow.RTGraphController != null); + WaitForPaneCondition(SkylineWindow.RTGraphController.GraphSummary, pane => !pane.IsCalculating); + } + private static void WaitForBackgroundLoaders() { if (!WaitForCondition(WAIT_TIME, () => !SkylineWindow.BackgroundLoaders.Any(bgl => bgl.AnyProcessing()), null, false)) @@ -1270,10 +1287,14 @@ private string TutorialPath } } - private string GetFolderNameForLanguage(CultureInfo cultureInfo) + public static string GetFolderNameForLanguage(CultureInfo cultureInfo) { var letters = cultureInfo.TwoLetterISOLanguageName; - return Equals("zh", letters) ? "zh-CHS" : letters; + if (Equals("iv", letters)) + return "en"; + if (Equals("zh", letters)) + return "zh-CHS"; + return letters; } private int ScreenshotCounter = 1; @@ -1597,6 +1618,24 @@ public void PauseForScreenShot(string description, int? pageNum = null, i PauseForScreenShotInternal(description, typeof(TView), null, timeout, processShot); } + public void PauseForTargetsScreenShot(string description, bool clipped = false, int? countTargets = null, bool fromBottom = false, bool includeNewItem = false) + { + if (!clipped) + PauseForScreenShot(description); + else + { + PauseForScreenShot(description, null, null, bmp => + ClipTargets(bmp, countTargets, fromBottom, includeNewItem)); + } + } + + public void PauseForGraphScreenShot(string description, int? pageNum = null, int? timeout = null, Func processShot = null) + where TForm : Form + { + var form = WaitForOpenForm(); + PauseForGraphScreenShot(description, form, pageNum, timeout, processShot); + } + public void PauseForGraphScreenShot(string description, Control graphContainer, int? pageNum = null, int? timeout = null, Func processShot = null) { if (!IsPauseForScreenShots) @@ -1615,7 +1654,10 @@ public void PauseForPeakAreaGraphScreenShot(string description, int? pageNum = n public void PauseForRetentionTimeGraphScreenShot(string description, int? pageNum = null, int? timeout = null, Func processShot = null) { - PauseForGraphScreenShot(description, SkylineWindow.GraphRetentionTime, pageNum, timeout, processShot); + var graphRt = SkylineWindow.GraphRetentionTime; + if (graphRt.TryGetGraphPane(out _)) + WaitForRegression(); + PauseForGraphScreenShot(description, graphRt, pageNum, timeout, processShot); } public void PauseForMassErrorGraphScreenShot(string description, int? pageNum = null, int? timeout = null, Func processShot = null) @@ -1623,8 +1665,10 @@ public void PauseForMassErrorGraphScreenShot(string description, int? pageNum = PauseForGraphScreenShot(description, SkylineWindow.GraphMassError, pageNum, timeout, processShot); } - public void PauseForChromGraphScreenShot(string description, string replicateName, int? pageNum = null, int? timeout = null, Func processShot = null) + public void PauseForChromGraphScreenShot(string description, string replicateName = null, int? pageNum = null, int? timeout = null, Func processShot = null) { + if (replicateName == null) + RunUI(() => replicateName = SkylineWindow.SelectedGraphChromName); PauseForGraphScreenShot(description, SkylineWindow.GetGraphChrom(replicateName), pageNum, timeout, processShot); }