From 5f716bd6239b54d256279a6ef3458fc780ecde1d Mon Sep 17 00:00:00 2001 From: Brendan MacLean Date: Tue, 31 Dec 2024 10:11:50 -0800 Subject: [PATCH] Skyline: Fixes for translated small molecule tutorial screenshots (#3308) * Skyline: Fixes for translated small molecule tutorial screenshots * - fixed TestMs1Tutorial full-scan graph clicking --- .../Ms1FullScanFilteringTutorial.cs | 4 +- .../SmallMolMethodDevCEOptTutorial.cs | 16 +++- .../cover.view | 89 ++++++++++++++++++ .../SmallMolMethodDevCEOptViews.data/p16.view | 86 +++++++++++++++++ .../SmallMolMethodDevCEOptViews.data/p33.view | 87 +++++++++++++++++ .../SmallMolMethodDevCEOptViews.zip | Bin 2308 -> 0 bytes .../SmallMoleculesQuantificationTutorial.cs | 13 ++- .../TestTutorial/SmallMoleculesTutorial.cs | 9 +- .../TestUtil/AbstractFunctionalTestEx.cs | 16 ++-- 9 files changed, 295 insertions(+), 25 deletions(-) create mode 100644 pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/cover.view create mode 100644 pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p16.view create mode 100644 pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p33.view delete mode 100644 pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.zip diff --git a/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs b/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs index 0d6380a033..c10890178d 100644 --- a/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs @@ -567,9 +567,9 @@ protected override void DoTest() RevertDoc(undoIndex); // undo changes ActivateReplicate(TIP_NAME); - ClickChromatogram(TIP_NAME, 37.32, 151, checkTitle: true); + ClickChromatogram(TIP_NAME, 37.35, 151, titleTime: 37.32); // Click to the right of the point, or it will often end up 37.14 PauseForFullScanGraphScreenShot("MS1 spectrum graph 37.32 minutes", tutorialPage++); - ClickChromatogram(TIP_NAME, 33.19, 328.1, checkTitle: true); + ClickChromatogram(TIP_NAME, 33.19, 328.1, titleTime: 33.19); PauseForFullScanGraphScreenShot("MS1 spectrum graph 33.19 minutes", tutorialPage++); if (PreferWiff) diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs index 97c8152b49..088e69edd9 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptTutorial.cs @@ -20,6 +20,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.IO; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -89,15 +90,19 @@ protected override void DoTest() SetCsvFileClipboardText(GetTestPath("Energy_TransitionList.csv")); var confirmHeadersDlg = ShowDialog(SkylineWindow.Paste); - RunUIForScreenShot(() => ResizeFormOnScreen(confirmHeadersDlg, 1070, null)); - PauseForScreenShot("Confirming column headers", 5); + // TODO: After translation is updated this first image will need to be added for Chinese and Japanese + if (Equals("en", CultureInfo.CurrentCulture.TwoLetterISOLanguageName)) + { + RunUIForScreenShot(() => ResizeFormOnScreen(confirmHeadersDlg, 1070, null)); + PauseForScreenShot("Confirming column headers", 5); + } OkDialog(confirmHeadersDlg, confirmHeadersDlg.OkDialog); RunUI(() => { AdjustSequenceTreePanelWidth(); }); - + FocusDocument(); PauseForScreenShot("Main window after paste from csv", 5); var docTargets = WaitForDocumentChange(doc); @@ -343,6 +348,7 @@ protected override void DoTest() molNode.Nodes[1].Expand(); SkylineWindow.ArrangeGraphsTabbed(); }); + FocusDocument(); PauseForScreenShot("Skyline window with calibration data", 23); // Linearity @@ -455,7 +461,7 @@ protected override void DoTest() PauseForScreenShot("Import Results Files form", 31); OkDialog(openDataSourceDialog1, openDataSourceDialog1.Open); } - + FocusDocument(); PauseForScreenShot("Skyline shows new replicate \"CE Optimization\"", 32); RunUI(() => { @@ -466,6 +472,8 @@ protected override void DoTest() SkylineWindow.ShowSingleTransition(); SkylineWindow.ShowSplitChromatogramGraph(true); }); + RestoreViewOnScreen(33); + FocusDocument(); PauseForScreenShot("Split graph", 33); RunUI(() => diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/cover.view b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/cover.view new file mode 100644 index 0000000000..73f35457af --- /dev/null +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/cover.view @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p16.view b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p16.view new file mode 100644 index 0000000000..6536bd84c4 --- /dev/null +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p16.view @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p33.view b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p33.view new file mode 100644 index 0000000000..20d74829ae --- /dev/null +++ b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.data/p33.view @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.zip b/pwiz_tools/Skyline/TestTutorial/SmallMolMethodDevCEOptViews.zip deleted file mode 100644 index 5f5fe6d04a98c079bfdadce80c62bf1bd5d18994..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2308 zcmZ{mc{CJk8^*`dWUXvt%Lw61jgVdT46n()H3;RkPL{}SD6);o_S$6&$rfYFmN1O5 z8%>sxlBU5ZyOA2a`nJVoaZ|C{l|6gf9~J8%wbH-yZ``z1z;ER+?+iwMF7lv z(n$aSY$sD!zhJij*r`Z71kE=)H);Fr$5}@**8lMUVYR-Eah0RC;%#!3sbF9 zwWb^_y$X2Ag5G5m#yvbly9VoOlrOJSGpD771N>c0O6SN(P#A&YZT(UkGM9}iNQ3BYt;5>of*!mG7wxU z2RB%F*fF(VzXLCv1?w(zcLZUC)gJJzP>q1K!D$a<@P$ygW!kcbzfd1(PyFJoWfu=X z!Ukt1uOl#nrz(jad^`}0nQEJhRHCy|xG_F^6{i{2;k|ORJPVa7W zXcMcvdbDlLF2l@O%bA$^_tDs#R#2p1)lNknpYs9nVCnnRbbP%YH8RUfR8#d4D7A6~ zGS``(RcE~vaO=iUOG>b@^qSuWmE>RlvXW$Vb#y%>H+qK?udpwRe@!d?mXk#By+$_G z37U^f6m44OT%T_qzY5gf^z@pgKVCE`oG6&biiKjGG~Fo8{kdZUKpe{`v`a?~M!D~FvtrY_Ak;2 zd=han7t(nQ)4CjKdp}U3S+-I*`hJkL!s#&Tz9m9p_a{WW@k2i<@AV!gD0>!M*{vr^Q2|S%=Z0q|fo#qPS~!kAd|?k<(YQ6>N&AN-3e0D!-|^1m1Y zhx?r{r09epXPeFHGMPlvE)by1#zL3G5+`lP9C-1i0p;h_s_C@WkLa1%T6yK%d@1|9 zz4h}NKgZA^4aaoZDX^w_j(TRPhWFct@elNoRKn?S7|_Q8gp4QUw)aFP`}&7S66K$) zWGMG$4SJsN1rcsw5UyX~$>;C%Nr<4L(h-88YO1d*mo{MKiDY4i*;K@ zQLp;@c<9rc^EaZ=-He(x(~GrB&dA1M^}?Mqr-o!GKqBA#oA@&IbWO$y$f5lJ#+mOlDdYNeH zUX`$z1*5j-c`xH|4#AYV^kmTy=JrEtoM~yX?qy5(w2)f3YW$z>qY`!ngW6V7Ovkp4 z3j*(?wS;5BQHaF>P5<`66@FR}YC+pF!Rve$PaV^)2tI~sN89Tw`D|1{NekgUOIROj zgV@4Q+-0brI>Ji=%I>nIVoK-Ca+I{#yGAoN)xTVEZI;_%$u#DUT?QvSuaN+0 zvd+}ihKgzUYO`C{DV35+DC`DAQ&z%e*Z84F*zJBJjUYO4$cyiKa`0{w{xj`d@yjy; z2xhhP};p#0_5)wV7hu+!vdR@Aixw9c0d~F3sv>)NN`<@9}XVF z=T(V$bjy)ziD^xD$<@^(u5LB$?&PUtwTJ;c908SmojYP6UU_6U(C4$z?p+@55LMAO zhro?Fsrh!#U1HsU3<`!n5hCAe%g=)za`-s{E$cW-%A`Zi21>NxKuP1a4K%jsM%;_u z>;130YG5MK%foHbMX21A>zMHMlw7LjfMZxxr$UXl&ESxm2c9yDVQ!_Aw$OJHgXSSrmH@0gyD#R+u4Fx2N^^0LpP~yyKRq$Ew<5+ zZQcfbNXyYylT6_YlvUVB#Mi{cMjnIAA0eGng#%S+` z=tRtZaQ3EWBT1p%aE$*8fyLDB+RmvrB{4L9a~K1oHsJpyhl?jy|La}&=l^?-VEgxs z0U!Wy4peWTOH4DY48g~L*WbPWmnXk_Lr=2Gf9UeNGlU(TaE5J~L0*xZ`Acn)W$+Ew W=@U+!0{&Ww@uXT$RP`600Dl83>QBJ{ diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs index 44d40b4774..b92a7d5d0b 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesQuantificationTutorial.cs @@ -134,6 +134,7 @@ protected override void DoTest() SelectNode(SrmDocument.Level.Transitions, 0); SelectNode(SrmDocument.Level.Transitions, 1); SelectNode(SrmDocument.Level.Molecules, 0); + FocusDocument(); PauseForScreenShot("Skyline with small molecule targets", 7); var transitionSettingsUI = ShowDialog(SkylineWindow.ShowTransitionSettingsUI); @@ -189,7 +190,7 @@ protected override void DoTest() SelectNode(SrmDocument.Level.Transitions, 1); SelectNode(SrmDocument.Level.Molecules, 0); - + FocusDocument(); PauseForScreenShot("Skyline window multi-precursor graph", 13); var docResults = SkylineWindow.Document; @@ -227,6 +228,12 @@ protected override void DoTest() SelectNode(SrmDocument.Level.Transitions, 0); SelectNode(SrmDocument.Level.Transitions, 1); SelectNode(SrmDocument.Level.Molecules, 0); + // TODO: Removed this once Nick has fixed what is causing x-axis labels in the Peak Areas plot to end up horizontal + RunUIForScreenShot(() => SkylineWindow.Height += 200); + JiggleSelection(); + RunUIForScreenShot(() => SkylineWindow.Height -= 200); + JiggleSelection(); + FocusDocument(); PauseForScreenShot("Skyline window multi-replicate layout", 14); // Peak integration correction @@ -354,7 +361,7 @@ protected override void DoTest() } RunUI(() => SkylineWindow.ShowCalibrationForm()); - PauseForScreenShot("Calibration Curve ", 23); + PauseForGraphScreenShot("Calibration Curve ", 23); EnableDocumentGridColumns(documentGrid, Resources.SkylineViewContext_GetDocumentGridRowSources_Replicates, 47, new[] @@ -413,7 +420,7 @@ protected override void DoTest() var calibrationForm = FindOpenForm(); RunUI(() => calibrationForm.UpdateUI(false)); - PauseForScreenShot("Calibration Curve: Log", 26); + PauseForGraphScreenShot("Calibration Curve: Log", 26); } } diff --git a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs index dc2c8f81ce..696567900b 100644 --- a/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs +++ b/pwiz_tools/Skyline/TestTutorial/SmallMoleculesTutorial.cs @@ -93,10 +93,7 @@ protected override void DoTest() { // Setting the UI mode, p 2 var startPage = WaitForOpenForm(); - RunUI(() => startPage.SetUIMode(SrmDocument.DOCUMENT_TYPE.proteomic)); -// PauseForScreenShot("Start Window proteomic", 2); RunUI(() => startPage.SetUIMode(SrmDocument.DOCUMENT_TYPE.small_molecules)); -// PauseForScreenShot("Start Window small molecule", 3); ShowSkyline(() => startPage.DoAction(skylineWindow => true)); } @@ -125,12 +122,8 @@ protected override void DoTest() } }); PauseForScreenShot("Column Select Dlg with column headers selected", 6); - OkDialog(col4Dlg, col4Dlg.OkDialog); - - - var docTargets = WaitForDocumentChange(doc); AssertEx.IsDocumentState(docTargets, null, 6, 12, 19, 21); @@ -164,7 +157,7 @@ protected override void DoTest() } SelectNode(SrmDocument.Level.MoleculeGroups, 0); - + FocusDocument(); PauseForScreenShot("Skyline window multi-target graph", 9); var docResults = SkylineWindow.Document; diff --git a/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs b/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs index c6f4669ce1..9382eaabab 100644 --- a/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs +++ b/pwiz_tools/Skyline/TestUtil/AbstractFunctionalTestEx.cs @@ -526,14 +526,14 @@ public static void ClickChromatogram(double x, double y, PaneKey? paneKey = null ClickChromatogram(null, x, y, paneKey); } - public static void ClickChromatogram(string graphName, double x, double y, PaneKey? paneKey = null, bool checkTitle = false) + public static void ClickChromatogram(string graphName, double x, double y, PaneKey? paneKey = null, double? titleTime = null) { WaitForGraphs(); var graphChromatogram = GetGraphChrom(graphName); MouseOverChromatogramInternal(graphChromatogram, x, y, paneKey); RunUI(() => graphChromatogram.TestMouseDown(x, y, paneKey)); WaitForGraphs(); - CheckFullScanSelection(graphName, x, y, paneKey, checkTitle); + CheckFullScanSelection(graphName, x, y, paneKey, titleTime); } public static void MouseOverChromatogram(double x, double y, PaneKey? paneKey = null) @@ -568,21 +568,21 @@ private static void MouseOverChromatogramInternal(GraphChromatogram graphChromat sleepInterval * sleepCycles / 1000.0))); } - public static void CheckFullScanSelection(double x, double y, PaneKey? paneKey = null, bool checkTitle = false) + public static void CheckFullScanSelection(double x, double y, PaneKey? paneKey = null, double? titleTime = null) { - CheckFullScanSelection(null, x, y, paneKey, checkTitle); + CheckFullScanSelection(null, x, y, paneKey, titleTime); } - public static void CheckFullScanSelection(string graphName, double x, double y, PaneKey? paneKey = null, bool checkTitle = false) + public static void CheckFullScanSelection(string graphName, double x, double y, PaneKey? paneKey = null, double? titleTime = null) { var graphChromatogram = GetGraphChrom(graphName); WaitForConditionUI(() => SkylineWindow.GraphFullScan != null && SkylineWindow.GraphFullScan.IsLoaded); - if (checkTitle) + if (titleTime.HasValue) { // Good idea to check the title for a tutorial screenshot - var matchTime = Regex.Match(SkylineWindow.GraphFullScan.TitleText, @".([0-9.]+) [\w]+.$"); + var matchTime = Regex.Match(SkylineWindow.GraphFullScan.TitleText, @".([0-9.,]+) [\w]+.$"); Assert.IsTrue(matchTime.Success); - Assert.AreEqual(x, double.Parse(matchTime.Groups[1].Value)); + Assert.AreEqual(titleTime.Value, double.Parse(matchTime.Groups[1].Value)); } Assert.AreEqual(string.Empty, graphChromatogram.TestFullScanSelection(x, y, paneKey)); }