From bdd781fab618e718c07807b498108515d57f17df Mon Sep 17 00:00:00 2001 From: brendanx67 Date: Mon, 9 Oct 2023 16:27:24 -0700 Subject: [PATCH] Skyline: Better error message for TestSmallMoleculesDocumentGrid failures --- .../TestFunctional/SmallMoleculesDocumentGridTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pwiz_tools/Skyline/TestFunctional/SmallMoleculesDocumentGridTest.cs b/pwiz_tools/Skyline/TestFunctional/SmallMoleculesDocumentGridTest.cs index 13bb296167..25c8cdb77a 100644 --- a/pwiz_tools/Skyline/TestFunctional/SmallMoleculesDocumentGridTest.cs +++ b/pwiz_tools/Skyline/TestFunctional/SmallMoleculesDocumentGridTest.cs @@ -136,15 +136,16 @@ private void CheckDocumentGridAndColumns(string docName, WaitForClosedForm(); var documentGrid = ShowDialog(() => SkylineWindow.ShowDocumentGrid(true)); RunUI(() => documentGrid.ChooseView(viewName)); - WaitForCondition(() => (documentGrid.RowCount == rowCount)); // Let it initialize + WaitForConditionUI(() => (documentGrid.RowCount == rowCount), + () => string.Format("Expecting row count <{0}>, actual <{1}>", rowCount, documentGrid.RowCount)); // Let it initialize int iteration = 0; - WaitForCondition(() => + WaitForConditionUI(() => { bool result = documentGrid.ColumnCount == colCount; if (!result && iteration++ > 9) Assert.AreNotEqual(colCount, documentGrid.ColumnCount); // Put breakpoint on this line, if you have changed columns and need to update the numbers return result; - }); // Let it initialize + }, () => string.Format("Expecting column count <{0}>, actual <{1}>", colCount, documentGrid.ColumnCount)); // Let it initialize var colProductIonFormula = documentGrid.FindColumn(PropertyPath.Parse("ProductIonFormula")); var colProductNeutralFormula = documentGrid.FindColumn(PropertyPath.Parse("ProductNeutralFormula"));