Index: testcommon/source/org/openoffice/test/vcl/Tester.java =================================================================== --- testcommon/source/org/openoffice/test/vcl/Tester.java (revision 1377957) +++ testcommon/source/org/openoffice/test/vcl/Tester.java (working copy) @@ -55,13 +55,15 @@ * * @param delay */ - public static void sleep(double delay) { + public static void sleep(double seconds) { try { - Thread.sleep((long) (delay * 1000)); + double factor = Double.parseDouble(System.getProperty("sleep.factor", "1.0")); + seconds = seconds * factor; + Thread.sleep((long) (seconds * 1000)); } catch (InterruptedException e) { } - } - + } + /** * Click on the screen * @param x Index: testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java =================================================================== --- testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java (revision 1377957) +++ testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java (working copy) @@ -51,7 +51,8 @@ } public VclApp(OpenOffice openOffice) { - this("localhost", openOffice.getAutomationPort()); +// this("localhost", openOffice.getAutomationPort()); + this("127.0.0.1", openOffice.getAutomationPort()); // In case "localhost" is modified incorrectly this.openOffice = openOffice; } @@ -84,10 +85,11 @@ public void start(boolean isCleanUserInstallation) { // Default to clean user installation if (openOffice != null) { if (isCleanUserInstallation) { - openOffice.kill(); + OpenOffice.kill(); + SystemUtil.sleep(5); openOffice.cleanUserInstallation(); openOffice.start(); - SystemUtil.sleep(5); + SystemUtil.sleep(10); } else { openOffice.start(); } @@ -96,6 +98,20 @@ communicationManager.start(); } + public void loadDocument(String file) { + dispatch(".uno:Open"); + VclComboBox FilePicker_Path = new VclComboBox("SVT_HID_FILEDLG_AUTOCOMPLETEBOX"); + FilePicker_Path.setText(file); + VclButton FilePicker_Open = new VclButton("fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_OPEN"); + FilePicker_Open.click(); + VclWindow writer = new VclWindow("SW_HID_EDIT_WIN"); + writer.waitForExistence(10, 2); + } + + public void newDocument(String type) { + dispatch(type); + } + public OpenOffice getOpenOffice() { return this.openOffice; } Index: testgui/source/testcase/gui/BVTFileType.java =================================================================== --- testgui/source/testcase/gui/BVTFileType.java (revision 1377957) +++ testgui/source/testcase/gui/BVTFileType.java (working copy) @@ -53,12 +53,12 @@ @Before public void setUp() throws Exception { - app.start(); + app.start(true); } @After public void tearDown() throws Exception { - app.close(); + } /** @@ -100,7 +100,7 @@ String saveTo = getPath("temp/" + file); // Create a new text document app.dispatch("private:factory/swriter"); - sleep(3); + writer.waitForExistence(10, 2); // Input some text by keyboard writer.focus(); @@ -238,7 +238,7 @@ String text = "Hello Openoffice"; app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(1); + impress.waitForExistence(10, 2); impress.click(0.01, 0.01); typeKeys(text); sleep(2); @@ -256,7 +256,6 @@ app.dispatch(".uno:Open"); submitOpenDlg(saveTo); impress.waitForExistence(10, 2); - sleep(2); impress.click(3, 3); typeKeys(""); app.dispatch(".uno:SelectAll"); @@ -316,7 +315,7 @@ // Create a new drawing document app.dispatch("private:factory/sdraw"); - sleep(3); + draw.waitForExistence(10, 2); // Insert a picture fully filled with green app.dispatch(".uno:InsertGraphic"); @@ -393,7 +392,7 @@ // Create a new math app.dispatch("private:factory/smath"); - sleep(3); + math_EditWindow.waitForExistence(10, 2); // Verify if the Elements window is active assertTrue(math_ElementsWindow.exists(3)); Index: testgui/source/testcase/gui/BVTFunction.java =================================================================== --- testgui/source/testcase/gui/BVTFunction.java (revision 1377957) +++ testgui/source/testcase/gui/BVTFunction.java (working copy) @@ -53,12 +53,12 @@ @Before public void setUp() throws Exception { - app.start(); + app.start(true); } @After public void tearDown() throws Exception { - app.close(); + } @Test @@ -89,7 +89,7 @@ public void testPrintDialog() { // Create a new text document app.dispatch("private:factory/swriter"); - sleep(3); + writer.waitForExistence(10, 2); app.dispatch(".uno:Print"); assertTrue(File_PrintDlg.exists(5)); File_PrintDlg.cancel(); @@ -158,7 +158,7 @@ // Create a new text document app.dispatch("private:factory/swriter"); - sleep(3); + writer.waitForExistence(10, 2); // Insert a picture fully filled with green writer.click(400, 400); @@ -193,7 +193,7 @@ // Create a new text document app.dispatch("private:factory/scalc"); - sleep(3); + calc.waitForExistence(10, 2); // Insert a picture fully filled with green app.dispatch(".uno:InsertGraphic"); @@ -229,7 +229,7 @@ // Create a new text document app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(3); + impress.waitForExistence(10, 2); // Insert a picture fully filled with green app.dispatch(".uno:InsertGraphic"); @@ -339,7 +339,7 @@ }; // Create a new text document app.dispatch("private:factory/scalc"); - sleep(3); + calc.waitForExistence(10, 2); CalcUtil.selectRange("C5"); typeKeys("1"); @@ -474,7 +474,7 @@ // Create a new drawing document app.dispatch("private:factory/sdraw"); - sleep(3); + draw.waitForExistence(10, 2); // Insert a chart app.dispatch(".uno:InsertObjectChart"); @@ -498,7 +498,7 @@ // Create a new text document app.dispatch("private:factory/swriter"); - sleep(3); + writer.waitForExistence(10, 2); // Insert a chart app.dispatch(".uno:InsertObjectChart"); @@ -522,7 +522,7 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); - sleep(3); + calc.waitForExistence(10, 2); // Insert a chart app.dispatch(".uno:InsertObjectChart"); @@ -548,7 +548,7 @@ // Create a new presentation document app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(3); + impress.waitForExistence(10, 2); // Insert a chart app.dispatch(".uno:InsertObjectChart"); @@ -572,7 +572,7 @@ // Create a new drawing document app.dispatch("private:factory/sdraw"); - sleep(3); + draw.waitForExistence(10, 2); // Insert a table app.dispatch(".uno:InsertTable"); @@ -580,6 +580,7 @@ sleep(3); // Verify if the table toolbar is active + typeKeys("123"); // Insert text to focus on table, to avoid Bug 120171 on linux assertTrue(Table_Toolbar.exists(3)); // Focus on edit pane @@ -598,7 +599,7 @@ // Create a new text document app.dispatch("private:factory/swriter"); - sleep(3); + writer.waitForExistence(10, 2); // Insert a table app.dispatch(".uno:InsertTable"); @@ -629,7 +630,7 @@ // Create a new presentation document app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(3); + impress.waitForExistence(10, 2); // Insert a table app.dispatch(".uno:InsertTable"); @@ -637,6 +638,7 @@ sleep(3); // Verify if the table toolbar is active + typeKeys("123"); // Insert text to focus on table, to avoid Bug 120171 on linux assertTrue(Table_Toolbar.exists(3)); // // Check the statusbar to verify if the table is inserted @@ -659,8 +661,8 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); - sleep(3); - + calc.waitForExistence(10, 2); + // Insert source numbers String sourceNumber1 = "5"; String sourceNumber2 = "3"; @@ -692,7 +694,7 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); - sleep(3); + calc.waitForExistence(10, 2); // Insert source numbers and expected result String sourceData = "0"; @@ -722,7 +724,7 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); - sleep(3); + calc.waitForExistence(10, 2); // Insert source number String sourceNumber = "-5"; Index: testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java =================================================================== --- testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java (revision 1377957) +++ testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java (working copy) @@ -50,25 +50,19 @@ // New a formula document app.dispatch("private:factory/smath"); - sleep(3); // If no sleep, can not find math_SymbolsDlg in mac + math_EditWindow.waitForExistence(10, 2); // Click catalog button math_CatalogButton.click(); - // Verify if the "Symbols" dialog pop up - assertTrue("Symbols dialog does not pop up", math_SymbolsDlg.exists(3)); - // Select "Special", click "Edit" button math_SymbolsDlgListbox.select(2); math_SymbolsDlgEditButton.click(); - - // Verify if the "Edit Symbols" dialog pop up - assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java =================================================================== --- testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java (revision 1377957) +++ testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java (working copy) @@ -50,18 +50,15 @@ // New a formula document app.dispatch("private:factory/smath"); - sleep(3); // If no sleep, can not find math_SymbolsDlg in mac + math_EditWindow.waitForExistence(10, 2); // Click catalog button math_CatalogButton.click(); - - // Verify if the "Symbols" dialog pop up - assertTrue("Symbols dialog does not pop up", math_SymbolsDlg.exists(3)); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java =================================================================== --- testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java (revision 1377957) +++ testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java (working copy) @@ -56,7 +56,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java (revision 1377957) +++ testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java (working copy) @@ -50,12 +50,13 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); + calc.waitForExistence(10, 2); app.dispatch(".uno:InsertObjectChart"); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/datapilot/DataPivotTable.java =================================================================== --- testgui/source/testcase/gui/sc/datapilot/DataPivotTable.java (revision 1377957) +++ testgui/source/testcase/gui/sc/datapilot/DataPivotTable.java (working copy) @@ -54,12 +54,12 @@ @Before public void setUp() throws Exception { - app.start(); + app.start(true); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/filter/Fitler.java =================================================================== --- testgui/source/testcase/gui/sc/filter/Fitler.java (revision 1377957) +++ testgui/source/testcase/gui/sc/filter/Fitler.java (working copy) @@ -57,7 +57,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/sheet/InsertSheet.java =================================================================== --- testgui/source/testcase/gui/sc/sheet/InsertSheet.java (revision 1377957) +++ testgui/source/testcase/gui/sc/sheet/InsertSheet.java (working copy) @@ -50,7 +50,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/sort/SortDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/sort/SortDialogSetting.java (revision 1377957) +++ testgui/source/testcase/gui/sc/sort/SortDialogSetting.java (working copy) @@ -55,11 +55,12 @@ // Create a new spreadsheet document app.dispatch("private:factory/scalc"); + calc.waitForExistence(10, 2); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java =================================================================== --- testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java (revision 1377957) +++ testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java (working copy) @@ -53,14 +53,14 @@ String file = prepareData("sc/SubtotalsSampleFile.ods"); app.dispatch(".uno:Open"); submitOpenDlg(file); - sleep(2); + calc.waitForExistence(10, 2); CalcUtil.selectRange("A1:E7"); app.dispatch(".uno:DataSubTotals"); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java (revision 1377957) +++ testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java (working copy) @@ -57,7 +57,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java (revision 1377957) +++ testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java (working copy) @@ -50,7 +50,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java (revision 1377957) +++ testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java (working copy) @@ -56,13 +56,14 @@ // New a spreadsheet, select cell range, open Validity dialog app.dispatch("private:factory/scalc"); + calc.waitForExistence(10, 2); CalcUtil.selectRange("A1:C5"); app.dispatch(".uno:Validation"); } @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java (revision 1377957) +++ testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java (working copy) @@ -48,7 +48,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /** Index: testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java =================================================================== --- testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java (revision 1377957) +++ testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java (working copy) @@ -46,12 +46,12 @@ @Before public void setUp() throws Exception { -// app.start(true); // Bug 120476 - app.start(); + app.start(true); // Bug 120476 // New a impress, insert some slides app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); + impress.waitForExistence(10, 2); for(int i=0; i<5;i++){ SD_InsertPageButtonOnToolbar.click(); @@ -64,14 +64,14 @@ @After public void tearDown() throws Exception { - app.close(); + } /** * Test Copy slide with Apply Footer to same file and different file * @throws Exception */ - @Test//? + @Test public void testCopySlideWithApplyFooter() throws Exception{ //add header and footer @@ -257,7 +257,7 @@ * Test footer not show on the first slide. * @throws Exception */ - @Test//?? + @Test public void testFooterNotShowOn1stSlide() throws Exception{ //add header and footer @@ -269,8 +269,12 @@ // Check slide 1 ImpressSlideSorter.focus(); - typeKeys(""); - sleep(1); // If no sleep, error occur +// typeKeys(""); // Not stable on ubuntu10.04 +// sleep(1); // If no sleep, error occur + for (int i=0; i<5; i++) { + typeKeys(""); + sleep(1); + } app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked()); Index: testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java =================================================================== --- testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (revision 1377957) +++ testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (working copy) @@ -45,13 +45,12 @@ @Before public void setUp() throws Exception { -// app.start(true); // Bug 120476 - app.start(); + app.start(true); // Bug 120476 } @After public void tearDown() throws Exception { - app.close(); + } /** @@ -65,7 +64,7 @@ String file = prepareData("sd/AOO3.4HeaderFooter.odp"); app.dispatch(".uno:Open"); submitOpenDlg(file); - sleep(2); // If no sleep, error occur on mac + impress.waitForExistence(10, 2); //check after reopen app.dispatch(".uno:HeaderAndFooter"); @@ -106,6 +105,7 @@ String file = prepareData("sd/gfdd.ppt"); app.dispatch(".uno:Open"); submitOpenDlg(file); + impress.waitForExistence(10, 2); //check after reopen app.dispatch(".uno:HeaderAndFooter"); Index: testgui/source/testcase/gui/SmokeTest.java =================================================================== --- testgui/source/testcase/gui/SmokeTest.java (revision 1377957) +++ testgui/source/testcase/gui/SmokeTest.java (working copy) @@ -55,7 +55,7 @@ @After public void tearDown() throws Exception { - app.close(); + } @Test Index: testgui/source/testcase/gui/sw/table/Table.java =================================================================== --- testgui/source/testcase/gui/sw/table/Table.java (revision 1377957) +++ testgui/source/testcase/gui/sw/table/Table.java (working copy) @@ -52,7 +52,7 @@ @After public void tearDown() throws Exception { - app.close(); + } /**