Index: testgui/data/sc/SortOptionsIncludeFormats.ods =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: testgui/data/sc/SortOptionsIncludeFormats.ods =================================================================== --- testgui/data/sc/SortOptionsIncludeFormats.ods (revision 0) +++ testgui/data/sc/SortOptionsIncludeFormats.ods (working copy) Property changes on: testgui/data/sc/SortOptionsIncludeFormats.ods ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: testgui/source/testcase/gui/BVTFileType.java =================================================================== --- testgui/source/testcase/gui/BVTFileType.java (revision 1365470) +++ testgui/source/testcase/gui/BVTFileType.java (working copy) @@ -99,7 +99,7 @@ private void saveNewDocument(String file) { String saveTo = getPath("temp/" + file); //Create a new text document - app.dispatch("private:factory/swriter", 3); + app.dispatch("private:factory/swriter"); sleep(3); // Input some text by keyboard @@ -107,7 +107,7 @@ String text = "~!@#$%^&*()_+QWERTYUIOP{}|:LKJHGFDSAZXCVBNM<>? "; typeText(text); - app.dispatch(".uno:SelectAll", 3); + app.dispatch(".uno:SelectAll"); app.setClipboard(".wrong"); sleep(1); typeKeys("<$copy>"); @@ -119,7 +119,7 @@ // Set the text style writer.openContextMenu(); // menuItem("Text Properties...").select(); - app.dispatch(".uno:FontDialog", 3); + app.dispatch(".uno:FontDialog"); EffectsPage.select(); EffectsPage_Color.select(6); EffectsPage.ok(); @@ -134,14 +134,14 @@ // Close it by clicking main menu - app.dispatch(".uno:CloseDoc", 3); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen the saved file - app.dispatch(".uno:Open", 3); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); writer.waitForExistence(10, 2); - app.dispatch(".uno:SelectAll", 3); + app.dispatch(".uno:SelectAll"); app.setClipboard(".wrong"); typeKeys("<$copy>"); sleep(1); @@ -253,16 +253,16 @@ if (AlienFormatDlg.exists(3)) AlienFormatDlg.ok(); // Close it by clicking main menu - app.dispatch(".uno:CloseDoc", 3); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen the saved file - app.dispatch(".uno:Open", 3); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); impress.waitForExistence(10, 2); sleep(2); impress.click(3, 3); typeKeys(""); - app.dispatch(".uno:SelectAll", 3); + app.dispatch(".uno:SelectAll"); // app.setClipboard(".wrong"); typeKeys("<$copy>"); sleep(1); @@ -319,11 +319,11 @@ String bmp_green = prepareData("pure_green_64x64.bmp"); // Create a new drawing document - app.dispatch("private:factory/sdraw", 3); + app.dispatch("private:factory/sdraw"); sleep(3); // Insert a picture fully filled with green - app.dispatch(".uno:InsertGraphic", 3); + app.dispatch(".uno:InsertGraphic"); submitOpenDlg(bmp_green); sleep(3); // Focus on edit pane @@ -343,11 +343,11 @@ AlienFormatDlg.ok(); // Keep the current format // Close it by clicking main menu - app.dispatch(".uno:CloseDoc", 3); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen the saved file - app.dispatch(".uno:Open", 3); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); draw.waitForExistence(10, 2); @@ -395,7 +395,7 @@ String saveTo = getPath("temp/" + filename); // Create a new math - app.dispatch("private:factory/smath", 3); + app.dispatch("private:factory/smath"); sleep(3); // Verify if the Elements window is active @@ -404,7 +404,7 @@ // Insert a formula String text = "5 times 3 = 15"; typeText(text); - app.dispatch(".uno:Select", 3); + app.dispatch(".uno:Select"); typeKeys("<$copy>"); sleep(1); @@ -420,21 +420,21 @@ AlienFormatDlg.ok(); // Keep the current format // Close it by clicking main menu - app.dispatch(".uno:CloseDoc", 3); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen the saved file - app.dispatch(".uno:Open", 3); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); math_EditWindow.waitForExistence(10, 2); // Verify if the formula still exists in the file - app.dispatch(".uno:Select", 3); + app.dispatch(".uno:Select"); typeKeys("<$copy>"); sleep(1); assertEquals("The typed formula into math is saved", text, app.getClipboard()); // Close the file to avoid the app closing the Elements window automatically - app.dispatch(".uno:CloseDoc", 3); + app.dispatch(".uno:CloseDoc"); } } Index: testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java =================================================================== --- testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java (revision 1365470) +++ testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java (working copy) @@ -49,20 +49,17 @@ app.start(); // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); + app.dispatch("private:factory/smath"); // Click catalog button math_CatalogButton.click(); - sleep(1); // 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("Special"); + math_SymbolsDlgListbox.select(2); math_SymbolsDlgEditButton.click(); - sleep(1); // Verify if the "Edit Symbols" dialog pop up assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); @@ -87,7 +84,6 @@ int nIndex = 1; do { math_EditSymbolsDlgViewControl.click(100*nIndex, 10); // risk: after 6 or 7 circles, this will click out of ViewControl - sleep(1); selectedSymbol = math_EditSymbolsDlgSymbol.getText(); nIndex++; // Find if the selected symbol is already in the list @@ -102,7 +98,6 @@ } while (bSelectSymbolNotInList); math_EditSymbolsDlgAdd.click(); math_EditSymbolsDlg.ok(); - sleep(1); // Verify if the symbol is added to Symbol set math_SymbolsDlgEditButton.click(); @@ -138,7 +133,6 @@ String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlgModify.click(); math_EditSymbolsDlg.ok(); - sleep(1); // Verify if the font of symbol is modified successfully math_SymbolsDlgEditButton.click(); @@ -167,7 +161,6 @@ String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlgModify.click(); math_EditSymbolsDlg.ok(); - sleep(1); // Verify if the typeface of symbol is modified successfully math_SymbolsDlgEditButton.click(); @@ -191,7 +184,6 @@ String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlgDelete.click(); math_EditSymbolsDlg.ok(); - sleep(1); // Verify if the selected symbol is deleted successfully math_SymbolsDlgEditButton.click(); Index: testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java =================================================================== --- testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java (revision 1365470) +++ testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java (working copy) @@ -49,12 +49,10 @@ app.start(); // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); + app.dispatch("private:factory/smath"); // Click catalog button math_CatalogButton.click(); - sleep(1); // Verify if the "Symbols" dialog pop up assertTrue("Symbols dialog does not pop up", math_SymbolsDlg.exists(3)); @@ -73,22 +71,19 @@ public void testInputGreekFromCatalog() throws Exception{ // Select "Greek", click "Edit" button to get the selected Symbol - math_SymbolsDlgListbox.select("Greek"); + math_SymbolsDlgListbox.select(0); math_SymbolsDlgEditButton.click(); - sleep(1); String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlg.ok(); - sleep(1); // Insert the selected symbol math_SymbolsDlgInsertButton.click(); math_SymbolsDlgCloseButton.click(); // Verify if the symbol is inserted successfully - math_EditWindow.activate(); - math_EditWindow.menuItem("Edit->Select All").select(); - math_EditWindow.menuItem("Edit->Copy").select(); - sleep(1); + math_EditWindow.click(5, 5); + app.dispatch(".uno:Select"); + app.dispatch(".uno:Copy"); assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end // Close all dialogs @@ -103,12 +98,10 @@ public void testInputIGreekFromCatalog() throws Exception{ // Select "iGreek", click "Edit" button to get the selected Symbol - math_SymbolsDlgListbox.select("iGreek"); + math_SymbolsDlgListbox.select(1); math_SymbolsDlgEditButton.click(); - sleep(1); String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlg.ok(); - sleep(1); // Insert the selected symbol math_SymbolsDlgInsertButton.click(); @@ -116,9 +109,8 @@ // Verify if the symbol is inserted successfully math_EditWindow.click(5, 5); - math_EditWindow.menuItem("Edit->Select All").select(); - math_EditWindow.menuItem("Edit->Copy").select(); - sleep(1); + app.dispatch(".uno:Select"); + app.dispatch(".uno:Copy"); assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end // Close all dialogs @@ -133,21 +125,19 @@ public void testInputSpecialFromCatalog() throws Exception{ // Select "Special", "Insert" the default first symbol - math_SymbolsDlgListbox.select("Special"); + math_SymbolsDlgListbox.select(2); math_SymbolsDlgInsertButton.click(); // Click "Edit" button to get the selected Symbol math_SymbolsDlgEditButton.click(); - sleep(1); String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlg.ok(); math_SymbolsDlgCloseButton.click(); // Verify if the symbol is inserted successfully math_EditWindow.click(5, 5); - math_EditWindow.menuItem("Edit->Select All").select(); - math_EditWindow.menuItem("Edit->Copy").select(); - sleep(1); + app.dispatch(".uno:Select"); + app.dispatch(".uno:Copy"); assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end // Close all dialogs Index: testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java =================================================================== --- testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java (revision 1365470) +++ testgui/source/testcase/gui/formula/importexport/CreateFormulaInDifferentWays.java (working copy) @@ -29,13 +29,13 @@ import static testlib.gui.AppUtil.*; import static testlib.gui.UIMap.*; import static org.junit.Assert.*; +import static org.openoffice.test.common.Testspace.*; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.Ignore; import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.Testspace; - import testlib.gui.Log; /** @@ -49,6 +49,9 @@ @Before public void setUp() throws Exception { app.start(); + + // New a formula document + app.dispatch("private:factory/smath"); } @After @@ -62,24 +65,14 @@ */ @Test public void testElementsWindowActive() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - + // Check if the "View->Elements" menu is selected - math_EditWindow.menuItem("View").select(); - boolean viewElements = math_EditWindow.menuItem("View->Elements").isSelected(); + boolean viewElements = math_ElementsWindow.exists(); + + // Active or inactive the Elements window + app.dispatch(".uno:ToolBox"); - // If the menu is selected, the Elements window should display - assertEquals("Elements window displays correctly", viewElements, math_ElementsWindow.exists()); - - // Active or inactive the Elements window, it should display correctly - math_EditWindow.menuItem("View->Elements").select(); - sleep(1); - math_EditWindow.menuItem("View").select(); - viewElements = math_EditWindow.menuItem("View->Elements").isSelected(); - assertEquals("Elements window display correctly", viewElements, math_ElementsWindow.exists()); + assertNotSame("Elements window active/inactive failed", viewElements, math_ElementsWindow.exists()); } /** @@ -88,51 +81,41 @@ */ @Test public void testCreateFormulaFromElementsWindow() throws Exception{ - String saveTo = Testspace.getPath("temp/" + "FormulaFromElements.odf"); - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); + String saveTo = getPath("temp/" + "FormulaFromElements.odf"); // Make Elements window pop up - math_EditWindow.menuItem("View").select(); - if (!math_EditWindow.menuItem("View->Elements").isSelected()) { - math_EditWindow.menuItem("View->Elements").select(); + if (!math_ElementsWindow.exists()) { + app.dispatch(".uno:ToolBox"); } - math_EditWindow.click(1, 1); // Click a formula in Elements window and edit the formula in the commands window math_ElementsRelations.click(); math_ElementsRelationsNotEqual.click(); - sleep(0.5); typeKeys("a"); - math_EditWindow.menuItem("Edit->Next Marker").select(); - sleep(0.5); + app.dispatch(".uno:NextMark"); typeKeys("b"); String insertedFormula = "a <> b"; // Verify if the formula is correct app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); - sleep(1); assertEquals("The inserted formula into math", insertedFormula.concat(" "), app.getClipboard()); // add " " // Save the formula - math_EditWindow.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); // Close and reopen it - math_EditWindow.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); math_EditWindow.waitForExistence(10, 2); // Verify if the formula still exists in the file, and correct - math_EditWindow.menuItem("Edit->Select All").select(); + app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); - sleep(1); assertEquals("The inserted formula into math", insertedFormula.concat(" "), app.getClipboard()); // add " " // Close all dialogs @@ -145,12 +128,8 @@ */ @Test public void testCreateFormulaFromRightClickMenu() throws Exception{ - String saveTo = Testspace.getPath("temp/FormulaFromRightClickMenu.odf"); + String saveTo = getPath("temp/" + "FormulaFromRightClickMenu.odf"); - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - // Right click in equation editor, choose "Functions->More->arcsin(x)", input a math_EditWindow.rightClick(5, 5); typeKeys(""); @@ -158,37 +137,34 @@ typeKeys(""); typeKeys(""); typeKeys(""); - sleep(0.5); typeKeys(""); typeKeys(""); - sleep(0.5); typeKeys(""); - sleep(0.5); typeKeys("a"); + sleep(2); // If no sleep, error occur on mac String insertedFormula = "arcsin(a)"; // Verify if the formula is correct - math_EditWindow.menuItem("Edit->Select All").select(); + app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); - sleep(1); + assertEquals("The inserted formula into math", insertedFormula.concat(" "), app.getClipboard()); // add " " // Save the formula - math_EditWindow.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); // Close and reopen it - math_EditWindow.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); math_EditWindow.waitForExistence(10, 2); // Verify if the formula still exists in the file, and correct - math_EditWindow.menuItem("Edit->Select All").select(); + app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); - sleep(1); assertEquals("The inserted formula into math", insertedFormula.concat(" "), app.getClipboard()); // add " " // Close all dialogs @@ -199,35 +175,28 @@ * Test undo/redo in math * @throws Exception */ - @Test + @Ignore("Bug 119077 - defect in windows only") public void testUndoRedoInMath() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - // Make Elements window pop up (For AOO3.4: View->Elements) - math_EditWindow.menuItem("View").select(); - if (!math_EditWindow.menuItem("View->Elements").isSelected()) { - math_EditWindow.menuItem("View->Elements").select(); + // Make Elements window pop up + if (!math_ElementsWindow.exists()) { + app.dispatch(".uno:ToolBox"); } - math_EditWindow.click(1, 1); // Click a formula in Elements window and edit the formula in the commands window math_ElementsUnaryBinary.click(); math_ElementsUnaryBinaryPlus.click(); - sleep(1); typeKeys("a"); // "+a"; // Undo and verify if it works fine - math_EditWindow.menuItem("Edit->Undo: Insert").select(); - math_EditWindow.menuItem("Edit->Select All").select(); + app.dispatch(".uno:Undo"); + app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); assertEquals("The inserted formula into math", "+ ", app.getClipboard()); // add " " // Redo and verify if it works fine - math_EditWindow.menuItem("Edit->Redo: Insert").select(); - math_EditWindow.menuItem("Edit->Select All").select(); + app.dispatch(".uno:Redo"); + app.dispatch(".uno:Select"); app.dispatch(".uno:Copy"); assertEquals("The inserted formula into math", "+a ", app.getClipboard()); // add " " } Index: testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java (revision 1365470) +++ testgui/source/testcase/gui/sc/chart/ChartDialogSetting.java (working copy) @@ -49,7 +49,8 @@ app.start(); // Create a new spreadsheet document - startcenter.menuItem("File->New->Spreadsheet").select(); + app.dispatch("private:factory/scalc"); + app.dispatch(".uno:InsertObjectChart"); } @After @@ -64,7 +65,6 @@ */ @Test public void testChartDialogCancelBack() { - calc.menuItem("Insert->Chart...").select(); WizardNextButton.click(); assertTrue(ChartRangeChooseTabPage.isEnabled()); WizardBackButton.click(); @@ -72,14 +72,4 @@ Chart_Wizard.cancel(); assertFalse(Chart_Wizard.exists()); } - - /** - * Verify Chart Wizard dialog title words - */ - @Test - public void testChartWizardTitle() { - calc.menuItem("Insert->Chart...").select(); - assertEquals("Chart Wizard",Chart_Wizard.getText()); - Chart_Wizard.cancel(); - } } Index: testgui/source/testcase/gui/sc/filter/Fitler.java =================================================================== --- testgui/source/testcase/gui/sc/filter/Fitler.java (revision 1365470) +++ testgui/source/testcase/gui/sc/filter/Fitler.java (working copy) @@ -52,7 +52,7 @@ app.start(); // Create a new spreadsheet document - startcenter.menuItem("File->New->Spreadsheet").select(); + app.dispatch("private:factory/scalc"); } @After @@ -62,7 +62,7 @@ /** * - * Verify Chart Wizard dialog title words + * Verify 2+ won't be treated as 2 */ @Ignore("Bug 120076") public void testAutoFilterWithPlusSign() { Index: testgui/source/testcase/gui/sc/sheet/InsertSheet.java =================================================================== --- testgui/source/testcase/gui/sc/sheet/InsertSheet.java (revision 1365470) +++ testgui/source/testcase/gui/sc/sheet/InsertSheet.java (working copy) @@ -60,14 +60,20 @@ @Test public void testInsertMultipleSheet(){ //Open Insert Sheet dialog via main menu Insert-> Sheet - calc.menuItem("Insert->Sheet...").select(); + app.dispatch(".uno:Insert"); //Change new sheet number into 3 to insert 3 new sheet one time SCSheetNumber.setText("3"); //Click OK button to create sheet with default setting SCInsertSheetDlg.ok(); //Verify new sheets have been inserted before Sheet1 - calc.menuItem("Edit->Sheet->Select...").select(); - assertArrayEquals(new String[] { "Sheet4", "Sheet5", "Sheet6", "Sheet1", "Sheet2", "Sheet3" }, SCSheetsList.getItemsText()); + app.dispatch(".uno:SelectTables"); + // To support multi-language, just verify the number in the sheet name + assertTrue(SCSheetsList.getItemsText()[0].contains("4")); + assertTrue(SCSheetsList.getItemsText()[1].contains("5")); + assertTrue(SCSheetsList.getItemsText()[2].contains("6")); + assertTrue(SCSheetsList.getItemsText()[3].contains("1")); + assertTrue(SCSheetsList.getItemsText()[4].contains("2")); + assertTrue(SCSheetsList.getItemsText()[5].contains("3")); SCSelectSheetsDlg.ok(); } @@ -78,12 +84,16 @@ @Test public void testInsertOneSheet(){ //Open Insert Sheet dialog via main menu Insert-> Sheet - calc.menuItem("Insert->Sheet...").select(); + app.dispatch(".uno:Insert"); //Click OK button to create sheet with default setting SCInsertSheetDlg.ok(); //Verify new sheet has been inserted before Sheet1 - calc.menuItem("Edit->Sheet->Select...").select(); - assertArrayEquals(new String[]{"Sheet4", "Sheet1", "Sheet2", "Sheet3"},SCSheetsList.getItemsText()); + app.dispatch(".uno:SelectTables"); + // To support multi-language, just verify the number in the sheet name + assertTrue(SCSheetsList.getItemsText()[0].contains("4")); + assertTrue(SCSheetsList.getItemsText()[1].contains("1")); + assertTrue(SCSheetsList.getItemsText()[2].contains("2")); + assertTrue(SCSheetsList.getItemsText()[3].contains("3")); SCSelectSheetsDlg.ok(); } } Index: testgui/source/testcase/gui/sc/sort/SortDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/sort/SortDialogSetting.java (revision 1365470) +++ testgui/source/testcase/gui/sc/sort/SortDialogSetting.java (working copy) @@ -54,7 +54,7 @@ app.start(); // Create a new spreadsheet document - startcenter.menuItem("File->New->Spreadsheet").select(); + app.dispatch("private:factory/scalc"); } @After @@ -90,7 +90,7 @@ app.dispatch(".uno:ChangeCaseToLower"); // In case SC capitalize first letter automatically // "Data->Sort...", choose "Ascending", check "Case sensitive" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_CaseSensitive.check(); SortOptionsPage.ok(); @@ -99,21 +99,21 @@ assertArrayEquals("Sorted result", expectedSortedResult, CalcUtil.getCellTexts("A2:A6")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A2:A6")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult, CalcUtil.getCellTexts("A2:A6")); // Save and close document String saveTo = getPath("temp/" + "RowsSortWithOptionsCaseSensitive.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result", expectedSortedResult, CalcUtil.getCellTexts("A2:A6")); @@ -149,7 +149,7 @@ typeKeys("DFLKEBCGEAB"); // Data->Sort..., choose "Ascending", check "Copy sort results to:" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_CopyResultTo.check(); SortOptionsPage_CopyResultToEdit.setText("$Sheet3.$A4"); @@ -159,20 +159,20 @@ assertArrayEquals("Copy sorted result to", expectedSortedResult, CalcUtil.getCellTexts("$Sheet3.$A4:$B9")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertEquals("Undo sorted result", "", CalcUtil.getCellText("$Sheet3.$A4")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult, CalcUtil.getCellTexts("$Sheet3.$A4:$B9")); // Move focus to sheet2 then select a cell range, Insert->Names->Define... CalcUtil.selectRange("$Sheet2.$A1:$B3"); - calc.menuItem("Insert->Names->Define...").select(); + app.dispatch(".uno:DefineName"); DefineNamesDlg_NameEdit.setText("cellRange"); DefineNamesDlg.ok(); // Set focus to the original data, Data->Sort... CalcUtil.selectRange("$Sheet1.$B1"); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_CopyResultTo.check(); SortOptionsPage_CopyResultToCellRange.select("cellRange"); @@ -182,21 +182,21 @@ assertArrayEquals("Copy sorted result to cell range", expectedSortedResult, CalcUtil.getCellTexts("$Sheet2.$A1:$B6")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertEquals("Undo sorted result", "", CalcUtil.getCellText("$Sheet2.$A1")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult, CalcUtil.getCellTexts("$Sheet2.$A1:$B6")); // Save and close document String saveTo = getPath("temp/" + "RowsSortWithOptionsCopyResultTo.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result", expectedSortedResult, CalcUtil.getCellTexts("$Sheet3.$A4:$B9")); @@ -241,36 +241,36 @@ typeKeys("DFLKEBCGEAB"); // "Data->Sort...", choose "Ascending", sort first by Column B - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortPage_Ascending1.check(); - SortPage_By1.select("Column B"); + SortPage_By1.select(2); // "Column B" SortPage.ok(); // Verify sorted result assertArrayEquals("Sorted result", expectedResultSortByColumnBAscending, CalcUtil.getCellTexts("A1:B6")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:B6")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultSortByColumnBAscending, CalcUtil.getCellTexts("A1:B6")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Save and close document String saveTo = getPath("temp/" + "SortCriteriaSortFirstBy.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen, "Data->Sort...", choose "Descending", sort first by Column A - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortPage_Descending1.check(); - SortPage_By1.select("Column A"); + SortPage_By1.select(1); // "Column A" SortPage.ok(); // Verify sorted result @@ -315,37 +315,37 @@ typeKeys("DFLKEABGEAB"); // "Data->Sort...", choose "Ascending", sort first by Column B - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortPage_Ascending1.check(); - SortPage_By1.select("Column B"); + SortPage_By1.select(2); // "Column B" SortPage.ok(); // Verify sorted result assertArrayEquals("Sorted result", expectedResultSortFirstByB, CalcUtil.getCellTexts("A1:B6")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:B6")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultSortFirstByB, CalcUtil.getCellTexts("A1:B6")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Save and close document String saveTo = getPath("temp/" + "SortCriteriaSortSecondBy.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen, "Data->Sort...", sort first by Column B "Ascending", sort second by Column A "Descending" - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); - calc.menuItem("Data->Sort...").select(); - SortPage_By1.select("Column B"); + app.dispatch(".uno:DataSort"); + SortPage_By1.select(2); // "Column B" SortPage_Ascending1.check(); - SortPage_By2.select("Column A"); + SortPage_By2.select(1); // "Column A" SortPage_Descending2.check(); SortPage.ok(); @@ -411,11 +411,10 @@ typeKeys("ABFLKEABGEABEFYUDSAB"); CalcUtil.selectRange("C1"); typeKeys("254162781"); - sleep(0.5); // "Data->Sort...", choose "Ascending", sort first by Column B - calc.menuItem("Data->Sort...").select(); - SortPage_By1.select("Column B"); + app.dispatch(".uno:DataSort"); + SortPage_By1.select(2); // "Column B" SortPage_Ascending1.check(); SortPage.ok(); @@ -423,28 +422,28 @@ assertArrayEquals("Sorted result", expectedResultSortFirstByB, CalcUtil.getCellTexts("A1:C9")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:C9")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultSortFirstByB, CalcUtil.getCellTexts("A1:C9")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Save and close document String saveTo = getPath("temp/" + "SortCriteriaSortThirdBy.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen, "Data->Sort...", sort first by Column B "Ascending", sort second by Column C "Descending" - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); - calc.menuItem("Data->Sort...").select(); - SortPage_By1.select("Column B"); + app.dispatch(".uno:DataSort"); + SortPage_By1.select(2); // "Column B" SortPage_Ascending1.check(); - SortPage_By2.select("Column C"); + SortPage_By2.select(3); // "Column C" SortPage_Descending2.check(); SortPage.ok(); @@ -452,12 +451,12 @@ assertArrayEquals("Sorted result", expectedResultSortSecondByC, CalcUtil.getCellTexts("A1:C9")); // "Data->Sort...", sort first by Column B "Ascending", sort second by Column C "Descending", sort third by Column A "Descending" - calc.menuItem("Data->Sort...").select(); - SortPage_By1.select("Column B"); + app.dispatch(".uno:DataSort"); + SortPage_By1.select(2); // "Column B" SortPage_Ascending1.check(); - SortPage_By2.select("Column C"); + SortPage_By2.select(3); // "Column C" SortPage_Descending2.check(); - SortPage_By3.select("Column A"); + SortPage_By3.select(1); // "Column A" SortPage_Descending3.check(); SortPage.ok(); @@ -465,21 +464,21 @@ assertArrayEquals("Sorted result", expectedResultSortThirdByA, CalcUtil.getCellTexts("A1:C9")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", expectedResultSortSecondByC, CalcUtil.getCellTexts("A1:C9")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultSortThirdByA, CalcUtil.getCellTexts("A1:C9")); // Save and close document saveTo = getPath("temp/" + "SortCriteriaSortThirdBy1.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify data sort is not lost - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result", expectedResultSortThirdByA, CalcUtil.getCellTexts("A1:C9")); @@ -515,12 +514,12 @@ // Click "Copy" button, "OK", close the document OptionsDlg_SortListsTabCopy.click(); OptionsDlg.ok(); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); MsgBox_AdditionalRowsNotSaved.no(); // Dependencies end // Create a new spreadsheet document - startcenter.menuItem("File->New->Spreadsheet").select(); + app.dispatch("private:factory/scalc"); // Input some data String[][] data = new String[][] { @@ -557,12 +556,12 @@ // "Data->Sort...", "Options" tab, check "Range contains column labels", no custom sort order, "Ascending", sort first by Color CalcUtil.selectRange("A1:A7"); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_CustomSortOrder.uncheck(); SortPage.select(); - SortPage_By1.select("Color"); + SortPage_By1.select(1); // "Color" SortPage_Ascending1.check(); SortPage.ok(); @@ -570,26 +569,28 @@ assertArrayEquals("Sorted result without custom sort order", expectedResultNoCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultNoCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Copy original data to sheet2 CalcUtil.selectRange("A1:A7"); - calc.menuItem("Edit->Copy").select(); - CalcUtil.selectRange("Sheet2.A1"); - calc.menuItem("Edit->Paste").select(); + app.dispatch(".uno:Copy"); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(1); + SCSelectSheetsDlg.ok(); + app.dispatch(".uno:Paste"); // "Data->Sort...", "Options" tab, check "Range contains column labels", choose custom sort order, "Ascending", sort first by Color - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_CustomSortOrder.check(); SortOptionsPage_CustomSortOrderList.select("red,yellow,blue,green,white,black"); SortPage.select(); - SortPage_By1.select("Color"); + SortPage_By1.select(1); // "Color" SortPage_Ascending1.check(); SortPage.ok(); @@ -597,25 +598,31 @@ assertArrayEquals("Sorted result with custom sort order", expectedResultCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Save and close document String saveTo = getPath("temp/" + "SortOptionsCustomSortOrderPredefineFromCopyList.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); - assertArrayEquals("Original data", data, CalcUtil.getCellTexts("$Sheet1.$A1:$A7")); - assertArrayEquals("Saved sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("$Sheet2.$A1:$A7")); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(0); // Sheet 1 + SCSelectSheetsDlg.ok(); + assertArrayEquals("Original data", data, CalcUtil.getCellTexts("$A1:$A7")); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(1); // Sheet 2 + SCSelectSheetsDlg.ok(); + assertArrayEquals("Saved sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("$A1:$A7")); } /** @@ -643,14 +650,12 @@ OptionsDlg_SortListsTabNew.click(); typeKeys("white,red,yellow,blue,green,black"); OptionsDlg_SortListsTabAdd.click(); - sleep(0.5); OptionsDlg.ok(); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); // Dependencies end // Create a new spreadsheet document - startcenter.menuItem("File->New->Spreadsheet").select(); - sleep(3); + app.dispatch("private:factory/scalc"); // Input some data String[][] data = new String[][] { @@ -687,12 +692,12 @@ // "Data->Sort...", "Options" tab, check "Range contains column labels", no custom sort order, "Ascending", sort first by Color CalcUtil.selectRange("A1:A7"); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_CustomSortOrder.uncheck(); SortPage.select(); - SortPage_By1.select("Color"); + SortPage_By1.select(1); // "Color" SortPage_Ascending1.check(); SortPage.ok(); @@ -700,26 +705,28 @@ assertArrayEquals("Sorted result without custom sort order", expectedResultNoCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultNoCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Copy original data to sheet2 CalcUtil.selectRange("A1:A7"); - calc.menuItem("Edit->Copy").select(); - CalcUtil.selectRange("Sheet2.A1"); - calc.menuItem("Edit->Paste").select(); + app.dispatch(".uno:Copy"); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(1); // Sheet 2 + SCSelectSheetsDlg.ok(); + app.dispatch(".uno:Paste"); // "Data->Sort...", "Options" tab, check "Range contains column labels", choose custom sort order, "Ascending", sort first by Color - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_CustomSortOrder.check(); SortOptionsPage_CustomSortOrderList.select("white,red,yellow,blue,green,black"); SortPage.select(); - SortPage_By1.select("Color"); + SortPage_By1.select(1); // "Color" SortPage_Ascending1.check(); SortPage.ok(); @@ -727,27 +734,34 @@ assertArrayEquals("Sorted result with custom sort order", expectedResultCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("A1:A7")); // Save and close document String saveTo = getPath("temp/" + "SortOptionsCustomSortOrderPredefineFromNewList.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); - assertArrayEquals("Original data", data, CalcUtil.getCellTexts("$Sheet1.$A1:$A7")); - assertArrayEquals("Saved sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("$Sheet2.$A1:$A7")); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(0); // Sheet 1 + SCSelectSheetsDlg.ok(); + assertArrayEquals("Original data", data, CalcUtil.getCellTexts("$A1:$A7")); + app.dispatch(".uno:SelectTables"); + SCSheetsList.select(1); // Sheet 2 + SCSelectSheetsDlg.ok(); + assertArrayEquals("Saved sorted result", expectedResultCustomSortOrder, CalcUtil.getCellTexts("$A1:$A7")); } + /** * Test sort options: sort columns, direction "Left to right" * @throws Exception @@ -764,14 +778,15 @@ }; CalcUtil.selectRange("A1"); typeKeys("Units72741236"); + sleep(1); // If no sleep, some strings lost // "Data->Sort...", check "Range contains column labels", "Left to right", sort first by"Units", "Ascending" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_LeftToRight.check(); SortPage.select(); - SortPage_By1.select("Units"); + SortPage_By1.select(1); // Choose "Units" SortPage_Ascending1.check(); SortPage.ok(); @@ -779,21 +794,21 @@ assertArrayEquals("Sorted result", expectedSortedResult, CalcUtil.getCellTexts("A1:G1")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data, CalcUtil.getCellTexts("A1:G1")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult, CalcUtil.getCellTexts("A1:G1")); // Save and close document String saveTo = getPath("temp/" + "SortOptionsDirectionSortColumns.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result", expectedSortedResult, CalcUtil.getCellTexts("A1:G1")); @@ -838,7 +853,6 @@ // Input source data String file = prepareData("sc/SortOptionsIncludeFormats.ods"); - // String file = testFile("sc/FFC252FFCSC_XML_Datarange0235.xls"); app.dispatch(".uno:Open", 3); submitOpenDlg(file); calc.waitForExistence(10, 2); @@ -888,12 +902,12 @@ // FormatCellsDlg_NumbersPage.ok(); // "Data->Sort...", check "Range contains column labels", check "Include formats", sort first by "Units", "Ascending" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_IncludeFormats.check(); SortPage.select(); - SortPage_By1.select("Units"); + SortPage_By1.select(1); // "Units" SortPage_Ascending1.check(); SortPage.ok(); @@ -901,25 +915,25 @@ assertArrayEquals("Sorted result include formats", expectedSortedResultIncludeFormat, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", dataWithCurrencyFormats, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResultIncludeFormat, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); // Copy the original data to sheet2 CalcUtil.selectRange("A1:A7"); - calc.menuItem("Edit->Copy").select(); + app.dispatch(".uno:Copy"); CalcUtil.selectRange("Sheet2.A1"); - calc.menuItem("Edit->Paste").select(); + app.dispatch(".uno:Paste"); // "Data->Sort...", check "Range contains column labels", uncheck "Include formats", sort first by "Units", "Ascending" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_IncludeFormats.uncheck(); SortPage.select(); - SortPage_By1.select("Units"); + SortPage_By1.select(1); // "Units" SortPage_Ascending1.check(); SortPage.ok(); @@ -927,21 +941,21 @@ assertArrayEquals("Sorted result exclude formats", expectedSortedResultExcludeFormat, CalcUtil.getCellTexts("A1:A7")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", dataWithCurrencyFormats, CalcUtil.getCellTexts("A1:A7")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResultExcludeFormat, CalcUtil.getCellTexts("A1:A7")); // Save and close document String saveTo = getPath("temp/" + "SortOptionsIncludeFormats.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Original data", dataWithCurrencyFormats, CalcUtil.getCellTexts("$Sheet1.$A1:$A7")); @@ -989,13 +1003,14 @@ }; CalcUtil.selectRange("A1"); typeKeys("DCBAE"); + sleep(1); // If no sleep, some strings lost // "Data->Sort...", uncheck "Range contains column labels", sort first by "Column A", "Ascending" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.uncheck(); SortPage.select(); - SortPage_By1.select("Column A"); + SortPage_By1.select(1); // "Column A" SortPage_Ascending1.check(); SortPage.ok(); @@ -1003,9 +1018,9 @@ assertArrayEquals("Sorted result", expectedSortedResult1, CalcUtil.getCellTexts("A1:A5")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data1, CalcUtil.getCellTexts("A1:A5")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult1, CalcUtil.getCellTexts("A1:A5")); // Input data2 into same sheet, data1 and data2 are not overlapped @@ -1014,13 +1029,13 @@ // Focus on data2, "Data->Sort...", "Copy result to" partially overlap with data1, sort first by "Column G", "Ascending" CalcUtil.selectRange("G10"); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.uncheck(); SortOptionsPage_CopyResultTo.check(); SortOptionsPage_CopyResultToEdit.setText("A4"); SortPage.select(); - SortPage_By1.select("Column G"); + SortPage_By1.select(1); // "Column G" SortPage_Ascending1.check(); SortPage.ok(); @@ -1029,14 +1044,14 @@ // Save and close document String saveTo = getPath("temp/" + "SortOptionsMultipleSortDataOverlap.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result", expectedSortedResultDataOverlap, CalcUtil.getCellTexts("A1:A8")); @@ -1083,15 +1098,16 @@ }; CalcUtil.selectRange("A1"); typeKeys("DCBAE"); + sleep(1); // If no sleep, some strings lost // "Data->Sort...", uncheck "Range contains column labels", check "Case sensitive" and "Include formats", sort first by "Column A", "Ascending" - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.uncheck(); SortOptionsPage_CaseSensitive.check(); SortOptionsPage_IncludeFormats.check(); SortPage.select(); - SortPage_By1.select("Column A"); + SortPage_By1.select(1); // "Column A" SortPage_Ascending1.check(); SortPage.ok(); @@ -1099,9 +1115,9 @@ assertArrayEquals("Sorted result1", expectedSortedResult1, CalcUtil.getCellTexts("A1:A5")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data1, CalcUtil.getCellTexts("A1:A5")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult1, CalcUtil.getCellTexts("A1:A5")); // Input data2 into same sheet, data1 and data2 are not overlapped @@ -1110,13 +1126,13 @@ // Focus on data2, "Data->Sort...", check "Range contains column labels", uncheck "Case sensitive" and "Include formats", sort first by "Numbers", "Ascending" CalcUtil.selectRange("G10"); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); SortOptionsPage_RangeContainsColumnLabels.check(); SortOptionsPage_CaseSensitive.uncheck(); SortOptionsPage_IncludeFormats.uncheck(); SortPage.select(); - SortPage_By1.select("Numbers"); + SortPage_By1.select(1); // "Numbers" SortPage_Ascending1.check(); SortPage.ok(); @@ -1124,13 +1140,13 @@ assertArrayEquals("Sorted result2", expectedSortedResult2, CalcUtil.getCellTexts("G10:G15")); // Uodo/redo - calc.menuItem("Edit->Undo: Sort").select(); + app.dispatch(".uno:Undo"); assertArrayEquals("Undo sorted result", data2, CalcUtil.getCellTexts("G10:G15")); - calc.menuItem("Edit->Redo: Sort").select(); + app.dispatch(".uno:Redo"); assertArrayEquals("Redo sorted result", expectedSortedResult2, CalcUtil.getCellTexts("G10:G15")); // Open sort dialog, check its setting - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); assertTrue("Range contains column labels should be checked", SortOptionsPage_RangeContainsColumnLabels.isChecked()); assertFalse("Case sensitive should not be checked", SortOptionsPage_CaseSensitive.isChecked()); @@ -1139,19 +1155,19 @@ // Save and close document String saveTo = getPath("temp/" + "SortOptionsMultipleSortParameterSaved.ods"); - calc.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - calc.menuItem("File->Close").select(); + app.dispatch(".uno:CloseDoc"); openStartcenter(); // Reopen and verify sorted result and sort parameters - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(saveTo); calc.waitForExistence(10, 2); assertArrayEquals("Saved sorted result1", expectedSortedResult1, CalcUtil.getCellTexts("A1:A5")); assertArrayEquals("Saved sorted result2", expectedSortedResult2, CalcUtil.getCellTexts("G10:G15")); - calc.menuItem("Data->Sort...").select(); + app.dispatch(".uno:DataSort"); SortOptionsPage.select(); assertTrue("Range contains column labels should be checked", SortOptionsPage_RangeContainsColumnLabels.isChecked()); assertFalse("Case sensitive should not be checked", SortOptionsPage_CaseSensitive.isChecked()); Index: testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java =================================================================== --- testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java (revision 1365470) +++ testgui/source/testcase/gui/sc/subtotals/SubtotalsFunctions.java (working copy) @@ -51,11 +51,11 @@ public void setUp() throws Exception { app.start(); String file = prepareData("sc/SubtotalsSampleFile.ods"); - startcenter.menuItem("File->Open...").select(); + app.dispatch(".uno:Open"); submitOpenDlg(file); sleep(2); CalcUtil.selectRange("A1:E7"); - calc.menuItem("Data->Subtotals...").select(); + app.dispatch(".uno:DataSubTotals"); } @After @@ -64,14 +64,14 @@ } /** - * + * Just support en-US language * Verify Average function in SubTotals */ @Test public void testAverage() { - SCSubTotalsGroupByListBox.select("Team"); + SCSubTotalsGroupByListBox.select(4); // "Team" SCCalcSubTotalForColumns.click(10, 25); - SCCalcSubTotolsFuncionList.select("Average"); + SCCalcSubTotolsFuncionList.select(2); // "Average" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -82,13 +82,13 @@ } /** - * + * Just support en-US language * Verify Count Numbers only function in SubTotals */ @Test public void testCountNumbersOnly() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Count (numbers only)"); + SCCalcSubTotolsFuncionList.select(6); // "Count (numbers only)" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -99,13 +99,13 @@ } /** - * + * Just support en-US language * Verify Max Numbers function in SubTotals */ @Test public void testMax() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Max"); + SCCalcSubTotolsFuncionList.select(3); // "Max" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -116,13 +116,13 @@ } /** - * + * Just support en-US language * Verify Min Numbers function in SubTotals */ @Test public void testMin() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Min"); + SCCalcSubTotolsFuncionList.select(4); // "Min" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -133,13 +133,13 @@ } /** - * + * Just support en-US language * Verify Product function in SubTotals */ @Test public void testProduct() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Product"); + SCCalcSubTotolsFuncionList.select(5); // "Product" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -150,13 +150,13 @@ } /** - * + * Just support en-US language * Verify StDevP (Population) function in SubTotals */ @Test public void testStDevPPopulation() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("StDevP (Population)"); + SCCalcSubTotolsFuncionList.select(8); // "StDevP (Population)" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -167,13 +167,13 @@ } /** - * + * Just support en-US language * Verify sum function in SubTotals */ @Test public void testSum() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Sum"); + SCCalcSubTotolsFuncionList.select(0); // "Sum" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -184,13 +184,13 @@ } /** - * + * Just support en-US language * Verify Var Sample function in SubTotals */ @Test public void testVarSample() { SCCalcSubTotalForColumns.click(10, 45); - SCCalcSubTotolsFuncionList.select("Var (Sample)"); + SCCalcSubTotolsFuncionList.select(9); // "Var (Sample)" SCSubTotalsGroup1Dialog.ok(); sleep(1); @@ -201,12 +201,12 @@ } /** - * + * Just support en-US language * Verify Don't sort in Sub totals */ @Test public void testDoNotSortOption() { - SCSubTotalsGroupByListBox.select("Team"); + SCSubTotalsGroupByListBox.select(4); // "Team" SCCalcSubTotalForColumns.click(10, 25); SCSubTotalsOptionsTabPage.select(); SCSubtotalsPreSortToGroupCheckBox.uncheck(); @@ -220,7 +220,7 @@ } /** - * + * Just support en-US language * Verify SubTotals Options default UI */ @Test @@ -240,20 +240,20 @@ } /** - * + * Just support en-US language * Verify Subtotals using all group */ @Test public void testUsingAllGroup() { SCSubTotalsGroup1Dialog.select(); - SCSubTotalsGroupByListBox.select("Level"); + SCSubTotalsGroupByListBox.select(1); // "Level" SCCalcSubTotalForColumns.click(10, 45); SCSubTotalsGroup2Dialog.select(); - SCSubTotalsGroupByListBox.select("Team"); + SCSubTotalsGroupByListBox.select(4); // "Team" SCCalcSubTotalForColumns.click(10, 25); - SCCalcSubTotolsFuncionList.select("Max"); + SCCalcSubTotolsFuncionList.select(3); // "Max" SCSubTotalsGroup3Dialog.select(); - SCSubTotalsGroupByListBox.select("Name"); + SCSubTotalsGroupByListBox.select(5); // "Name" SCCalcSubTotalForColumns.click(10, 25); SCSubTotalsGroup1Dialog.select(); SCSubTotalsGroup1Dialog.ok(); @@ -270,7 +270,7 @@ /** - * + * Just support en-US language * Verify Subtotals_Recalculate and refresh results when data rows deleted. */ @Test @@ -285,7 +285,7 @@ { "Grand Total", "", "21", "", "" } }, CalcUtil.getCellTexts("A1:E11")); CalcUtil.selectRange("A3:E3"); - calc.menuItem("Edit->Delete Cells...").select(); + app.dispatch(".uno:DeleteCell"); SCDeleteCellsDeleteRowsRadioButton.check(); SCDeleteCellsDialog.ok(); sleep(1); @@ -298,14 +298,13 @@ } /** - * * Verify Recalculates when source data changed with Average function in SubTotals */ @Test public void testRecalculateWhenDataChanged() { - SCSubTotalsGroupByListBox.select("Team"); + SCSubTotalsGroupByListBox.select(4); // "Team" SCCalcSubTotalForColumns.click(10,25); - SCCalcSubTotolsFuncionList.select("Average"); + SCCalcSubTotolsFuncionList.select(2); // "Average" SCSubTotalsGroup1Dialog.ok(); sleep(1); Index: testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java (revision 1365470) +++ testgui/source/testcase/gui/sc/validity/ValidityDateSupport1024Columns.java (working copy) @@ -65,13 +65,13 @@ */ @Test public void testValidityDateSupport1024Columns() { - startcenter.menuItem("File->New->Spreadsheet").select(); - CalcUtil.selectRange("Sheet1.ALM1000:Sheet1.ALO1005"); - calc.menuItem("Data->Validity...").select(); + app.dispatch("private:factory/scalc"); + CalcUtil.selectRange("ALM1000:ALO1005"); + app.dispatch(".uno:Validation"); SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Date"); - SC_ValidityDecimalCompareOperator.select("greater than"); + SC_ValidityCriteriaAllowList.select(3); // "Date" + SC_ValidityDecimalCompareOperator.select(2); // "greater than" SC_ValiditySourceInput.setText("01/01/08"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); @@ -79,29 +79,29 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.ALM1001"); + CalcUtil.selectRange("ALM1001"); SC_InputBar_Input.activate(); typeKeys("02/01/08"); - assertEquals("02/01/08",CalcUtil.getCellText("Sheet1.ALM1001")); + assertEquals("02/01/08",CalcUtil.getCellText("ALM1001")); - CalcUtil.selectRange("Sheet1.ALM1002"); + CalcUtil.selectRange("ALM1002"); SC_InputBar_Input.activate(); typeKeys("01/02/08"); - assertEquals("01/02/08",CalcUtil.getCellText("Sheet1.ALM1002")); + assertEquals("01/02/08",CalcUtil.getCellText("ALM1002")); - CalcUtil.selectRange("Sheet1.ALM1003"); + CalcUtil.selectRange("ALM1003"); SC_InputBar_Input.activate(); typeKeys("01/01/08"); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.ALM1003")); + assertEquals("",CalcUtil.getCellText("ALM1003")); - CalcUtil.selectRange("Sheet1.AML1003"); + CalcUtil.selectRange("AML1003"); SC_InputBar_Input.activate(); typeKeys("12/31/07"); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.AML1003")); + assertEquals("",CalcUtil.getCellText("AML1003")); } } Index: testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java (revision 1365470) +++ testgui/source/testcase/gui/sc/validity/ValidityDialogDefaultValue.java (working copy) @@ -44,8 +44,8 @@ app.start(); // New a spreadsheet, open Validity dialog - startcenter.menuItem("File->New->Spreadsheet").select(); - calc.menuItem("Data->Validity...").select(); + app.dispatch("private:factory/scalc"); + app.dispatch(".uno:Validation"); } @After @@ -60,7 +60,7 @@ public void testValidityUICellRange() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Cell range"); + SC_ValidityCriteriaAllowList.select(5); // "Cell range" assertEquals(true,SC_ValidityAllowBlankCells.isChecked()); assertEquals(true,SC_ValidityShowSelectionList.isChecked()); @@ -79,12 +79,12 @@ SC_ValidityErrorAlertTabPage.select(); assertEquals(true,SC_ValidityErrorAlertActionList.isEnabled()); - assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); +// assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); // Do not test this. Do it in GVT. assertEquals(true,SC_ValidityErrorMessageTitle.isEnabled()); assertEquals("",SC_ValidityErrorMessageTitle.getText()); assertEquals(true,SC_ValidityErrorMessage.isEnabled()); assertEquals("",SC_ValidityErrorMessage.getText()); - SC_ValidityErrorAlertActionList.select("Macro"); + SC_ValidityErrorAlertActionList.select(3); // "Macro" assertEquals(true,SC_ValidityErrorBrowseButton.isEnabled()); } Index: testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java (revision 1365470) +++ testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java (working copy) @@ -55,9 +55,9 @@ app.start(); // New a spreadsheet, select cell range, open Validity dialog - startcenter.menuItem("File->New->Spreadsheet").select(); - CalcUtil.selectRange("Sheet1.A1:C5"); - calc.menuItem("Data->Validity...").select(); + app.dispatch("private:factory/scalc"); + CalcUtil.selectRange("A1:C5"); + app.dispatch(".uno:Validation"); } @After @@ -71,8 +71,8 @@ @Test public void testAllowDateNotBetween() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Date"); - SC_ValidityDecimalCompareOperator.select("not between"); + SC_ValidityCriteriaAllowList.select(3); // "Date" + SC_ValidityDecimalCompareOperator.select(7); // "not between" SC_ValiditySourceInput.setText("01/01/08"); SC_ValidityMaxValueInput.setText("03/01/08"); SC_ValidityErrorAlertTabPage.select(); @@ -81,65 +81,65 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("12/31/07"); typeKeys(""); - assertEquals("12/31/07",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("12/31/07",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("03/02/08"); typeKeys(""); - assertEquals("03/02/08",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("03/02/08",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("01/01/08"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("",CalcUtil.getCellText("A3")); - CalcUtil.selectRange("Sheet1.A4"); + CalcUtil.selectRange("A4"); SC_InputBar_Input.activate(); typeKeys("03/01/08"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A4")); + assertEquals("",CalcUtil.getCellText("A4")); - CalcUtil.selectRange("Sheet1.A5"); + CalcUtil.selectRange("A5"); SC_InputBar_Input.activate(); typeKeys("01/02/08"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A5")); + assertEquals("",CalcUtil.getCellText("A5")); - CalcUtil.selectRange("Sheet1.B1"); + CalcUtil.selectRange("B1"); SC_InputBar_Input.activate(); typeKeys("02/29/08"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B1")); + assertEquals("",CalcUtil.getCellText("B1")); - CalcUtil.selectRange("Sheet1.B2"); + CalcUtil.selectRange("B2"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B2")); + assertEquals("",CalcUtil.getCellText("B2")); - CalcUtil.selectRange("Sheet1.B3"); + CalcUtil.selectRange("B3"); SC_InputBar_Input.activate(); typeKeys("39448"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B3")); + assertEquals("",CalcUtil.getCellText("B3")); } /** @@ -149,8 +149,8 @@ public void testAllowDecimalEqual() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Decimal"); - SC_ValidityDecimalCompareOperator.select("equal"); + SC_ValidityCriteriaAllowList.select(2); // "Decimal" + SC_ValidityDecimalCompareOperator.select(0); // "equal" SC_ValiditySourceInput.setText("0.33333333"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); @@ -158,43 +158,43 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("0.33333333"); typeKeys(""); - assertEquals("0.33333333",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("0.33333333",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("=1/3"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("0.3"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("",CalcUtil.getCellText("A3")); - CalcUtil.selectRange("Sheet1.A4"); + CalcUtil.selectRange("A4"); SC_InputBar_Input.activate(); typeKeys("0.333333333"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A4")); + assertEquals("",CalcUtil.getCellText("A4")); - CalcUtil.selectRange("Sheet1.B2"); + CalcUtil.selectRange("B2"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B2")); + assertEquals("",CalcUtil.getCellText("B2")); } /** @@ -204,8 +204,8 @@ public void testAllowGreaterTextLength() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Text length"); - SC_ValidityDecimalCompareOperator.select("greater than or equal to"); + SC_ValidityCriteriaAllowList.select(7); // "Text length" + SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to" SC_ValiditySourceInput.setText("10"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); @@ -213,33 +213,33 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("testtesttesttest"); typeKeys(""); - assertEquals("testtesttesttest",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("testtesttesttest",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("test test "); typeKeys(""); - assertEquals("test test ",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("test test ",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A4"); + CalcUtil.selectRange("A4"); SC_InputBar_Input.activate(); typeKeys(" "); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A4")); + assertEquals("",CalcUtil.getCellText("A4")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("Testatest"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("",CalcUtil.getCellText("A3")); } /** @@ -248,11 +248,11 @@ @Ignore("Bug 93128") public void testAllowLessThanTextLength() { - calc.menuItem("Data->Validity...").select(); + app.dispatch(".uno:Validation"); SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Text length"); - SC_ValidityDecimalCompareOperator.select("less than"); + SC_ValidityCriteriaAllowList.select(7); // "Text length" + SC_ValidityDecimalCompareOperator.select(1); // "less than" SC_ValiditySourceInput.setText("10"); SC_ValidityInputHelpTabPage.select(); @@ -267,27 +267,27 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("testtesttesttest"); ActiveMsgBox.ok(); - assertEquals("testtesttesttest",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("testtesttesttest",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("sfsafsddddddd"); ActiveMsgBox.cancel(); - assertEquals("",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("10"); - assertEquals("10",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("10",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("ok"); - assertEquals("ok",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("ok",CalcUtil.getCellText("A3")); } /** @@ -297,7 +297,7 @@ public void testAllowListSpecialChar() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("List"); + SC_ValidityCriteriaAllowList.select(6); // "List" SC_ValidityEntries.focus(); typeKeys("a"); typeKeys(""); @@ -312,15 +312,16 @@ calc.rightClick(1, 1); typeKeys(""); typeKeys(""); // Choose a - assertEquals("a",CalcUtil.getCellText("Sheet1.A1")); + sleep(2); // if no sleep, error occur + assertEquals("a",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.B2"); + CalcUtil.selectRange("B2"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B2")); + assertEquals("",CalcUtil.getCellText("B2")); } /** @@ -330,8 +331,8 @@ public void testAllowTimeBetween() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Time"); - SC_ValidityDecimalCompareOperator.select("between"); + SC_ValidityCriteriaAllowList.select(4); // "Time" + SC_ValidityDecimalCompareOperator.select(6); // "between" SC_ValiditySourceInput.setText("27:00"); SC_ValidityMaxValueInput.setText("21:00"); SC_ValidityErrorAlertTabPage.select(); @@ -340,83 +341,83 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("21:00"); typeKeys(""); - assertEquals("09:00:00 PM",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("09:00:00 PM",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("27:00"); typeKeys(""); - assertEquals("27:00:00",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("27:00:00",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("1.125"); typeKeys(""); - assertEquals("1.125",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("1.125",CalcUtil.getCellText("A3")); - CalcUtil.selectRange("Sheet1.A4"); + CalcUtil.selectRange("A4"); SC_InputBar_Input.activate(); typeKeys("0.875"); typeKeys(""); - assertEquals("0.875",CalcUtil.getCellText("Sheet1.A4")); + assertEquals("0.875",CalcUtil.getCellText("A4")); - CalcUtil.selectRange("Sheet1.B1"); + CalcUtil.selectRange("B1"); SC_InputBar_Input.activate(); typeKeys("03:00:01"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B1")); + assertEquals("",CalcUtil.getCellText("B1")); - CalcUtil.selectRange("Sheet1.B2"); + CalcUtil.selectRange("B2"); SC_InputBar_Input.activate(); typeKeys("20:59:59"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B2")); + assertEquals("",CalcUtil.getCellText("B2")); - CalcUtil.selectRange("Sheet1.B3"); + CalcUtil.selectRange("B3"); SC_InputBar_Input.activate(); typeKeys("1.126"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B3")); + assertEquals("",CalcUtil.getCellText("B3")); - CalcUtil.selectRange("Sheet1.B4"); + CalcUtil.selectRange("B4"); SC_InputBar_Input.activate(); typeKeys("0.874"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B4")); + assertEquals("",CalcUtil.getCellText("B4")); - CalcUtil.selectRange("Sheet1.C1"); + CalcUtil.selectRange("C1"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.C1")); + assertEquals("",CalcUtil.getCellText("C1")); - CalcUtil.selectRange("Sheet1.C2"); + CalcUtil.selectRange("C2"); SC_InputBar_Input.activate(); typeKeys("24:00"); typeKeys(""); - assertEquals("24:00:00",CalcUtil.getCellText("Sheet1.C2")); + assertEquals("24:00:00",CalcUtil.getCellText("C2")); - CalcUtil.selectRange("Sheet1.C3"); + CalcUtil.selectRange("C3"); SC_InputBar_Input.activate(); typeKeys("12:00"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.C3")); + assertEquals("",CalcUtil.getCellText("C3")); } /** @@ -426,39 +427,39 @@ public void testAllowTimeGreaterThan() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Time"); - SC_ValidityDecimalCompareOperator.select("greater than or equal to"); + SC_ValidityCriteriaAllowList.select(4); // "Time" + SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to" SC_ValiditySourceInput.setText("8:00"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); - SC_ValidityErrorAlertActionList.select("Warning"); + SC_ValidityErrorAlertActionList.select(1); // "Warning" SC_ValidityErrorMessageTitle.setText("warning to enter"); SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("7:30"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("07:30:00 AM",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("07:30:00 AM",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("6:00"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.cancel(); - assertEquals("",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.A3"); + CalcUtil.selectRange("A3"); SC_InputBar_Input.activate(); typeKeys("8:00"); typeKeys(""); - assertEquals("08:00:00 AM",CalcUtil.getCellText("Sheet1.A3")); + assertEquals("08:00:00 AM",CalcUtil.getCellText("A3")); } /** @@ -468,8 +469,8 @@ public void testAllowWholeNumLessThan() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Whole Numbers"); - SC_ValidityDecimalCompareOperator.select("less than or equal"); + SC_ValidityCriteriaAllowList.select(1); // "Whole Numbers" + SC_ValidityDecimalCompareOperator.select(3); // "less than or equal" SC_ValiditySourceInput.setText("100"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); @@ -477,41 +478,41 @@ SC_ValidityErrorMessage.setText("Invalid value"); SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("99"); typeKeys(""); - assertEquals("99",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("99",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.A2"); + CalcUtil.selectRange("A2"); SC_InputBar_Input.activate(); typeKeys("100"); typeKeys(""); - assertEquals("100",CalcUtil.getCellText("Sheet1.A2")); + assertEquals("100",CalcUtil.getCellText("A2")); - CalcUtil.selectRange("Sheet1.B1"); + CalcUtil.selectRange("B1"); SC_InputBar_Input.activate(); typeKeys("101"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B1")); + assertEquals("",CalcUtil.getCellText("B1")); - CalcUtil.selectRange("Sheet1.B2"); + CalcUtil.selectRange("B2"); SC_InputBar_Input.activate(); typeKeys("45.5"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.B2")); + assertEquals("",CalcUtil.getCellText("B2")); - CalcUtil.selectRange("Sheet1.C1"); + CalcUtil.selectRange("C1"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); assertEquals("Invalid value",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.C1")); + assertEquals("",CalcUtil.getCellText("C1")); } /** @@ -521,23 +522,23 @@ public void testDefaultErrorAlertMessage() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Decimal"); - SC_ValidityDecimalCompareOperator.select("equal"); + SC_ValidityCriteriaAllowList.select(2); // "Decimal" + SC_ValidityDecimalCompareOperator.select(0); // "equal" SC_ValiditySourceInput.setText("1"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); - SC_ValidityErrorAlertActionList.select("Stop"); + SC_ValidityErrorAlertActionList.select(0); // "Stop" SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("13"); typeKeys(""); assertEquals("OpenOffice.org Calc",ActiveMsgBox.getCaption()); - assertEquals("Invalid value.",ActiveMsgBox.getMessage()); +// assertEquals("Invalid value.",ActiveMsgBox.getMessage()); // Can not verify in multi-language ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("",CalcUtil.getCellText("A1")); } /** @@ -547,20 +548,19 @@ public void testUncheckErrorAlert() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Decimal"); - SC_ValidityDecimalCompareOperator.select("equal"); + SC_ValidityCriteriaAllowList.select(2); // "Decimal" + SC_ValidityDecimalCompareOperator.select(0); // "equal" SC_ValiditySourceInput.setText("1"); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.uncheck(); - SC_ValidityErrorAlertActionList.select("Stop"); + SC_ValidityErrorAlertActionList.select(0); // "Stop" SC_ValidityErrorAlertTabPage.ok(); - CalcUtil.selectRange("Sheet1.A1"); - SC_InputBar_Input.activate(); + CalcUtil.selectRange("A1"); typeKeys("13"); typeKeys(""); - assertEquals("13",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("13",CalcUtil.getCellText("A1")); } /** @@ -570,37 +570,39 @@ public void testValidityCellRangeSourcePicker() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Cell range"); + SC_ValidityCriteriaAllowList.select(5); // "Cell range" SC_ValiditySourcePicker.click(); assertEquals(false,SC_ValidityCriteriaAllowList.exists()); - SC_ValiditySourceInput.setText("$Sheet1.$E$2:$G$5"); + SC_ValiditySourceInput.setText("$E$2:$G$5"); SC_ValiditySourcePicker.click(); assertEquals(true,SC_ValidityCriteriaAllowList.exists()); SC_ValidityErrorAlertTabPage.select(); SC_ValidityShowErrorMessage.check(); - SC_ValidityErrorAlertActionList.select("Stop"); + SC_ValidityErrorAlertActionList.select(0); // "Stop" + SC_ValidityErrorMessageTitle.setText("Stop to enter"); + SC_ValidityErrorMessage.setText("Invalid value."); SC_ValidityErrorAlertTabPage.ok(); // calc.focus(); - CalcUtil.selectRange("Sheet1.E2"); + CalcUtil.selectRange("E2"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); SC_InputBar_Input.activate(); typeKeys("test32"); typeKeys(""); assertEquals("Invalid value.",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); - assertEquals("",CalcUtil.getCellText("Sheet1.A1")); + assertEquals("",CalcUtil.getCellText("A1")); - CalcUtil.selectRange("Sheet1.B1"); + CalcUtil.selectRange("B1"); SC_InputBar_Input.activate(); typeKeys("test"); typeKeys(""); - assertEquals("test",CalcUtil.getCellText("Sheet1.B1")); + assertEquals("test",CalcUtil.getCellText("B1")); } /** @@ -609,28 +611,28 @@ @Test public void testAllowBlankCells() { SC_ValidityCriteriaTabpage.select(); - SC_ValidityCriteriaAllowList.select("Cell range"); + SC_ValidityCriteriaAllowList.select(5); // "Cell range" SC_ValiditySourceInput.setText("$E$1:$E$5"); SC_ValidityAllowBlankCells.check(); SC_ValidityCriteriaTabpage.ok(); - CalcUtil.selectRange("Sheet1.E1"); + CalcUtil.selectRange("E1"); typeKeys("AAAAA"); - CalcUtil.selectRange("Sheet1.A1"); + CalcUtil.selectRange("A1"); typeKeys("A"); - CalcUtil.selectRange("Sheet1.D1"); + CalcUtil.selectRange("D1"); SC_InputBar_Input.activate(); typeKeys(""); - assertEquals("",CalcUtil.getCellText("Sheet1.D1")); + assertEquals("",CalcUtil.getCellText("D1")); - CalcUtil.selectRange("Sheet1.B1"); - calc.menuItem("Data->Validity...").select(); + CalcUtil.selectRange("B1"); + app.dispatch(".uno:Validation"); SC_ValidityCriteriaTabpage.select(); SC_ValidityAllowBlankCells.uncheck(); typeKeys(""); - CalcUtil.selectRange("Sheet1.B1"); + CalcUtil.selectRange("B1"); SC_InputBar_Input.activate(); typeKeys(""); typeKeys(""); Index: testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java =================================================================== --- testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java (revision 1365470) +++ testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java (working copy) @@ -90,7 +90,6 @@ SC_InputBar_Input.activate(); typeKeys(""); - assertEquals("Invalid value.",ActiveMsgBox.getMessage()); ActiveMsgBox.ok(); assertEquals("8",CalcUtil.getCellText("F5")); } @@ -106,9 +105,9 @@ submitOpenDlg(file); calc.waitForExistence(10, 2); - CalcUtil.selectRange("Sheet1.F19"); + CalcUtil.selectRange("F19"); typeKeys("d"); - CalcUtil.selectRange("Sheet1.F17"); + CalcUtil.selectRange("F17"); typeKeys("Test"); assertEquals("Test",CalcUtil.getCellText("F17")); Index: testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java =================================================================== --- testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java (revision 1365470) +++ testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java (working copy) @@ -51,16 +51,13 @@ // New a impress, insert some slides app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(1); for(int i=0; i<5;i++){ SD_InsertPageButtonOnToolbar.click(); - sleep(1); } // Pop up navigator panel - impress.menuItem("View").select(); - if(!impress.menuItem("View->Navigator").isSelected()){ - impress.menuItem("View->Navigator").select(); + if (!SD_NavigatorDlg.exists()) { + app.dispatch(".uno:Navigator"); } } @@ -73,12 +70,11 @@ * 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 - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); @@ -87,14 +83,12 @@ SD_FooterTextOnSlideInput.setText("Footer Test"); SD_SlideNumAsFooterOnSlide.check(); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); + // Click slide 3 ImpressSlideSorter.focus(); - for(int j=0; j<=2;j++){ - typeKeys(""); - } - impress.menuItem("View->Header and Footer...").select(); + typeKeys(""); sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_SlideNumAsFooterOnSlide.uncheck(); SD_ApplyButtonOnSlideFooter.click(); @@ -103,29 +97,22 @@ app.dispatch(".uno:Copy"); app.dispatch(".uno:Paste"); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); + SD_HeaderAndFooterDlgSlideTab.cancel(); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys(""); - typeKeys(""); - //paste to different file impress.focus(); app.dispatch("private:factory/simpress?slot=6686"); PresentationWizard.ok(); - sleep(1); app.dispatch(".uno:Paste"); ImpressSlideSorter.focus(); typeKeys(""); sleep(1); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); @@ -139,30 +126,21 @@ public void testCopySlideWithApplyToAllFooter() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); ImpressSlideSorter.focus(); for(int j=0; j<=2;j++){ typeKeys(""); - sleep(1); } - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_SlideNumAsFooterOnSlide.uncheck(); SD_ApplyButtonOnSlideFooter.click(); @@ -171,31 +149,23 @@ typeKeys(""); app.dispatch(".uno:Copy"); typeKeys(""); - sleep(1); app.dispatch(".uno:Paste"); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + SD_HeaderAndFooterDlgSlideTab.cancel(); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys(""); - typeKeys(""); - //paste to different file - impress.focus(); - impress.menuItem("File->New->Presentation").select(); - sleep(1); + app.dispatch("private:factory/simpress?slot=6686"); + PresentationWizard.ok(); app.dispatch(".uno:Paste"); ImpressSlideSorter.focus(); typeKeys(""); - sleep(1); + sleep(1); // If no sleep, error occur - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); @@ -209,59 +179,42 @@ public void testCopySlideWithNotesHeaderFooter() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); SD_HeaderTextOnNotes.check(); SD_HeaderTextOnNotesInput.setText("Header Test"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); //paste to the same file ImpressSlideSorter.focus(); typeKeys(""); app.dispatch(".uno:Copy"); typeKeys(""); - sleep(1); app.dispatch(".uno:Paste"); - ImpressUtil.getCurView().activate(); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + SD_HeaderAndFooterOnNotesTabPage.cancel(); - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys(""); - typeKeys(""); - //paste to different file impress.focus(); - impress.menuItem("File->New->Presentation").select(); - sleep(1); + app.dispatch("private:factory/simpress?slot=6686"); + PresentationWizard.ok(); app.dispatch(".uno:Paste"); ImpressSlideSorter.focus(); typeKeys(""); - sleep(1); ImpressUtil.getCurView().activate(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -277,32 +230,23 @@ public void testDuplicateSlideWithApplyToAllFooter() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); ImpressSlideSorter.focus(); for(int j=0; j<=2;j++){ typeKeys(""); - sleep(1); } - impress.menuItem("Insert->Duplicate Slide").select(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:DuplicatePage"); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); @@ -312,27 +256,22 @@ * Test footer not show on the first slide. * @throws Exception */ - @Test + @Test//?? public void testFooterNotShowOn1stSlide() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_FooterNotShowOn1stSlide.check(); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); + // Check slide 1 ImpressSlideSorter.focus(); - for(int j=0; j<5; j++){ - typeKeys(""); - } + typeKeys(""); + sleep(1); // If no sleep, error occur - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked()); assertEquals(false,SD_FooterTextOnSlide.isChecked()); } @@ -345,25 +284,17 @@ public void testInsertApplyFooterOnSlide() throws Exception{ //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyButtonOnSlideFooter.click(); - sleep(1); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -378,9 +309,9 @@ ImpressSlideSorter.focus(); typeKeys(""); + sleep(1); // If no sleep, error occur - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("",SD_FooterTextOnSlideInput.getText()); assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); @@ -391,8 +322,7 @@ //end close SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("",SD_FooterTextOnSlideInput.getText()); assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); @@ -406,27 +336,19 @@ public void testInsertApplyToAllFooterOnNotes() throws Exception{ //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); SD_HeaderTextOnNotes.check(); SD_HeaderTextOnNotesInput.setText("Header Test"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals(true,SD_HeaderTextOnNotes.isChecked()); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); @@ -445,8 +367,7 @@ ImpressSlideSorter.focus(); typeKeys(""); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals(true,SD_HeaderTextOnNotes.isChecked()); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); @@ -463,8 +384,7 @@ //end close SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals(true,SD_HeaderTextOnNotes.isChecked()); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); @@ -484,25 +404,17 @@ public void testInsertApplyToAllFooterOnSlide() throws Exception{ //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(2); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -518,8 +430,7 @@ ImpressSlideSorter.focus(); typeKeys(""); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -533,8 +444,7 @@ //end close SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -551,19 +461,16 @@ public void testInsertAutoUpdateTimeFooter() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_AutoUpdateTimeFooter.check(); SD_AutoUpdateTimeFooterType.select(7); String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(2); + sleep(1); // Wait some time to check the time update - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - - String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); - assertFalse(currentTime.equals(currentTime2)); + app.dispatch(".uno:HeaderAndFooter"); + String updatedTime=SD_AutoUpdateTimeFooterType.getItemText(7); + assertNotSame("Time can not update", currentTime, updatedTime); } /** @@ -574,21 +481,18 @@ public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); SD_AutoUpdateTimeFooter.check(); - SD_AutoUpdateTimeFooterType.select(7); String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(2); + sleep(1); // Wait some time to check the time update - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); - String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); + String updatedTime=SD_AutoUpdateTimeFooterType.getItemText(7); - assertFalse(currentTime.equals(currentTime2)); + assertNotSame("Time can not update", currentTime, updatedTime); } /** @@ -600,48 +504,35 @@ public void testInsertHeaderFooterOnNotes() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); SD_HeaderTextOnNotes.check(); SD_HeaderTextOnNotesInput.setText("Header Test"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); ImpressSlideSorter.focus(); typeKeys(""); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + SD_HeaderAndFooterOnNotesTabPage.cancel(); - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys(""); - typeKeys(""); - //save this file - impress.menuItem("File->Save").select(); + app.dispatch(".uno:SaveAs"); String saveTo = getPath("temp/" + "hello.odp"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - impress.menuItem("File->Close").select(); - sleep(2); + app.dispatch(".uno:CloseDoc"); //Reopen this file openStartcenter(); @@ -650,8 +541,7 @@ submitOpenDlg(openFrom); //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_HeaderAndFooterOnNotesTabPage.select(); assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); @@ -668,27 +558,19 @@ public void testInsertHeaderFooterOnSlide() throws Exception{ //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); SD_DateAndTimeFooterOnSlide.check(); SD_FixedDateAndTimeFooterOnSlide.check(); - sleep(1); SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); - sleep(1); SD_FooterTextOnSlide.check(); - sleep(1); SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); SD_SlideNumAsFooterOnSlide.check(); - sleep(1); SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); ImpressSlideSorter.focus(); typeKeys(""); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); @@ -699,12 +581,11 @@ typeKeys(""); //save this file - impress.menuItem("File->Save").select(); + app.dispatch(".uno:SaveAs"); String saveTo = getPath("temp/" + "hello.odp"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - impress.menuItem("File->Close").select(); - sleep(2); + app.dispatch(".uno:CloseDoc"); //Reopen this file openStartcenter(); @@ -713,8 +594,7 @@ submitOpenDlg(openFrom); //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); Index: testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java =================================================================== --- testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (revision 1365470) +++ testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (working copy) @@ -66,8 +66,7 @@ submitOpenDlg(file); //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals(true,SD_FooterTextOnSlide.isChecked()); @@ -78,20 +77,18 @@ SD_ApplyToAllButtonOnSlideFooter.click(); //save to odp and reopen - impress.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); String saveTo2 = getPath("temp/" + "AOO3.4HeaderFooter.odp"); FileUtil.deleteFile(saveTo2); submitSaveDlg(saveTo2); - impress.menuItem("File->Close").select(); - sleep(1); + app.dispatch(".uno:CloseDoc"); openStartcenter(); app.dispatch(".uno:Open"); String openFrom2=getPath("temp/" + "AOO3.4HeaderFooter.odp"); submitOpenDlg(openFrom2); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); //end-save to odp and reopen } @@ -109,8 +106,7 @@ submitOpenDlg(file); //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); assertEquals("testdte",SD_FixedDateAndTimeOnSlideInput.getText()); assertEquals(true,SD_FooterTextOnSlide.isChecked()); @@ -121,23 +117,20 @@ SD_ApplyToAllButtonOnSlideFooter.click(); //save to ppt and reopen - impress.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); String saveTo = getPath("temp/" + "gfdd.ppt"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); if (AlienFormatDlg.exists(3)) AlienFormatDlg.ok(); - sleep(1); - impress.menuItem("File->Close").select(); - sleep(1); + app.dispatch(".uno:CloseDoc"); openStartcenter(); app.dispatch(".uno:Open"); String openFrom=getPath("temp/" + "gfdd.ppt"); submitOpenDlg(openFrom); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); //end-save to ppt and reopen @@ -148,20 +141,18 @@ //end //save to odp and reopen - impress.menuItem("File->Save As...").select(); + app.dispatch(".uno:SaveAs"); String saveTo2 = getPath("temp/" + "gfdd.odp"); FileUtil.deleteFile(saveTo2); submitSaveDlg(saveTo2); - impress.menuItem("File->Close").select(); - sleep(1); + app.dispatch(".uno:CloseDoc"); openStartcenter(); app.dispatch(".uno:Open"); String openFrom2=getPath("temp/" + "gfdd.odp"); submitOpenDlg(openFrom2); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); + app.dispatch(".uno:HeaderAndFooter"); assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); //end-save to odp and reopen } Index: testgui/source/testcase/gui/sw/table/Table.java =================================================================== --- testgui/source/testcase/gui/sw/table/Table.java (revision 1365470) +++ testgui/source/testcase/gui/sw/table/Table.java (working copy) @@ -63,27 +63,25 @@ public void testConvertTableToText() throws Exception{ //Create a new text document - startcenter.menuItem("File->New->Text Document").select(); - sleep(3); + app.dispatch("private:factory/swriter"); // Insert a table and input some data - writer.menuItem("Insert->Table...").select(); + app.dispatch(".uno:InsertTable"); writer_InsertTable.ok(); writer.focus(); typeKeys("1234"); sleep(1); // Convert table to text - writer.menuItem("Table->Convert->Table to Text...").select(); + app.dispatch(".uno:ConvertTableToText"); assertTrue("Convert Table to Text dialog pop up", writer_ConvertTableToTextDlg.exists()); typeKeys(""); - sleep(1); // Verify if text is converted successfully - writer.menuItem("Edit->Select All").select(); + app.dispatch(".uno:SelectAll"); app.dispatch(".uno:Copy"); if (SystemUtil.isWindows()) - assertEquals("Converted text", "1\t2\r\n3\t4\r\n", app.getClipboard()); // windows�лس�������\r\n + assertEquals("Converted text", "1\t2\r\n3\t4\r\n", app.getClipboard()); // in windows, \n is \r\n else assertEquals("Converted text", "1\t2\n3\t4\n", app.getClipboard()); } Index: testgui/source/testlib/gui/UIMap.java =================================================================== --- testgui/source/testlib/gui/UIMap.java (revision 1365470) +++ testgui/source/testlib/gui/UIMap.java (working copy) @@ -348,6 +348,8 @@ // Spreadsheet: "Select Sheets" dialog public static final VclDialog SCSelectSheetsDlg = dialog(".uno:SelectTables"); public static final VclListBox SCSheetsList = listbox("SC_HID_SELECTTABLES"); + public static final VclWindow SD_NavigatorDlg = window("SD_HID_SD_NAVIGATOR"); + public static final VclTabPage SD_HeaderAndFooterDlgSlideTab = tabpage("SD_HID_SD_TABPAGE_HEADERFOOTER_SLIDE");