This is an automated email from the ASF dual-hosted git repository. cmarcum pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 882d61e Flaky tests (#115) 882d61e is described below commit 882d61eb9b6ebfc60c9a29cf74aa165f1d6b0a2a Author: Carl Marcum <carl.mar...@codebuilders.net> AuthorDate: Fri Jan 8 19:59:08 2021 -0500 Flaky tests (#115) work on bvt flaky tests by adding a sleep and/or getting a value before checking the test result. --- test/testgui/source/bvt/gui/BasicFunctionTest.java | 13 +++++++++--- test/testgui/source/bvt/gui/FileTypeTest.java | 24 +++++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/test/testgui/source/bvt/gui/BasicFunctionTest.java b/test/testgui/source/bvt/gui/BasicFunctionTest.java index b452862..5b31331 100644 --- a/test/testgui/source/bvt/gui/BasicFunctionTest.java +++ b/test/testgui/source/bvt/gui/BasicFunctionTest.java @@ -175,6 +175,7 @@ public class BasicFunctionTest { runMacroDlgCategories.select("Module1"); runMacroDlgCommands.select(0); runMacroDlg.ok(); + sleep(1); assertEquals("A3 should be =1+3", "4", SCTool.getCellText("A3")); discard(); } @@ -679,9 +680,11 @@ public class BasicFunctionTest { SCTool.selectRange("D1"); scInputBarInput.inputKeys("=COS(A1)"); typeKeys("<enter>"); - + sleep(1); // Verify if the calculated result is equal to the expected result - assertEquals("The calculated result", expectedResult, SCTool.getCellText("D1")); + String result = SCTool.getCellText("D1"); + sleep(1); + assertEquals("The calculated result", expectedResult, result); discard(); } @@ -709,9 +712,13 @@ public class BasicFunctionTest { scFunctionWizardDlgFunctionList.select("ABS"); scFunctionWizardDlgNext.click(); // Use "Next" button scFunctionWizardDlgEdit1.typeKeys("A1"); + sleep(1); scFunctionWizardDlg.ok(); + sleep(1); // Verify if the calculated result is equal to the expected result - assertEquals("The calculated result", expectedResult, SCTool.getCellText("B1")); + String result = SCTool.getCellText("B1"); + sleep(1); + assertEquals("The calculated result", expectedResult, result); discard(); } } diff --git a/test/testgui/source/bvt/gui/FileTypeTest.java b/test/testgui/source/bvt/gui/FileTypeTest.java index f5cb5fc..0528e75 100644 --- a/test/testgui/source/bvt/gui/FileTypeTest.java +++ b/test/testgui/source/bvt/gui/FileTypeTest.java @@ -108,8 +108,12 @@ public class FileTypeTest { String text = "@AOO"; newTextDocument(); writer.typeKeys(text); + sleep(1); // Verify the text via system clip board - Assert.assertEquals("The typed text into writer", text, copyAll()); + String result = copyAll(); + sleep(1); + Assert.assertEquals("The typed text into writer", text, result); + result = null; // menuItem("Text Properties...").select(); app.dispatch(".uno:FontDialog"); @@ -127,7 +131,9 @@ public class FileTypeTest { writer.waitForExistence(10, 2); sleep(1); // Verify if the text still exists in the file - Assert.assertEquals("The typed text into writer is saved!", text, copyAll()); + result = copyAll(); + sleep(1); + Assert.assertEquals("The typed text into writer is saved!", text, result); } @Test @@ -219,7 +225,9 @@ public class FileTypeTest { sleep(1); impress.typeKeys("<tab><enter>"); sleep(1); - Assert.assertEquals("The typed text is saved!", text, copyAll().trim()); + String result = copyAll(); + sleep(1); + Assert.assertEquals("The typed text is saved!", text, result.trim()); } // drawing @@ -330,8 +338,12 @@ public class FileTypeTest { newFormula(); // Insert a formula mathEditWindow.typeKeys(text); + sleep(1); // Verify the text via system clip board - assertEquals("The typed formula into math", text, copyAll()); + String result = copyAll(); + sleep(1); + assertEquals("The typed formula into math", text, result); + result = null; // Save the formula deleteFile(saveTo); @@ -341,6 +353,8 @@ public class FileTypeTest { mathEditWindow.waitForExistence(10, 2); sleep(1); mathEditWindow.focus(); - assertEquals("The typed formula into math is saved", text, copyAll()); + result = copyAll(); + sleep(1); + assertEquals("The typed formula into math is saved", text, result); } }