You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by li...@apache.org on 2012/08/02 02:41:02 UTC
svn commit: r1368326 - in /incubator/ooo/trunk/main/test/testgui/source:
testcase/gui/ testcase/gui/formula/catalog/ testcase/gui/sc/sort/
testcase/gui/sd/headerandfooter/ testlib/gui/
Author: liuzhe
Date: Thu Aug 2 00:41:01 2012
New Revision: 1368326
URL: http://svn.apache.org/viewvc?rev=1368326&view=rev
Log:
#120384# - Create VclTreeListBox for WINDOW_TREELISTBOX controls.
Patch By: Li Lin Yi
Review By: Liu Zhe
Modified:
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFileType.java
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFunction.java
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/sort/SortDialogSetting.java
incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java
incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFileType.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFileType.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFileType.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFileType.java Thu Aug 2 00:41:01 2012
@@ -19,12 +19,11 @@
*
*************************************************************/
-
-
/**
*
*/
package testcase.gui;
+
import static org.openoffice.test.common.Testspace.*;
import static org.junit.Assert.*;
import static org.openoffice.test.vcl.Tester.*;
@@ -51,7 +50,7 @@ public class BVTFileType {
@Rule
public Log LOG = new Log();
-
+
@Before
public void setUp() throws Exception {
app.start();
@@ -61,50 +60,51 @@ public class BVTFileType {
public void tearDown() throws Exception {
app.close();
}
-
+
/**
* Test New/Save a text document
+ *
* @throws Exception
*/
@Test
public void testSaveNewODT() throws Exception {
saveNewDocument("helloworld_saveas.odt");
}
-
+
@Test
public void testSaveNewOTT() throws Exception {
saveNewDocument("helloworld_saveas.ott");
}
-
+
@Test
public void testSaveNewSXW() throws Exception {
saveNewDocument("helloworld_saveas.sxw");
}
-
+
@Test
public void testSaveNewSTW() throws Exception {
saveNewDocument("helloworld_saveas.stw");
}
-
+
@Test
public void testSaveNewDOC() throws Exception {
saveNewDocument("helloworld_saveas.doc");
}
-
+
@Test
public void testSaveNewTXT() throws Exception {
saveNewDocument("helloworld_saveas.txt");
}
-
+
private void saveNewDocument(String file) {
String saveTo = getPath("temp/" + file);
- //Create a new text document
+ // Create a new text document
app.dispatch("private:factory/swriter");
sleep(3);
-
+
// Input some text by keyboard
writer.focus();
-
+
String text = "~!@#$%^&*()_+QWERTYUIOP{}|:LKJHGFDSAZXCVBNM<>? ";
typeText(text);
app.dispatch(".uno:SelectAll");
@@ -112,27 +112,27 @@ public class BVTFileType {
sleep(1);
typeKeys("<$copy>");
sleep(1);
-
+
// Verify the text via system clip board
- Assert.assertEquals("The typed text into writer", text, app.getClipboard());
-
+ Assert.assertEquals("The typed text into writer", text,
+ app.getClipboard());
+
// Set the text style
writer.openContextMenu();
-// menuItem("Text Properties...").select();
+ // menuItem("Text Properties...").select();
app.dispatch(".uno:FontDialog");
EffectsPage.select();
EffectsPage_Color.select(6);
EffectsPage.ok();
sleep(2);
-
- //Save the text document
+
+ // Save the text document
app.dispatch(".uno:SaveAs");
FileUtil.deleteFile(saveTo);
- submitSaveDlg(saveTo);
+ submitSaveDlg(saveTo);
if (AlienFormatDlg.exists(3))
AlienFormatDlg.ok();
-
-
+
// Close it by clicking main menu
app.dispatch(".uno:CloseDoc");
openStartcenter();
@@ -140,48 +140,46 @@ public class BVTFileType {
app.dispatch(".uno:Open");
submitOpenDlg(saveTo);
writer.waitForExistence(10, 2);
-
+
app.dispatch(".uno:SelectAll");
app.setClipboard(".wrong");
typeKeys("<$copy>");
sleep(1);
// Verify if the text still exists in the file
- Assert.assertEquals("The typed text into writer is saved!", text, app.getClipboard());
+ Assert.assertEquals("The typed text into writer is saved!", text,
+ app.getClipboard());
}
-
+
@Test
public void testSaveNewODS() throws Exception {
saveNewSpreadsheet("helloworld_saveas.ods");
}
-
+
@Test
public void testSaveNewOTS() throws Exception {
saveNewSpreadsheet("helloworld_saveas.ots");
}
-
-
+
@Test
public void testSaveNewSXC() throws Exception {
saveNewSpreadsheet("helloworld_saveas.sxc");
}
-
-
+
@Test
public void testSaveNewSTC() throws Exception {
saveNewSpreadsheet("helloworld_saveas.stc");
}
-
-// @Test
-// public void testSaveNewCSV() throws Exception {
-// saveNewSpreadsheet("helloworld_saveas.csv");
-// }
-
-
+
+ // @Test
+ // public void testSaveNewCSV() throws Exception {
+ // saveNewSpreadsheet("helloworld_saveas.csv");
+ // }
+
@Test
public void testSaveNewXLS() throws Exception {
saveNewSpreadsheet("helloworld_saveas.xls");
}
-
+
private void saveNewSpreadsheet(String file) {
String saveTo = getPath("temp/" + file);
String text = "Hello Openoffice";
@@ -191,7 +189,7 @@ public class BVTFileType {
typeKeys(text);
app.dispatch(".uno:SaveAs");
FileUtil.deleteFile(saveTo);
- submitSaveDlg(saveTo);
+ submitSaveDlg(saveTo);
if (AlienFormatDlg.exists(3))
AlienFormatDlg.ok();
// Close it by clicking main menu
@@ -201,41 +199,40 @@ public class BVTFileType {
app.dispatch(".uno:Open");
submitOpenDlg(saveTo);
calc.waitForExistence(10, 2);
- Assert.assertEquals("The typed text is saved!", text, CalcUtil.getCellText("A65536"));
+ Assert.assertEquals("The typed text is saved!", text,
+ CalcUtil.getCellText("A65536"));
}
-
+
@Test
public void testSaveNewODP() throws Exception {
saveNewPresentation("helloworld_saveas.odp");
}
-
+
@Test
public void testSaveNewOTP() throws Exception {
saveNewPresentation("helloworld_saveas.otp");
}
-
+
@Test
public void testSaveNewPPT() throws Exception {
saveNewPresentation("helloworld_saveas.ppt");
}
-
+
@Test
public void testSaveNewPOT() throws Exception {
saveNewPresentation("helloworld_saveas.pot");
}
-
-
+
@Test
public void testSaveNewSXI() throws Exception {
saveNewPresentation("helloworld_saveas.sxi");
}
-
+
@Test
public void testSaveNewSTI() throws Exception {
saveNewPresentation("helloworld_saveas.sti");
}
-
-
+
private void saveNewPresentation(String file) {
String saveTo = getPath("temp/" + file);
String text = "Hello Openoffice";
@@ -263,15 +260,15 @@ public class BVTFileType {
impress.click(3, 3);
typeKeys("<tab><enter>");
app.dispatch(".uno:SelectAll");
-// app.setClipboard(".wrong");
+ // app.setClipboard(".wrong");
typeKeys("<$copy>");
sleep(1);
- Assert.assertEquals("The typed text is saved!", text,
- app.getClipboard().trim());
+ Assert.assertEquals("The typed text is saved!", text, app
+ .getClipboard().trim());
}
-
+
// drawing
-
+
/**
* Test save a new drawing as .odg
*/
@@ -279,7 +276,7 @@ public class BVTFileType {
public void testSaveNewODG() throws Exception {
saveNewDrawing("draw_saveas.odg");
}
-
+
/**
* Test save a new drawing as .otg
*/
@@ -287,7 +284,7 @@ public class BVTFileType {
public void testSaveNewOTG() throws Exception {
saveNewDrawing("draw_saveas.otg");
}
-
+
/**
* Test save a new drawing as .sxd
*/
@@ -295,7 +292,7 @@ public class BVTFileType {
public void testSaveNewSXD() throws Exception {
saveNewDrawing("draw_saveas.sxd");
}
-
+
/**
* Test save a new drawing as .std
*/
@@ -303,138 +300,141 @@ public class BVTFileType {
public void testSaveNewSTD() throws Exception {
saveNewDrawing("draw_saveas.std");
}
-
+
/**
- * New/Save a draw document
- * 1. New a draw document
- * 2. Insert a picture
- * 3. Save it as the input filename
- * 4. Reopen the saved file
- * 5. Check if the picture is still there
- * @param filename: filename to be saved
+ * New/Save a draw document 1. New a draw document 2. Insert a picture 3.
+ * Save it as the input filename 4. Reopen the saved file 5. Check if the
+ * picture is still there
+ *
+ * @param filename
+ * : filename to be saved
* @throws Exception
*/
public void saveNewDrawing(String filename) {
String saveTo = getPath("temp/" + filename);
String bmp_green = prepareData("pure_green_64x64.bmp");
-
+
// Create a new drawing document
app.dispatch("private:factory/sdraw");
sleep(3);
-
+
// Insert a picture fully filled with green
app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_green);
sleep(3);
// Focus on edit pane
- draw.click(5,5);
+ draw.click(5, 5);
sleep(1);
-
+
// Verify if the picture is inserted successfully
- Rectangle rectangle = GraphicsUtil.findRectangle(draw.getScreenRectangle(), 0xFF00FF00);
+ Rectangle rectangle = GraphicsUtil.findRectangle(
+ draw.getScreenRectangle(), 0xFF00FF00);
assertNotNull("Green rectangle: " + rectangle, rectangle);
-
+
// Save the drawing
app.dispatch(".uno:SaveAs");
FileUtil.deleteFile(saveTo);
submitSaveDlg(saveTo);
- // If the format is supported by OO1.0, ask whether to change to the latest format
+ // If the format is supported by OO1.0, ask whether to change to the
+ // latest format
if (AlienFormatDlg.exists(3))
- AlienFormatDlg.ok(); // Keep the current format
-
+ AlienFormatDlg.ok(); // Keep the current format
+
// Close it by clicking main menu
app.dispatch(".uno:CloseDoc");
openStartcenter();
-
+
// Reopen the saved file
app.dispatch(".uno:Open");
submitOpenDlg(saveTo);
draw.waitForExistence(10, 2);
-
+
// Verify if the picture still exists in the file
- Rectangle rectangle1 = GraphicsUtil.findRectangle(draw.getScreenRectangle(), 0xFF00FF00);
- assertNotNull("Green rectangle: " + rectangle1, rectangle1);
+ Rectangle rectangle1 = GraphicsUtil.findRectangle(
+ draw.getScreenRectangle(), 0xFF00FF00);
+ assertNotNull("Green rectangle: " + rectangle1, rectangle1);
}
-
+
// math
/**
* Test save a new math as .odf
*/
@Test
- public void testSaveNewODF() throws Exception{
+ public void testSaveNewODF() throws Exception {
saveNewMath("math_saveas.odf");
}
-
+
/**
* Test save a new math as .sxm
*/
@Test
- public void testSaveNewSXM() throws Exception{
+ public void testSaveNewSXM() throws Exception {
saveNewMath("math_saveas.sxm");
}
-
+
/**
* Test save a new math as .mml
*/
@Test
- public void testSaveNewMML() throws Exception{
+ public void testSaveNewMML() throws Exception {
saveNewMath("math_saveas.mml");
}
-
+
/**
- * New/Save a math
- * 1. New a math
- * 2. Insert a formula
- * 3. Save it as the input filename
- * 4. Reopen the saved file
- * 5. Check if the formula is still there
- * @param filename: filename to be saved
+ * New/Save a math 1. New a math 2. Insert a formula 3. Save it as the input
+ * filename 4. Reopen the saved file 5. Check if the formula is still there
+ *
+ * @param filename
+ * : filename to be saved
* @throws Exception
*/
public void saveNewMath(String filename) {
String saveTo = getPath("temp/" + filename);
-
+
// Create a new math
app.dispatch("private:factory/smath");
sleep(3);
-
- // Verify if the Elements window is active
+
+ // Verify if the Elements window is active
assertTrue(math_ElementsWindow.exists(3));
-
+
// Insert a formula
String text = "5 times 3 = 15";
typeText(text);
app.dispatch(".uno:Select");
typeKeys("<$copy>");
sleep(1);
-
+
// Verify the text via system clip board
assertEquals("The typed formula into math", text, app.getClipboard());
-
+
// Save the formula
app.dispatch(".uno:SaveAs");
FileUtil.deleteFile(saveTo);
submitSaveDlg(saveTo);
- // If the format is supported by OO1.0, ask whether to change to the latest format
+ // If the format is supported by OO1.0, ask whether to change to the
+ // latest format
if (AlienFormatDlg.exists(3))
- AlienFormatDlg.ok(); // Keep the current format
-
+ AlienFormatDlg.ok(); // Keep the current format
+
// Close it by clicking main menu
app.dispatch(".uno:CloseDoc");
openStartcenter();
-
+
// Reopen the saved file
app.dispatch(".uno:Open");
submitOpenDlg(saveTo);
math_EditWindow.waitForExistence(10, 2);
-
+
// Verify if the formula still exists in the file
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
+ 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");
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFunction.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFunction.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFunction.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/BVTFunction.java Thu Aug 2 00:41:01 2012
@@ -19,12 +19,11 @@
*
*************************************************************/
-
-
/**
*
*/
package testcase.gui;
+
import static org.openoffice.test.common.Testspace.*;
import static org.junit.Assert.*;
import static org.openoffice.test.vcl.Tester.*;
@@ -49,10 +48,9 @@ import testlib.gui.Log;
*/
public class BVTFunction {
-
@Rule
public Log LOG = new Log();
-
+
@Before
public void setUp() throws Exception {
app.start();
@@ -62,14 +60,13 @@ public class BVTFunction {
public void tearDown() throws Exception {
app.close();
}
-
-
+
@Test
- public void testExportAsPDF() throws Exception {
+ public void testExportAsPDF() throws Exception {
String file = prepareData("export_pdf.odt");
String exportTo = getPath("temp/odt.pdf");
-
- app.dispatch(".uno:Open", 3);
+
+ app.dispatch(".uno:Open");
submitOpenDlg(file);
writer.waitForExistence(10, 2);
app.dispatch(".uno:ExportToPDF");
@@ -79,218 +76,225 @@ public class BVTFunction {
assertTrue("PDF is exported?", new File(exportTo).exists());
assertTrue(toolbox(".HelpId:standardbar").exists(5));
button(".uno:ExportDirectToPDF").click();
- assertEquals("PDF - Portable Document Format (.pdf)", FileSave_FileType.getSelText());
- FileSave.cancel();
+ assertEquals("PDF - Portable Document Format (.pdf)",
+ FileSave_FileType.getSelText());
+ FileSave.cancel();
}
-
+
/**
- * Test the File -- Print Dialog show
+ * Test the File -- Print Dialog show
*
- */
+ */
@Test
- public void testPrintDialog()
- {
- //Create a new text document
- app.dispatch("private:factory/swriter", 3);
- sleep(3);
- app.dispatch(".uno:Print", 3);
+ public void testPrintDialog() {
+ // Create a new text document
+ app.dispatch("private:factory/swriter");
+ sleep(3);
+ app.dispatch(".uno:Print");
assertTrue(File_PrintDlg.exists(5));
File_PrintDlg.cancel();
- }
-
+ }
+
/**
- * Test the File -- Java Dialog show
+ * Test the File -- Java Dialog show
*
- */
+ */
@Test
- public void testJavaDialog()
- {
-
- //Create a new text document and launch a Wizards dialog which need JVM work correctly.
- app.dispatch("private:factory/swriter", 3);
- File tempfile=new File(oo.getUserInstallation(),"user/template/myAgendaTemplate.ott");
+ public void testJavaDialog() {
+
+ // Create a new text document and launch a Wizards dialog which need JVM
+ // work correctly.
+ app.dispatch("private:factory/swriter");
+ File tempfile = new File(oo.getUserInstallation(),
+ "user/template/myAgendaTemplate.ott");
FileUtil.deleteFile(tempfile);
- sleep(3);
+ sleep(3);
app.dispatch("service:com.sun.star.wizards.agenda.CallWizard?start");
- sleep(5);
+ sleep(5);
assertTrue(Wizards_AgendaDialog.exists(10));
Wizards_AgendaDialog_FinishButton.click();
- sleep(10);
+ sleep(10);
writer.focus();
sleep(1);
- app.dispatch(".uno:SelectAll", 3);
+ app.dispatch(".uno:SelectAll");
typeKeys("<$copy>");
- //System.out.println("now txt:"+app.getClipboard());
-// assertTrue(app.getClipboard().startsWith("<Name>"));
+ // System.out.println("now txt:"+app.getClipboard());
+ // assertTrue(app.getClipboard().startsWith("<Name>"));
assertNotNull(app.getClipboard());
- }
-
+ }
+
/**
- * Test the Tools / Macros / Organize Dialogs" show
+ * Test the Tools / Macros / Organize Dialogs" show
*
- */
+ */
@Test
- public void testMacroToolsOrgDialog()
- {
+ public void testMacroToolsOrgDialog() {
app.dispatch(".uno:MacroOrganizer?TabId:short=1");
assertTrue(MacroDialogsPage.exists(5));
MacroDialogsPage.cancel();
}
-
-
+
/**
- * Test the About Dialog show
+ * Test the About Dialog show
*
- */
+ */
@Test
- public void testAboutDialog()
- {
+ public void testAboutDialog() {
app.dispatch(".uno:About");
assertTrue(AboutDialog.exists(5));
AboutDialog.ok();
}
-
+
/**
* Test inserting a picture in text document
+ *
* @throws Exception
*/
-
-
+
@Test
public void testInsertPictureInDocument() throws Exception {
String bmp_green = prepareData("pure_green_64x64.bmp");
String bmp_red = prepareData("pure_red_64x64.bmp");
-
- //Create a new text document
- app.dispatch("private:factory/swriter", 3);
+
+ // Create a new text document
+ app.dispatch("private:factory/swriter");
sleep(3);
-
- //Insert a picture fully filled with green
+
+ // Insert a picture fully filled with green
writer.click(400, 400);
- app.dispatch(".uno:InsertGraphic", 3);
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_green);
sleep(3);
writer.click(0.5, 0.5);
sleep(1);
-
+
// Verify if the picture is inserted successfully
- Rectangle rectangle = GraphicsUtil.findRectangle(writer.getScreenRectangle(), 0xFF00FF00);
-
+ Rectangle rectangle = GraphicsUtil.findRectangle(
+ writer.getScreenRectangle(), 0xFF00FF00);
+
assertNotNull("Green rectangle: " + rectangle, rectangle);
-
- //insert another picture
- app.dispatch(".uno:InsertGraphic", 3);
+
+ // insert another picture
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_red);
sleep(3);
writer.click(0.5, 0.5);
sleep(1);
// Verify if the picture is inserted successfully
- rectangle = GraphicsUtil.findRectangle(writer.getScreenRectangle(), 0xFFFF0000);
+ rectangle = GraphicsUtil.findRectangle(writer.getScreenRectangle(),
+ 0xFFFF0000);
assertNotNull("Red rectangle: " + rectangle, rectangle);
}
-
@Test
public void testInsertPictureInSpreadsheet() throws Exception {
String bmp_green = prepareData("pure_green_64x64.bmp");
String bmp_red = prepareData("pure_red_64x64.bmp");
-
- //Create a new text document
- app.dispatch("private:factory/scalc", 3);
- sleep(3);
-
- //Insert a picture fully filled with green
- app.dispatch(".uno:InsertGraphic", 3);
+
+ // Create a new text document
+ app.dispatch("private:factory/scalc");
+ sleep(3);
+
+ // Insert a picture fully filled with green
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_green);
sleep(3);
calc.click(0.5, 0.5);
sleep(1);
-
+
// Verify if the picture is inserted successfully
- Rectangle rectangle = GraphicsUtil.findRectangle(calc.getScreenRectangle(), 0xFF00FF00);
-
+ Rectangle rectangle = GraphicsUtil.findRectangle(
+ calc.getScreenRectangle(), 0xFF00FF00);
+
assertNotNull("Green rectangle: " + rectangle, rectangle);
-// assertEquals(new Rectangle(0,0,64,64), rectangle);
+ // assertEquals(new Rectangle(0,0,64,64), rectangle);
CalcUtil.selectRange("C1");
- //insert another picture
- app.dispatch(".uno:InsertGraphic", 3);
+ // insert another picture
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_red);
sleep(3);
calc.click(0.5, 0.5);
sleep(1);
// Verify if the picture is inserted successfully
- rectangle = GraphicsUtil.findRectangle(calc.getScreenRectangle(), 0xFFFF0000);
+ rectangle = GraphicsUtil.findRectangle(calc.getScreenRectangle(),
+ 0xFFFF0000);
assertNotNull("Red rectangle: " + rectangle, rectangle);
}
-
+
@Test
public void testInsertPictureInPresentation() throws Exception {
String bmp_green = prepareData("pure_green_64x64.bmp");
String bmp_red = prepareData("pure_red_64x64.bmp");
-
- //Create a new text document
+
+ // Create a new text document
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
sleep(3);
-
- //Insert a picture fully filled with green
- app.dispatch(".uno:InsertGraphic", 3);
+
+ // Insert a picture fully filled with green
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_green);
sleep(3);
- impress.click(5,5);
+ impress.click(5, 5);
sleep(1);
-
+
// Verify if the picture is inserted successfully
- Rectangle rectangle = GraphicsUtil.findRectangle(impress.getScreenRectangle(), 0xFF00FF00);
-
+ Rectangle rectangle = GraphicsUtil.findRectangle(
+ impress.getScreenRectangle(), 0xFF00FF00);
+
assertNotNull("Green rectangle: " + rectangle, rectangle);
-// assertEquals(new Rectangle(0,0,64,64), rectangle);
-
- //insert another picture
- app.dispatch(".uno:InsertGraphic", 3);
+ // assertEquals(new Rectangle(0,0,64,64), rectangle);
+
+ // insert another picture
+ app.dispatch(".uno:InsertGraphic");
submitOpenDlg(bmp_red);
sleep(3);
impress.click(1, 1);
sleep(1);
// Verify if the picture is inserted successfully
- rectangle = GraphicsUtil.findRectangle(impress.getScreenRectangle(), 0xFFFF0000);
+ rectangle = GraphicsUtil.findRectangle(impress.getScreenRectangle(),
+ 0xFFFF0000);
assertNotNull("Red rectangle: " + rectangle, rectangle);
}
-
+
@Test
public void testSlideShow() throws Exception {
String file = prepareData("slideshow.odp");
- app.dispatch(".uno:Open", 3);
+ app.dispatch(".uno:Open");
submitOpenDlg(file);
impress.waitForExistence(10, 2);
- app.dispatch(".uno:Presentation", 3);
+ app.dispatch(".uno:Presentation");
sleep(3);
- Rectangle rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(), 0xFFFF0000);
+ Rectangle rectangle = GraphicsUtil.findRectangle(
+ SlideShow.getScreenRectangle(), 0xFFFF0000);
assertNotNull("1st slide appears", rectangle);
SlideShow.click(0.5, 0.5);
sleep(2);
- rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(), 0xFF00FF00);
+ rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(),
+ 0xFF00FF00);
assertNotNull("2nd slide appears", rectangle);
typeKeys("<enter>");
sleep(2);
- rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(), 0xFF0000FF);
+ rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(),
+ 0xFF0000FF);
assertNotNull("3rd slide appears", rectangle);
SlideShow.click(0.5, 0.5);
sleep(2);
- rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(), 0xFF0000FF);
+ rectangle = GraphicsUtil.findRectangle(SlideShow.getScreenRectangle(),
+ 0xFF0000FF);
assertNull("The end", rectangle);
SlideShow.click(0.5, 0.5);
sleep(3);
assertFalse("Quit", SlideShow.exists());
}
-
+
@Test
public void testFind() {
String file = prepareData("find.odt");
- app.dispatch(".uno:Open", 3);
+ app.dispatch(".uno:Open");
submitOpenDlg(file);
writer.waitForExistence(10, 2);
- app.dispatch(".uno:SearchDialog", 3);
+ app.dispatch(".uno:SearchDialog");
FindDlg_For.setText("OpenOffice");
FindDlg_Find.click();
sleep(1);
@@ -308,110 +312,86 @@ public class BVTFunction {
msgbox("Search key replaced 3 times.").ok();
FindDlg.close();
sleep(1);
- app.dispatch(".uno:SelectAll", 3);
+ app.dispatch(".uno:SelectAll");
typeKeys("<$copy>");
- assertEquals("Apache Awesome OpenOffice is comprised of six personal productivity applications: a word processor (and its web-authoring component), spreadsheet, presentation graphics, drawing, equation editor, and database. Awesome OpenOffice is released on Windows, Solaris, Linux and Macintosh operation systems, with more communities joining, including a mature FreeBSD port. Awesome OpenOffice is localized, supporting over 110 languages worldwide. ", app.getClipboard());
+ assertEquals(
+ "Apache Awesome OpenOffice is comprised of six personal productivity applications: a word processor (and its web-authoring component), spreadsheet, presentation graphics, drawing, equation editor, and database. Awesome OpenOffice is released on Windows, Solaris, Linux and Macintosh operation systems, with more communities joining, including a mature FreeBSD port. Awesome OpenOffice is localized, supporting over 110 languages worldwide. ",
+ app.getClipboard());
}
-
+
@Test
public void testFillInSpreadsheet() {
- String[][] expected1 = new String[][] {
- {"1"},
- {"1"},
- {"1"},
- {"1"},
- {"1"},
- {"1"},
- };
- String[][] expected2 = new String[][] {
- {"2"},
- {"2"},
- {"2"},
- {"2"},
- {"2"},
- {"2"},
- };
-
- String[][] expected3 = new String[][] {
- {"Hi friends","Hi friends","Hi friends", "Hi friends"}
- };
-
- String[][] expected4 = new String[][] {
- {"99999.999","99999.999","99999.999", "99999.999"}
- };
+ String[][] expected1 = new String[][] { { "1" }, { "1" }, { "1" },
+ { "1" }, { "1" }, { "1" }, };
+ String[][] expected2 = new String[][] { { "2" }, { "2" }, { "2" },
+ { "2" }, { "2" }, { "2" }, };
+
+ String[][] expected3 = new String[][] { { "Hi friends", "Hi friends",
+ "Hi friends", "Hi friends" } };
+
+ String[][] expected4 = new String[][] { { "99999.999", "99999.999",
+ "99999.999", "99999.999" } };
String[][] expected5 = new String[][] {
- { "99999.999", "-10" },
- { "100000.999", "-9" },
- { "100001.999", "-8" },
- { "100002.999", "-7" },
- { "100003.999", "-6" }
+ { "99999.999", "-10" }, { "100000.999", "-9" }, { "100001.999", "-8" },
+ { "100002.999", "-7" }, { "100003.999", "-6" }
};
- //Create a new text document
- app.dispatch("private:factory/scalc", 3);
+ // Create a new text document
+ app.dispatch("private:factory/scalc");
sleep(3);
-
+
CalcUtil.selectRange("C5");
typeKeys("1<enter>");
CalcUtil.selectRange("C5:C10");
- app.dispatch(".uno:FillDown", 3);
- assertArrayEquals("Fill Down:", expected1, CalcUtil.getCellTexts("C5:C10"));
-
+ app.dispatch(".uno:FillDown");
+ assertArrayEquals("Fill Down:", expected1,
+ CalcUtil.getCellTexts("C5:C10"));
+
CalcUtil.selectRange("D10");
typeKeys("2<enter>");
CalcUtil.selectRange("D5:D10");
- app.dispatch(".uno:FillUp", 3);
- assertArrayEquals("Fill Up:", expected2, CalcUtil.getCellTexts("D5:D10"));
-
+ app.dispatch(".uno:FillUp");
+ assertArrayEquals("Fill Up:", expected2,
+ CalcUtil.getCellTexts("D5:D10"));
+
CalcUtil.selectRange("A1");
typeKeys("Hi friends<enter>");
CalcUtil.selectRange("A1:D1");
- app.dispatch(".uno:FillRight", 3);
- assertArrayEquals("Fill Right:", expected3, CalcUtil.getCellTexts("A1:D1"));
-
+ app.dispatch(".uno:FillRight");
+ assertArrayEquals("Fill Right:", expected3,
+ CalcUtil.getCellTexts("A1:D1"));
+
CalcUtil.selectRange("D2");
typeKeys("99999.999<enter>");
CalcUtil.selectRange("A2:D2");
- app.dispatch(".uno:FillLeft", 3);
- assertArrayEquals("Fill left:", expected4, CalcUtil.getCellTexts("A2:D2"));
+ app.dispatch(".uno:FillLeft");
+ assertArrayEquals("Fill left:", expected4,
+ CalcUtil.getCellTexts("A2:D2"));
CalcUtil.selectRange("E1");
typeKeys("99999.999<tab>-10<enter>");
-
+
CalcUtil.selectRange("E1:F5");
- app.dispatch(".uno:FillSeries", 3);
+ app.dispatch(".uno:FillSeries");
FillSeriesDlg.ok();
sleep(1);
- assertArrayEquals("Fill series..", expected5, CalcUtil.getCellTexts("E1:F5"));
+ assertArrayEquals("Fill series..", expected5,
+ CalcUtil.getCellTexts("E1:F5"));
}
-
+
@Test
public void testSort() {
- String[][] expected1 = new String[][] {
- { "-9999999" },
- { "-1.1" },
- { "-1.1" },
- { "0" },
- { "0" },
- { "0.1" },
- { "10" },
- { "12" },
- { "9999999" },
- { "9999999" },
+ String[][] expected1 = new String[][] { { "-9999999" }, { "-1.1" },
+ { "-1.1" }, { "0" }, { "0" }, { "0.1" }, { "10" }, { "12" },
+ { "9999999" }, { "9999999" },
};
- String[][] expected2 = new String[][] {
- { "TRUE", "Oracle" },
- { "TRUE", "OpenOffice" },
- { "FALSE", "OpenOffice" },
- { "TRUE", "IBM" },
- { "FALSE", "IBM" },
- { "TRUE", "Google" },
- { "FALSE", "facebook " },
- { "TRUE", "Apache" },
- { "TRUE", "!yahoo" },
- { "TRUE", "" },
+ String[][] expected2 = new String[][] { { "TRUE", "Oracle" },
+ { "TRUE", "OpenOffice" }, { "FALSE", "OpenOffice" },
+ { "TRUE", "IBM" }, { "FALSE", "IBM" }, { "TRUE", "Google" },
+ { "FALSE", "facebook " }, { "TRUE", "Apache" },
+ { "TRUE", "!yahoo" }, { "TRUE", "" },
};
@@ -420,14 +400,14 @@ public class BVTFunction {
{ "Saturday" },
};
-
+
String[][] expected4 = new String[][] { { "-$10.00" }, { "$0.00" },
{ "$0.00" }, { "$1.00" }, { "$3.00" }, { "$9.00" },
{ "$123.00" }, { "$200.00" }, { "$400.00" }, { "$10,000.00" },
};
String file = prepareData("sort.ods");
- app.dispatch(".uno:Open", 3);
+ app.dispatch(".uno:Open");
submitOpenDlg(file);
calc.waitForExistence(10, 2);
CalcUtil.selectRange("A1:A10");
@@ -436,7 +416,8 @@ public class BVTFunction {
assertEquals(1, SortPage_By1.getSelIndex());
SortPage.ok();
sleep(1);
- assertArrayEquals("Sorted Data", expected1, CalcUtil.getCellTexts("A1:A10"));
+ assertArrayEquals("Sorted Data", expected1,
+ CalcUtil.getCellTexts("A1:A10"));
CalcUtil.selectRange("B1:C10");
app.dispatch(".uno:DataSort");
@@ -457,230 +438,229 @@ public class BVTFunction {
SortPage_By2.select(1);
SortPage.ok();
sleep(1);
-
- assertArrayEquals("Sorted Data", expected2, CalcUtil.getCellTexts("B1:C10"));
+
+ assertArrayEquals("Sorted Data", expected2,
+ CalcUtil.getCellTexts("B1:C10"));
CalcUtil.selectRange("D1:D7");
app.dispatch(".uno:DataSort");
SortWarningDlg_Current.click();
SortOptionsPage.select();
SortOptionsPage_RangeContainsColumnLabels.uncheck();
SortOptionsPage_CustomSortOrder.check();
- SortOptionsPage_CustomSortOrderList.select("Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday");
+ SortOptionsPage_CustomSortOrderList
+ .select("Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday");
SortOptionsPage.ok();
sleep(1);
- assertArrayEquals("Sorted Data", expected3, CalcUtil.getCellTexts("D1:D7"));
-
+ assertArrayEquals("Sorted Data", expected3,
+ CalcUtil.getCellTexts("D1:D7"));
+
CalcUtil.selectRange("E1:E10");
app.dispatch(".uno:DataSort");
SortWarningDlg_Current.click();
SortPage.ok();
sleep(1);
- assertArrayEquals("Sorted Data", expected4, CalcUtil.getCellTexts("E1:E10"));
+ assertArrayEquals("Sorted Data", expected4,
+ CalcUtil.getCellTexts("E1:E10"));
}
-
+
/**
- * Test insert a chart in a draw document
- * 1. New a draw document
- * 2. Insert a chart
- * 3. Check if the chart is inserted successfully
+ * Test insert a chart in a draw document 1. New a draw document 2. Insert a
+ * chart 3. Check if the chart is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertChartInDraw() throws Exception{
-
+ public void testInsertChartInDraw() throws Exception {
+
// Create a new drawing document
- app.dispatch("private:factory/sdraw", 3);
+ app.dispatch("private:factory/sdraw");
sleep(3);
-
+
// Insert a chart
- app.dispatch(".uno:InsertObjectChart", 3);
+ app.dispatch(".uno:InsertObjectChart");
sleep(3);
-
+
// Verify if the chart is inserted successfully
assertTrue(chart.exists(3));
// Focus on edit pane
- draw.click(5,5);
+ draw.click(5, 5);
sleep(1);
}
-
+
/**
- * Test insert a chart in a text document
- * 1. New a text document
- * 2. Insert a chart
- * 3. Check if the chart is inserted successfully
+ * Test insert a chart in a text document 1. New a text document 2. Insert a
+ * chart 3. Check if the chart is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertChartInDocument() throws Exception{
-
+ public void testInsertChartInDocument() throws Exception {
+
// Create a new text document
- app.dispatch("private:factory/swriter", 3);
+ app.dispatch("private:factory/swriter");
sleep(3);
-
+
// Insert a chart
- app.dispatch(".uno:InsertObjectChart", 3);
+ app.dispatch(".uno:InsertObjectChart");
sleep(3);
-
+
// Verify if the chart is inserted successfully
assertTrue(chart.exists(3));
// Focus on edit pane
- writer.click(5,5);
+ writer.click(5, 5);
sleep(1);
}
-
+
/**
- * Test insert a chart in a spreadsheet document
- * 1. New a spreadsheet document
- * 2. Insert a chart
- * 3. Check if the chart is inserted successfully
+ * Test insert a chart in a spreadsheet document 1. New a spreadsheet
+ * document 2. Insert a chart 3. Check if the chart is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertChartInSpreadsheet() throws Exception{
-
+ public void testInsertChartInSpreadsheet() throws Exception {
+
// Create a new spreadsheet document
- app.dispatch("private:factory/scalc", 3);
+ app.dispatch("private:factory/scalc");
sleep(3);
-
+
// Insert a chart
- app.dispatch(".uno:InsertObjectChart", 3);
+ app.dispatch(".uno:InsertObjectChart");
sleep(3);
Chart_Wizard.ok();
-
+
// Verify if the chart is inserted successfully
assertTrue(chart.exists(3));
// Focus on edit pane
- calc.click(5,5);
- sleep(1);
+ calc.click(5, 5);
+ sleep(1);
}
-
+
/**
- * Test insert a chart in a presentation document
- * 1. New a presentation document
- * 2. Insert a chart
- * 3. Check if the chart is inserted successfully
+ * Test insert a chart in a presentation document 1. New a presentation
+ * document 2. Insert a chart 3. Check if the chart is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertChartInPresentation() throws Exception{
-
+ public void testInsertChartInPresentation() throws Exception {
+
// Create a new presentation document
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
sleep(3);
-
+
// Insert a chart
- app.dispatch(".uno:InsertObjectChart", 3);
+ app.dispatch(".uno:InsertObjectChart");
sleep(3);
-
+
// Verify if the chart is inserted successfully
assertTrue(chart.exists(3));
// Focus on edit pane
- impress.click(5,5);
- sleep(1);
+ impress.click(5, 5);
+ sleep(1);
}
-
+
/**
- * Test insert a table in a draw document
- * 1. New a draw document
- * 2. Insert a default table
- * 3. Check if the table is inserted successfully
+ * Test insert a table in a draw document 1. New a draw document 2. Insert a
+ * default table 3. Check if the table is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertTableInDraw() throws Exception{
-
+ public void testInsertTableInDraw() throws Exception {
+
// Create a new drawing document
- app.dispatch("private:factory/sdraw", 3);
+ app.dispatch("private:factory/sdraw");
sleep(3);
-
+
// Insert a table
- app.dispatch(".uno:InsertTable", 3);
+ app.dispatch(".uno:InsertTable");
InsertTable.ok();
sleep(3);
-
+
// Verify if the table toolbar is active
assertTrue(Table_Toolbar.exists(3));
-
+
// Focus on edit pane
- draw.click(5,5);
+ draw.click(5, 5);
sleep(1);
}
-
+
/**
- * Test insert a table in a text document
- * 1. New a text document
- * 2. Insert a default table
- * 3. Check if the table is inserted successfully
+ * Test insert a table in a text document 1. New a text document 2. Insert a
+ * default table 3. Check if the table is inserted successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertTableInDocument() throws Exception{
-
+ public void testInsertTableInDocument() throws Exception {
+
// Create a new text document
- app.dispatch("private:factory/swriter", 3);
+ app.dispatch("private:factory/swriter");
sleep(3);
-
+
// Insert a table
- app.dispatch(".uno:InsertTable", 3);
+ app.dispatch(".uno:InsertTable");
writer_InsertTable.ok();
sleep(3);
-
+
// Verify if the table toolbar is active
assertTrue(Table_Toolbar.exists(3));
-
-// // Check the statusbar to verify if the table is inserted successfully
-// assertEquals("Table1:A1", StatusBar.getItemText(7));
+
+ // // Check the statusbar to verify if the table is inserted
+ // successfully
+ // assertEquals("Table1:A1", StatusBar.getItemText(7));
// Focus on edit pane
- writer.click(5,5);
+ writer.click(5, 5);
sleep(1);
}
-
+
/**
- * Test insert a table in a presentation document
- * 1. New a presentation document
- * 2. Insert a default table
- * 3. Check if the table is inserted successfully
+ * Test insert a table in a presentation document 1. New a presentation
+ * document 2. Insert a default table 3. Check if the table is inserted
+ * successfully
+ *
* @throws Exception
*/
@Test
- public void testInsertTableInPresentation() throws Exception{
-
+ public void testInsertTableInPresentation() throws Exception {
+
// Create a new presentation document
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
sleep(3);
-
+
// Insert a table
- app.dispatch(".uno:InsertTable", 3);
+ app.dispatch(".uno:InsertTable");
InsertTable.ok();
sleep(3);
-
+
// Verify if the table toolbar is active
assertTrue(Table_Toolbar.exists(3));
-
-// // Check the statusbar to verify if the table is inserted successfully
-// assertEquals("Table selected", StatusBar.getItemText(0));
+
+ // // Check the statusbar to verify if the table is inserted
+ // successfully
+ // assertEquals("Table selected", StatusBar.getItemText(0));
// Focus on edit pane
- impress.click(5,5);
+ impress.click(5, 5);
sleep(1);
}
-
/**
- * Test insert a function in a spreadsheet document via Sum button
- * 1. New a spreadsheet document
- * 2. Insert a function via Sum button
- * 3. Check if the result is correct
+ * Test insert a function in a spreadsheet document via Sum button 1. New a
+ * spreadsheet document 2. Insert a function via Sum button 3. Check if the
+ * result is correct
+ *
* @throws Exception
*/
@Test
- public void testInsertFunctionInSCViaSumButton() throws Exception{
-
+ public void testInsertFunctionInSCViaSumButton() throws Exception {
+
// Create a new spreadsheet document
- app.dispatch("private:factory/scalc", 3);
+ app.dispatch("private:factory/scalc");
sleep(3);
-
+
// Insert source numbers
String sourceNumber1 = "5";
String sourceNumber2 = "3";
@@ -688,79 +668,81 @@ public class BVTFunction {
CalcUtil.selectRange("A1");
typeKeys(sourceNumber1);
CalcUtil.selectRange("B1");
- typeKeys(sourceNumber2);
-
+ typeKeys(sourceNumber2);
+
// Insert a function via Sum button
CalcUtil.selectRange("C1");
SC_InputBar_Sum.click();
typeKeys("<enter>");
-
+
// Verify if the calculated result is equal to the expected result
- assertEquals("The calculated result", expectedResult, CalcUtil.getCellText("C1"));
+ assertEquals("The calculated result", expectedResult,
+ CalcUtil.getCellText("C1"));
}
-
+
/**
- * Test insert a function in a spreadsheet document via inputbar
- * 1. New a spreadsheet document
- * 2. Insert a function via inputbar: POWER
- * 3. Check if the result is correct
+ * Test insert a function in a spreadsheet document via inputbar 1. New a
+ * spreadsheet document 2. Insert a function via inputbar: COS 3. Check if
+ * the result is correct
+ *
* @throws Exception
*/
@Test
- public void testInsertFunctionInSCViaInputbar() throws Exception{
-
+ public void testInsertFunctionInSCViaInputbar() throws Exception {
+
// Create a new spreadsheet document
- app.dispatch("private:factory/scalc", 3);
+ app.dispatch("private:factory/scalc");
sleep(3);
-
+
// Insert source numbers and expected result
- String sourceBase = "5";
- String sourcePower = "3";
- String expectedResult = "125";
+ String sourceData = "0";
+ String expectedResult = "1";
CalcUtil.selectRange("A1");
- typeKeys(sourceBase);
- CalcUtil.selectRange("B1");
- typeKeys(sourcePower);
-
- // Insert a function via inputbar: POWER
+ typeKeys(sourceData);
+
+ // Insert a function via inputbar: COS
CalcUtil.selectRange("D1");
- SC_InputBar_Input.inputKeys("=POWER(A1;B1)");
+ SC_InputBar_Input.inputKeys("=COS(A1)");
typeKeys("<enter>");
-
+
// Verify if the calculated result is equal to the expected result
- assertEquals("The calculated result", expectedResult, CalcUtil.getCellText("D1"));
+ assertEquals("The calculated result", expectedResult,
+ CalcUtil.getCellText("D1"));
}
-
+
/**
- * Test insert a function in a spreadsheet document via Function Wizard Dialog
- * 1. New a spreadsheet document
- * 2. Insert a function via Function Wizard Dialog: ABS
- * 3. Check if the result is correct
+ * Test insert a function in a spreadsheet document via Function Wizard
+ * Dialog 1. New a spreadsheet document 2. Insert a function via Function
+ * Wizard Dialog: ABS 3. Check if the result is correct
+ *
* @throws Exception
*/
@Test
- public void testInsertFunctionInSCViaFunctionWizard() throws Exception{
-
+ public void testInsertFunctionInSCViaFunctionWizard() throws Exception {
+
// Create a new spreadsheet document
- app.dispatch("private:factory/scalc", 3);
+ app.dispatch("private:factory/scalc");
sleep(3);
-
+
// Insert source number
String sourceNumber = "-5";
String expectedResult = "5";
CalcUtil.selectRange("A1");
typeKeys(sourceNumber);
typeKeys("<enter>");
-
+
// Insert a function via Function Wizard Dialog: ABS
CalcUtil.selectRange("B1");
- app.dispatch(".uno:FunctionDialog", 3);
- SC_FunctionWizardDlg_FunctionList.doubleClick(5,5);
+ app.dispatch(".uno:FunctionDialog");
+// SC_FunctionWizardDlg_FunctionList.doubleClick(5, 5);
+ SC_FunctionWizardDlg_FunctionList.select("ABS");
+ SC_FunctionWizardDlg_Next.click(); // Use "Next" button
SC_FunctionWizardDlg_Edit1.inputKeys("A1");
SC_FunctionWizardDlg.ok();
-
+
// Verify if the calculated result is equal to the expected result
- assertEquals("The calculated result", expectedResult, CalcUtil.getCellText("B1"));
+ assertEquals("The calculated result", expectedResult,
+ CalcUtil.getCellText("B1"));
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/AddDeleteSymbolsFromCatalog.java Thu Aug 2 00:41:01 2012
@@ -50,6 +50,7 @@ public class AddDeleteSymbolsFromCatalog
// New a formula document
app.dispatch("private:factory/smath");
+ sleep(3); // If no sleep, can not find math_SymbolsDlg in mac
// Click catalog button
math_CatalogButton.click();
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/formula/catalog/InputCharacterFromCatalogDlg.java Thu Aug 2 00:41:01 2012
@@ -50,6 +50,7 @@ public class InputCharacterFromCatalogDl
// New a formula document
app.dispatch("private:factory/smath");
+ sleep(3); // If no sleep, can not find math_SymbolsDlg in mac
// Click catalog button
math_CatalogButton.click();
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/sort/SortDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/sort/SortDialogSetting.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/sort/SortDialogSetting.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/sort/SortDialogSetting.java Thu Aug 2 00:41:01 2012
@@ -500,16 +500,17 @@ public class SortDialogSetting {
// Select the cell range, "Tools->Options...->OpenOffice.org Spreadsheets->Sort Lists"
CalcUtil.selectRange("A1:A6");
app.dispatch(".uno:OptionsTreeDialog");
- // Select "Sort Lists": start. Shrink the tree list and select
- OptionsDlgList.select(0);
- typeKeys("<left>");
- for (int i=0; i<6; i++) {
- typeKeys("<down><left>");
- }
- OptionsDlgList.select(3);
- typeKeys("<right>");
+ OptionsDlgList.collapseAll();
+// // Select "Sort Lists": start. Shrink the tree list and select
+// OptionsDlgList.select(0);
+// typeKeys("<left>");
+// for (int i=0; i<6; i++) {
+// typeKeys("<down><left>");
+// }
+ OptionsDlgList.expand(3);
+// typeKeys("<right>");
OptionsDlgList.select(7);
- // Select "Sort Lists": end
+// // Select "Sort Lists": end
// Click "Copy" button, "OK", close the document
OptionsDlg_SortListsTabCopy.click();
@@ -821,8 +822,6 @@ public class SortDialogSetting {
@Test
public void testSortOptionsIncludeFormats() throws Exception{
- // Create a new spreadsheet document
-
String[][] dataWithCurrencyFormats = new String[][] {
{"Units"},
{"$32.00"},
@@ -851,7 +850,7 @@ public class SortDialogSetting {
{"74.00 \u0440\u0443\u0431"},
};
- // Input source data
+ // Open sample file to get source data
String file = prepareData("sc/SortOptionsIncludeFormats.ods");
app.dispatch(".uno:Open", 3);
submitOpenDlg(file);
@@ -859,48 +858,6 @@ public class SortDialogSetting {
assertArrayEquals("source", dataWithCurrencyFormats, CalcUtil.getCellTexts("A1:A7"));
- // CalcUtil.selectRange("A1");
- // typeKeys("Units<down>$32.00<down>57.00 \u20ac<down>\u20a4 74<down>R$ 50.00<down>\u062c.\u0645. 27.00<down>7.00 \u0440\u0443\u0431.");
-
- // // Set Currency formats
- // CalcUtil.selectRange("A2");
- // typeKeys("<ctrl 1>");
- //// calc.menuItem("Fortmat->Cells...").select(); error: can not find item "Format"
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("$ English (USA)");
- // FormatCellsDlg_NumbersPage.ok();
- // CalcUtil.selectRange("A3");
- // typeKeys("<ctrl 1>");
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("\u20ac Spanish (Spain)");
- // FormatCellsDlg_NumbersPage.ok();
- // CalcUtil.selectRange("A4");
- // typeKeys("<ctrl 1>");
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("\u20a4 Latin");
- // FormatCellsDlg_NumbersPage.ok();
- // CalcUtil.selectRange("A5");
- // typeKeys("<ctrl 1>");
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("R$ Portuguese (Brazil)");
- // FormatCellsDlg_NumbersPage.ok();
- // CalcUtil.selectRange("A6");
- // typeKeys("<ctrl 1>");
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("\u062c.\u0645. Arabic (Egypt)");
- // FormatCellsDlg_NumbersPage.ok();
- // CalcUtil.selectRange("A7");
- // typeKeys("<ctrl 1>");
- // FormatCellsDlg_NumbersPage.select();
- // FormatCellsDlg_NumbersPageCategory.select("Currency");
- // FormatCellsDlg_NumbersPageCurrencyFormat.select("\u0440\u0443\u0431. Russian");
- // FormatCellsDlg_NumbersPage.ok();
-
// "Data->Sort...", check "Range contains column labels", check "Include formats", sort first by "Units", "Ascending"
app.dispatch(".uno:DataSort");
SortOptionsPage.select();
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java Thu Aug 2 00:41:01 2012
@@ -64,6 +64,7 @@ public class OpenDocumentWithHeaderFoote
String file = prepareData("sd/AOO3.4HeaderFooter.odp");
app.dispatch(".uno:Open");
submitOpenDlg(file);
+ sleep(2); // If no sleep, error occur on mac
//check after reopen
app.dispatch(".uno:HeaderAndFooter");
Modified: incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java?rev=1368326&r1=1368325&r2=1368326&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java Thu Aug 2 00:41:01 2012
@@ -43,6 +43,7 @@ import org.openoffice.test.vcl.widgets.V
import org.openoffice.test.vcl.widgets.VclTabPage;
import org.openoffice.test.vcl.widgets.VclToolBox;
import org.openoffice.test.vcl.widgets.VclWindow;
+import org.openoffice.test.vcl.widgets.VclTreeListBox;
/**
* Define all UI controls in the class.
@@ -58,7 +59,6 @@ public class UIMap {
public static VclEditBox editbox(String id) {
return new VclEditBox(idList.getId(id));
}
-
public static VclControl control(String id) {
return new VclControl(idList.getId(id));
@@ -88,17 +88,14 @@ public class UIMap {
return new VclToolBox(idList.getId(id));
}
-
public static VclButton button(String id) {
return new VclButton(idList.getId(id));
}
-
public static VclMessageBox msgbox(String text) {
return new VclMessageBox(idList.getId("UID_ACTIVE"), text);
}
-
public static VclMenuItem menuItem(String text) {
return new VclMenuItem(text);
}
@@ -114,6 +111,11 @@ public class UIMap {
public static VclDockingWin dockingwin(String id){
return new VclDockingWin(idList.getId(id));
}
+
+ public static VclTreeListBox tree(String id) {
+ return new VclTreeListBox(idList.getId(id));
+ }
+
public static final OpenOffice oo = new OpenOffice(null);
public static final VclApp app = VclApp.getDefault();
public static final VclWindow writer = window("SW_HID_EDIT_WIN");
@@ -211,7 +213,8 @@ public class UIMap {
public static final VclButton math_ElementsUnaryBinary = button("STARMATH_HID_SMA_UNBINOPS_CAT");
public static final VclButton math_ElementsUnaryBinaryPlus = button("STARMATH_HID_SMA_PLUSX");
public static final VclControl MacroWarningOK = control("Ok");
- public static final VclListBox OptionsDlgList = listbox("CUI_HID_OFADLG_TREELISTBOX");
+ public static final VclTreeListBox OptionsDlgList = tree("CUI_HID_OFADLG_TREELISTBOX");
+// public static final VclListBox OptionsDlgList = listbox("CUI_HID_OFADLG_TREELISTBOX");
public static final VclDialog OptionsDlg = dialog("CUI_HID_OFADLG_OPTIONS_TREE");
public static final VclButton OptionsDlg_MacroSecurityButton = button("cui:PushButton:RID_SVXPAGE_INET_SECURITY:PB_SEC_MACROSEC");
public static final VclControl MacroSecurityDlg = control("XMLSECURITY_HID_XMLSEC_TP_SECLEVEL");
@@ -350,7 +353,9 @@ public class UIMap {
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");
-
+ public static final VclButton SC_FunctionWizardDlg_Next = button("formula:PushButton:RID_FORMULADLG_FORMULA:BTN_FORWARD");
+ public static final VclTreeListBox OptionsDlg_PathTabTree = tree("CUI_HID_OPTPATH_CTL_PATH");
+ public static final VclTreeListBox OptionsDlg_MicorOfficeTree = tree("CUI_HID_OFAPAGE_MSFLTR2_CLB");
}