Kaydet (Commit) 8f2fdaee authored tarafından Liu Zhe's avatar Liu Zhe

#120323# - Automated Test: Make test code under testcase.sc/sw/sd.* language-neutral

Patch by Li Lin Yi
Review by Liu Zhe
üst 0deed3a5
......@@ -99,7 +99,7 @@ public class BVTFileType {
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 @@ public class BVTFileType {
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 @@ public class BVTFileType {
// 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 @@ public class BVTFileType {
// 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 @@ public class BVTFileType {
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("<tab><enter>");
app.dispatch(".uno:SelectAll", 3);
app.dispatch(".uno:SelectAll");
// app.setClipboard(".wrong");
typeKeys("<$copy>");
sleep(1);
......@@ -319,11 +319,11 @@ public class BVTFileType {
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 @@ public class BVTFileType {
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 @@ public class BVTFileType {
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 @@ public class BVTFileType {
// 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 @@ public class BVTFileType {
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");
}
}
......@@ -49,20 +49,17 @@ public class AddDeleteSymbolsFromCatalog {
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 @@ public class AddDeleteSymbolsFromCatalog {
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 @@ public class AddDeleteSymbolsFromCatalog {
} 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 @@ public class AddDeleteSymbolsFromCatalog {
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 @@ public class AddDeleteSymbolsFromCatalog {
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 @@ public class AddDeleteSymbolsFromCatalog {
String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
math_EditSymbolsDlgDelete.click();
math_EditSymbolsDlg.ok();
sleep(1);
// Verify if the selected symbol is deleted successfully
math_SymbolsDlgEditButton.click();
......
......@@ -49,12 +49,10 @@ public class InputCharacterFromCatalogDlg {
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 class InputCharacterFromCatalogDlg {
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 class InputCharacterFromCatalogDlg {
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 @@ public class InputCharacterFromCatalogDlg {
// 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 class InputCharacterFromCatalogDlg {
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
......
......@@ -29,13 +29,13 @@ package testcase.gui.formula.importexport;
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 @@ public class CreateFormulaInDifferentWays {
@Before
public void setUp() throws Exception {
app.start();
// New a formula document
app.dispatch("private:factory/smath");
}
@After
......@@ -63,23 +66,13 @@ public class CreateFormulaInDifferentWays {
@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();
// 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());
boolean viewElements = math_ElementsWindow.exists();
// Active or inactive the Elements window
app.dispatch(".uno:ToolBox");
assertNotSame("Elements window active/inactive failed", viewElements, math_ElementsWindow.exists());
}
/**
......@@ -88,51 +81,41 @@ public class CreateFormulaInDifferentWays {
*/
@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,11 +128,7 @@ public class CreateFormulaInDifferentWays {
*/
@Test
public void testCreateFormulaFromRightClickMenu() throws Exception{
String saveTo = Testspace.getPath("temp/FormulaFromRightClickMenu.odf");
// New a formula document
startcenter.menuItem("File->New->Formula").select();
sleep(3);
String saveTo = getPath("temp/" + "FormulaFromRightClickMenu.odf");
// Right click in equation editor, choose "Functions->More->arcsin(x)", input a
math_EditWindow.rightClick(5, 5);
......@@ -158,37 +137,34 @@ public class CreateFormulaInDifferentWays {
typeKeys("<down>");
typeKeys("<down>");
typeKeys("<enter>");
sleep(0.5);
typeKeys("<up>");
typeKeys("<enter>");
sleep(0.5);
typeKeys("<enter>");
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 @@ public class CreateFormulaInDifferentWays {
* 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 " "
}
......
......@@ -49,7 +49,8 @@ public class ChartDialogSetting {
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 @@ public class ChartDialogSetting {
*/
@Test
public void testChartDialogCancelBack() {
calc.menuItem("Insert->Chart...").select();
WizardNextButton.click();
assertTrue(ChartRangeChooseTabPage.isEnabled());
WizardBackButton.click();
......@@ -72,14 +72,4 @@ public class ChartDialogSetting {
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();
}
}
......@@ -52,7 +52,7 @@ public class Fitler {
app.start();
// Create a new spreadsheet document
startcenter.menuItem("File->New->Spreadsheet").select();
app.dispatch("private:factory/scalc");
}
@After
......@@ -62,7 +62,7 @@ public class Fitler {
/**
*
* Verify Chart Wizard dialog title words
* Verify 2+ won't be treated as 2
*/
@Ignore("Bug 120076")
public void testAutoFilterWithPlusSign() {
......
......@@ -60,14 +60,20 @@ public class InsertSheet {
@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 @@ public class InsertSheet {
@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();
}
}
......@@ -51,11 +51,11 @@ public class SubtotalsFunctions {
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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
}
/**
*
* Just support en-US language
* Verify SubTotals Options default UI
*/
@Test
......@@ -240,20 +240,20 @@ public class SubtotalsFunctions {
}
/**
*
* 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 @@ public class SubtotalsFunctions {
/**
*
* Just support en-US language
* Verify Subtotals_Recalculate and refresh results when data rows deleted.
*/
@Test
......@@ -285,7 +285,7 @@ public class SubtotalsFunctions {
{ "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 @@ public class SubtotalsFunctions {
}
/**
*
* 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);
......
......@@ -65,13 +65,13 @@ public class ValidityDateSupport1024Columns {
*/
@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 @@ public class ValidityDateSupport1024Columns {
SC_ValidityErrorMessage.setText("Invalid value");
SC_ValidityErrorAlertTabPage.ok();
CalcUtil.selectRange("Sheet1.ALM1001");
CalcUtil.selectRange("ALM1001");
SC_InputBar_Input.activate();
typeKeys("02/01/08<enter>");
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<enter>");
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<enter>");
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<enter>");
assertEquals("Invalid value",ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
assertEquals("",CalcUtil.getCellText("Sheet1.AML1003"));
assertEquals("",CalcUtil.getCellText("AML1003"));
}
}
......@@ -44,8 +44,8 @@ public class ValidityDialogDefaultValue {
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 class ValidityDialogDefaultValue {
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 @@ public class ValidityDialogDefaultValue {
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());
}
......
......@@ -90,7 +90,6 @@ public class ValiditySampleFile {
SC_InputBar_Input.activate();
typeKeys("<backspace><enter>");
assertEquals("Invalid value.",ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
assertEquals("8",CalcUtil.getCellText("F5"));
}
......@@ -106,9 +105,9 @@ public class ValiditySampleFile {
submitOpenDlg(file);
calc.waitForExistence(10, 2);
CalcUtil.selectRange("Sheet1.F19");
CalcUtil.selectRange("F19");
typeKeys("d<enter>");
CalcUtil.selectRange("Sheet1.F17");
CalcUtil.selectRange("F17");
typeKeys("Test<enter>");
assertEquals("Test",CalcUtil.getCellText("F17"));
......
......@@ -66,8 +66,7 @@ public class OpenDocumentWithHeaderFooter {
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 @@ public class OpenDocumentWithHeaderFooter {
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 @@ public class OpenDocumentWithHeaderFooter {
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 @@ public class OpenDocumentWithHeaderFooter {
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 @@ public class OpenDocumentWithHeaderFooter {
//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
}
......
......@@ -63,27 +63,25 @@ public class Table {
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("1<right>2<right>3<right>4");
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("<enter>");
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());
}
......
......@@ -348,6 +348,8 @@ public class UIMap {
// 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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment