diff options
author | Liu Zhe <liuzhe@apache.org> | 2012-07-18 01:28:42 +0000 |
---|---|---|
committer | Liu Zhe <liuzhe@apache.org> | 2012-07-18 01:28:42 +0000 |
commit | c1127ec119079e3a87852c205766d5c39f995995 (patch) | |
tree | 579802a1ba50a6207ec5a2b50d53aef296e9d442 /test | |
parent | 2d3010e7f399b206bc089bc6fe91f99286bd5260 (diff) |
#120295# - VCLAuto patch: refactor function verification test. Test cases about text document and presentation.
Patch by: Li Lin Yi
Review by: Liu Zhe
Notes
Notes:
ignore: vclauto
Diffstat (limited to 'test')
26 files changed, 1039 insertions, 2473 deletions
diff --git a/test/testoo/src/testcase/BVTFunction.java b/test/testoo/src/testcase/BVTFunction.java index 4669ddfc3567..b92250adb22a 100644 --- a/test/testoo/src/testcase/BVTFunction.java +++ b/test/testoo/src/testcase/BVTFunction.java @@ -145,7 +145,6 @@ public class BVTFunction { @Test public void testAboutDialog() { - app.dispatch(".uno:About"); assertTrue(AboutDialog.exists(5)); AboutDialog.ok(); diff --git a/test/testoo/src/testcase/formula/catalog/AddCustomSymbolsFromCatalog.java b/test/testoo/src/testcase/formula/catalog/AddDeleteSymbolsFromCatalog.java index bbdd336b5a92..c113d9843b5c 100644 --- a/test/testoo/src/testcase/formula/catalog/AddCustomSymbolsFromCatalog.java +++ b/test/testoo/src/testcase/formula/catalog/AddDeleteSymbolsFromCatalog.java @@ -28,55 +28,24 @@ package testcase.formula.catalog; import static testlib.AppUtil.*; import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - +import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; import testlib.Log; /** * */ -public class AddCustomSymbolsFromCatalog { +public class AddDeleteSymbolsFromCatalog { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ @Rule public Log LOG = new Log(); - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ @Before public void setUp() throws Exception { - initApp(); - } - - /** - * Test add custom symbols from Catalog->Symbols - * @throws Exception - */ - @Ignore("Add button in Edit Symbols dialog is disabled") - public void testAddSymbolFromCatalog() throws Exception{ + app.start(); // New a formula document startcenter.menuItem("File->New->Formula").select(); @@ -96,6 +65,19 @@ public class AddCustomSymbolsFromCatalog { // Verify if the "Edit Symbols" dialog pop up assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); + } + + @After + public void tearDown() throws Exception { + app.close(); + } + + /** + * Test add custom symbols from Catalog->Symbols + * @throws Exception + */ + @Test + public void testAddSymbolFromCatalog() throws Exception{ // Choose a symbol which is not in the list, click "Add" and "OK" String selectedSymbol; @@ -132,6 +114,11 @@ public class AddCustomSymbolsFromCatalog { } } assertTrue("Symbol is not added to Symbol set", bSelectSymbolNotInList); + + // Close all dialogs + math_EditSymbolsDlg.cancel(); + math_SymbolsDlg.close(); + app.dispatch(".uno:CloseDoc"); } /** @@ -141,25 +128,6 @@ public class AddCustomSymbolsFromCatalog { @Test public void testModifySymbolFontFromCatalog() throws Exception{ - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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_SymbolsDlgEditButton.click(); - sleep(1); - - // Verify if the "Edit Symbols" dialog pop up - assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); - // Modify the font of selected symbol //String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); int oldSymbolFontIndex = math_EditSymbolsDlgFont.getSelIndex(); @@ -175,6 +143,11 @@ public class AddCustomSymbolsFromCatalog { math_SymbolsDlgEditButton.click(); math_EditSymbolsDlgSymbol.select(selectedSymbol); assertEquals("Font of symbol is not modified successfully", modifiedSymbolFont, math_EditSymbolsDlgFont.getSelText()); + + // Close all dialogs + math_EditSymbolsDlg.cancel(); + math_SymbolsDlg.close(); + app.dispatch(".uno:CloseDoc"); } /** @@ -184,31 +157,13 @@ public class AddCustomSymbolsFromCatalog { @Test public void testModifySymbolTypefaceFromCatalog() throws Exception{ - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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_SymbolsDlgEditButton.click(); - sleep(1); - - // Verify if the "Edit Symbols" dialog pop up - assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); - // Modify the typeface of selected symbol - String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); +// String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); int oldSymbolTypefaceIndex = math_EditSymbolsDlgTypeface.getSelIndex(); int modifiedSymbolTypefaceIndex = (oldSymbolTypefaceIndex+1==math_EditSymbolsDlgTypeface.getItemCount()) ? 0 : (oldSymbolTypefaceIndex+1); math_EditSymbolsDlgTypeface.select(modifiedSymbolTypefaceIndex); // select the next typeface of old typeface String modifiedSymbolTypeface= math_EditSymbolsDlgTypeface.getSelText(); + String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); math_EditSymbolsDlgModify.click(); math_EditSymbolsDlg.ok(); sleep(1); @@ -217,5 +172,40 @@ public class AddCustomSymbolsFromCatalog { math_SymbolsDlgEditButton.click(); math_EditSymbolsDlgSymbol.select(selectedSymbol); assertEquals("Typeface of symbol is not modified successfully", modifiedSymbolTypeface, math_EditSymbolsDlgTypeface.getSelText()); + + // Close all dialogs + math_EditSymbolsDlg.cancel(); + math_SymbolsDlg.close(); + app.dispatch(".uno:CloseDoc"); + } + + /** + * Test delete custom symbols from Catalog->Symbols + * @throws Exception + */ + @Test + public void testDeleteSymbolFromCatalog() throws Exception{ + + // Delete the selected symbol + String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); + math_EditSymbolsDlgDelete.click(); + math_EditSymbolsDlg.ok(); + sleep(1); + + // Verify if the selected symbol is deleted successfully + math_SymbolsDlgEditButton.click(); + boolean isDeleted = true; + for (int i=0; i<math_EditSymbolsDlgSymbol.getItemCount(); i++) { + if (selectedSymbol.equals(math_EditSymbolsDlgSymbol.getItemText(i))){ + isDeleted = false; + break; + } + } + assertTrue("Symbol is not deleted successfully", isDeleted); + + // Close all dialogs + math_EditSymbolsDlg.cancel(); + math_SymbolsDlg.close(); + app.dispatch(".uno:CloseDoc"); } } diff --git a/test/testoo/src/testcase/formula/catalog/DeleteSymbolFromCatalog.java b/test/testoo/src/testcase/formula/catalog/DeleteSymbolFromCatalog.java deleted file mode 100644 index 88c8eb2aad7f..000000000000 --- a/test/testoo/src/testcase/formula/catalog/DeleteSymbolFromCatalog.java +++ /dev/null @@ -1,117 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -/** - * - */ -package testcase.formula.catalog; - -import static testlib.AppUtil.*; -import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; -import testlib.Log; - -/** - * - */ -public class DeleteSymbolFromCatalog { - - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test delete custom symbols from Catalog->Symbols - * @throws Exception - */ - @Test - public void testDeleteSymbolFromCatalog() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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_SymbolsDlgEditButton.click(); - sleep(1); - - // Verify if the "Edit Symbols" dialog pop up - assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3)); - - // Delete the selected symbol - String selectedSymbol = math_EditSymbolsDlgSymbol.getText(); - math_EditSymbolsDlgDelete.click(); - math_EditSymbolsDlg.ok(); - sleep(1); - - // Verify if the selected symbol is deleted successfully - math_SymbolsDlgEditButton.click(); - boolean isDeleted = true; - for (int i=0; i<math_EditSymbolsDlgSymbol.getItemCount(); i++) { - if (selectedSymbol.equals(math_EditSymbolsDlgSymbol.getItemText(i))){ - isDeleted = false; - break; - } - } - assertTrue("Symbol is not deleted successfully", isDeleted); - } -} diff --git a/test/testoo/src/testcase/formula/catalog/InputCharacterFromCatalogDlg.java b/test/testoo/src/testcase/formula/catalog/InputCharacterFromCatalogDlg.java new file mode 100644 index 000000000000..604fdc6e121b --- /dev/null +++ b/test/testoo/src/testcase/formula/catalog/InputCharacterFromCatalogDlg.java @@ -0,0 +1,155 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + + +/** + * + */ +package testcase.formula.catalog; + +import static testlib.AppUtil.*; +import static testlib.UIMap.*; +import static org.junit.Assert.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import testlib.Log; + +/** + * + */ +public class InputCharacterFromCatalogDlg { + + @Rule + public Log LOG = new Log(); + + @Before + public void setUp() throws Exception { + app.start(); + + // New a formula document + startcenter.menuItem("File->New->Formula").select(); + sleep(3); + + // 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)); + } + + @After + public void tearDown() throws Exception { + app.close(); + } + + /** + * Test input Greek character from Catalog->Symbols + * @throws Exception + */ + @Test + public void testInputGreekFromCatalog() throws Exception{ + + // Select "Greek", click "Edit" button to get the selected Symbol + math_SymbolsDlgListbox.select("Greek"); + 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); + assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end + + // Close all dialogs + app.dispatch(".uno:CloseDoc"); + } + + /** + * Test input iGreek character from Catalog->Symbols + * @throws Exception + */ + @Test + public void testInputIGreekFromCatalog() throws Exception{ + + // Select "iGreek", click "Edit" button to get the selected Symbol + math_SymbolsDlgListbox.select("iGreek"); + 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.click(5, 5); + math_EditWindow.menuItem("Edit->Select All").select(); + math_EditWindow.menuItem("Edit->Copy").select(); + sleep(1); + assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end + + // Close all dialogs + app.dispatch(".uno:CloseDoc"); + } + + /** + * Test input Special character from Catalog->Symbols + * @throws Exception + */ + @Test + public void testInputSpecialFromCatalog() throws Exception{ + + // Select "Special", "Insert" the default first symbol + math_SymbolsDlgListbox.select("Special"); + 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); + assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard()); // add "%" in the front, add " " in the end + + // Close all dialogs + app.dispatch(".uno:CloseDoc"); + } +} diff --git a/test/testoo/src/testcase/formula/catalog/InputGreekCharacterFromCatalogDlg.java b/test/testoo/src/testcase/formula/catalog/InputGreekCharacterFromCatalogDlg.java deleted file mode 100644 index 91177151fc47..000000000000 --- a/test/testoo/src/testcase/formula/catalog/InputGreekCharacterFromCatalogDlg.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -/** - * - */ -package testcase.formula.catalog; - -import static testlib.AppUtil.*; -import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; -import testlib.Log; - -/** - * - */ -public class InputGreekCharacterFromCatalogDlg { - - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test input Greek character from Catalog->Symbols - * @throws Exception - */ - @Test - public void testInputGreekFromCatalog() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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 "Greek", click "Edit" button to get the selected Symbol - math_SymbolsDlgListbox.select("Greek"); - 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();//.active(); - math_EditWindow.menuItem("Edit->Select All").select(); - typeKeys("<$copy>"); - sleep(1); - assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol), app.getClipboard()); // add "%" - } -} diff --git a/test/testoo/src/testcase/formula/catalog/InputIGreekCharacterFromCatalogDlg.java b/test/testoo/src/testcase/formula/catalog/InputIGreekCharacterFromCatalogDlg.java deleted file mode 100644 index 188c8fe16894..000000000000 --- a/test/testoo/src/testcase/formula/catalog/InputIGreekCharacterFromCatalogDlg.java +++ /dev/null @@ -1,118 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -/** - * - */ -package testcase.formula.catalog; - -import static testlib.AppUtil.*; -import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; -import testlib.Log; - -/** - * - */ -import static testlib.AppUtil.initApp; - -import org.junit.Before; -import org.junit.Rule; - -import testlib.Log; - -public class InputIGreekCharacterFromCatalogDlg { - - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test input iGreek character from Catalog->Symbols - * @throws Exception - */ - @Ignore("There is no iGreek right now in AOO4.0, but AOO3.4 has it") - public void testInputIGreekFromCatalog() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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 "iGreek", click "Edit" button to get the selected Symbol - math_SymbolsDlgListbox.select("iGreek"); - 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.click(5, 5); - math_EditWindow.menuItem("Edit->Select All").select(); - typeKeys("<$copy>"); - sleep(1); - assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol), app.getClipboard()); // add "%" - } -} diff --git a/test/testoo/src/testcase/formula/catalog/InputSpecialCharacterFromCatalogDlg.java b/test/testoo/src/testcase/formula/catalog/InputSpecialCharacterFromCatalogDlg.java deleted file mode 100644 index ef79e62b6cce..000000000000 --- a/test/testoo/src/testcase/formula/catalog/InputSpecialCharacterFromCatalogDlg.java +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -/** - * - */ -package testcase.formula.catalog; - -import static testlib.AppUtil.*; -import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; -import testlib.Log; - -/** - * - */ -public class InputSpecialCharacterFromCatalogDlg { - - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test input Special character from Catalog->Symbols - * @throws Exception - */ - @Test - public void testInputSpecialFromCatalog() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // 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 to get the selected Symbol - math_SymbolsDlgListbox.select("Special"); - 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.click(5, 5); - math_EditWindow.menuItem("Edit->Select All").select(); - typeKeys("<$copy>"); - sleep(1); - assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol), app.getClipboard()); // add "%" - } -} diff --git a/test/testoo/src/testcase/formula/elements/ElementsWindowActive.java b/test/testoo/src/testcase/formula/elements/ElementsWindowActive.java deleted file mode 100644 index 4911cd97af84..000000000000 --- a/test/testoo/src/testcase/formula/elements/ElementsWindowActive.java +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -/** - * - */ -package testcase.formula.elements; - -import static testlib.AppUtil.*; -import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; - -import testlib.CalcUtil; -import testlib.Log; - -/** - * - */ -public class ElementsWindowActive { - - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test elements window active and inactive - * @throws Exception - */ - @Test - public void testElementsWindowActive() throws Exception{ - - // New a formula document - startcenter.menuItem("File->New->Formula").select(); - sleep(3); - - // Check if the "View->Selection" menu is selected (For AOO3.4: View->Elements) - math_EditWindow.menuItem("View").select(); - boolean viewElements = math_EditWindow.menuItem("View->Selection").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->Selection").select(); - sleep(1); - math_EditWindow.menuItem("View").select(); - viewElements = math_EditWindow.menuItem("View->Selection").isSelected(); - assertEquals("Elements window display correctly", viewElements, math_ElementsWindow.exists()); - } -} diff --git a/test/testoo/src/testcase/presentation/headerandfooter/HeaderAndFooterSetting.java b/test/testoo/src/testcase/presentation/headerandfooter/HeaderAndFooterSetting.java new file mode 100644 index 000000000000..d09a32fb60b6 --- /dev/null +++ b/test/testoo/src/testcase/presentation/headerandfooter/HeaderAndFooterSetting.java @@ -0,0 +1,724 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + + + +/** + * + */ +package testcase.presentation.headerandfooter; + +import static testlib.AppUtil.fullPath; +import static testlib.AppUtil.openStartcenter; +import static testlib.AppUtil.submitOpenDlg; +import static testlib.AppUtil.submitSaveDlg; +import static testlib.UIMap.*; +import static org.junit.Assert.*; +import static org.openoffice.test.vcl.Tester.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.openoffice.test.common.FileUtil; +import testlib.ImpressUtil; +import testlib.Log; + +public class HeaderAndFooterSetting{ + + @Rule + public Log LOG = new Log(); + + @Before + public void setUp() throws Exception { + app.start(); + + // 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(); + } + } + + @After + public void tearDown() throws Exception { + app.close(); + } + + /** + * Test Copy slide with Apply Footer to same file and different file + * @throws Exception + */ + @Test + public void testCopySlideWithApplyFooter() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + + SD_DateAndTimeFooterOnSlide.check(); + SD_FixedDateAndTimeFooterOnSlide.check(); + SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); + SD_FooterTextOnSlide.check(); + SD_FooterTextOnSlideInput.setText("Footer Test"); + SD_SlideNumAsFooterOnSlide.check(); + SD_ApplyToAllButtonOnSlideFooter.click(); + sleep(1); + + ImpressSlideSorter.focus(); + for(int j=0; j<=2;j++){ + typeKeys("<up>"); + } + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_SlideNumAsFooterOnSlide.uncheck(); + SD_ApplyButtonOnSlideFooter.click(); + + //paste to the same file + ImpressSlideSorter.focus(); + app.dispatch(".uno:Copy"); + app.dispatch(".uno:Paste"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); + assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); + + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + + //paste to different file + impress.focus(); + app.dispatch("private:factory/simpress?slot=6686"); + PresentationWizard.ok(); + sleep(1); + app.dispatch(".uno:Paste"); + ImpressSlideSorter.focus(); + typeKeys("<down>"); + sleep(1); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); + assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test Copy slide with Apply to all Footer to same file and different file + * @throws Exception + */ + @Test + public void testCopySlideWithApplyToAllFooter() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + + 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("<up>"); + sleep(1); + } + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_SlideNumAsFooterOnSlide.uncheck(); + SD_ApplyButtonOnSlideFooter.click(); + + //paste to the same file + ImpressSlideSorter.focus(); + typeKeys("<up>"); + app.dispatch(".uno:Copy"); + typeKeys("<down>"); + sleep(1); + app.dispatch(".uno:Paste"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + + //paste to different file + impress.focus(); + impress.menuItem("File->New->Presentation").select(); + sleep(1); + app.dispatch(".uno:Paste"); + ImpressSlideSorter.focus(); + typeKeys("<down>"); + sleep(1); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test Copy slide with Notes Footer to same file and different file + * @throws Exception + */ + @Test + public void testCopySlideWithNotesHeaderFooter() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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("<up>"); + app.dispatch(".uno:Copy"); + typeKeys("<down>"); + sleep(1); + app.dispatch(".uno:Paste"); + + ImpressUtil.getCurView().activate(); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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()); + + //close header and footer dialog. + SD_ApplyToAllButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + + //paste to different file + impress.focus(); + impress.menuItem("File->New->Presentation").select(); + sleep(1); + app.dispatch(".uno:Paste"); + ImpressSlideSorter.focus(); + typeKeys("<down>"); + sleep(1); + ImpressUtil.getCurView().activate(); + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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()); + } + + /** + * Test duplicate slide with Apply to all Footer to same file + * @throws Exception + */ + @Test + public void testDuplicateSlideWithApplyToAllFooter() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + + 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("<up>"); + sleep(1); + } + impress.menuItem("Insert->Duplicate Slide").select(); + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test footer not show on the first slide. + * @throws Exception + */ + @Test + public void testFooterNotShowOn1stSlide() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + SD_FooterTextOnSlide.check(); + sleep(1); + SD_FooterTextOnSlideInput.setText("Footer Test"); + sleep(1); + SD_FooterNotShowOn1stSlide.check(); + SD_ApplyToAllButtonOnSlideFooter.click(); + sleep(1); + + ImpressSlideSorter.focus(); + for(int j=0; j<5; j++){ + typeKeys("<up>"); + } + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked()); + assertEquals(false,SD_FooterTextOnSlide.isChecked()); + } + + /** + * Test Insert Footer to focus slide. + * @throws Exception + */ + @Test + public void testInsertApplyFooterOnSlide() throws Exception{ + + //add header and footer to focus slide. + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + + 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); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + ImpressSlideSorter.focus(); + typeKeys("<up>"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("",SD_FooterTextOnSlideInput.getText()); + assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + SD_InsertPageButtonOnToolbar.click(); + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("",SD_FooterTextOnSlideInput.getText()); + assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test Insert Footer to Notes View + * @throws Exception + */ + @Test + public void testInsertApplyToAllFooterOnNotes() throws Exception{ + + //add header and footer to focus slide. + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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); + SD_HeaderAndFooterOnNotesTabPage.select(); + assertEquals(true,SD_HeaderTextOnNotes.isChecked()); + assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyToAllButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + ImpressSlideSorter.focus(); + typeKeys("<up>"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_HeaderAndFooterOnNotesTabPage.select(); + assertEquals(true,SD_HeaderTextOnNotes.isChecked()); + assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyToAllButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + SD_InsertPageButtonOnToolbar.click(); + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_HeaderAndFooterOnNotesTabPage.select(); + assertEquals(true,SD_HeaderTextOnNotes.isChecked()); + assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test Insert Footer to Slide, use Apply to All + * @throws Exception + */ + @Test + public void testInsertApplyToAllFooterOnSlide() throws Exception{ + + //add header and footer to focus slide. + impress.menuItem("View->Header and Footer...").select(); + sleep(2); + + 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); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + ImpressSlideSorter.focus(); + typeKeys("<up>"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + //end close + + SD_InsertPageButtonOnToolbar.click(); + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); + assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + } + + /** + * Test Insert update automatically time footer to slides. + * @throws Exception + */ + @Test + public void testInsertAutoUpdateTimeFooter() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_AutoUpdateTimeFooter.check(); + SD_AutoUpdateTimeFooterType.select(7); + String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); + SD_ApplyToAllButtonOnSlideFooter.click(); + sleep(2); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + + String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); + assertFalse(currentTime.equals(currentTime2)); + } + + /** + * Test Insert update automatically time footer to Notes view. + * @throws Exception + */ + @Test + public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_HeaderAndFooterOnNotesTabPage.select(); + SD_AutoUpdateTimeFooter.check(); + SD_AutoUpdateTimeFooterType.select(7); + String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); + SD_ApplyToAllButtonOnSlideFooter.click(); + sleep(2); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + SD_HeaderAndFooterOnNotesTabPage.select(); + String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); + + assertFalse(currentTime.equals(currentTime2)); + } + + /** + * Test Insert Header and Footer to Notes view. + * Save and ReOpen + * @throws Exception + */ + @Test + public void testInsertHeaderFooterOnNotes() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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("<up>"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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()); + + //close header and footer dialog. + SD_ApplyToAllButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + + //save this file + impress.menuItem("File->Save").select(); + String saveTo = fullPath("temp/" + "hello.odp"); + FileUtil.deleteFile(saveTo); + submitSaveDlg(saveTo); + impress.menuItem("File->Close").select(); + sleep(2); + + //Reopen this file + openStartcenter(); + app.dispatch(".uno:Open"); + String openFrom=fullPath("temp/" + "hello.odp"); + submitOpenDlg(openFrom); + + //check after reopen + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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()); + } + + /** + * Test Insert Header and Footer to Slide + * Save and Reopen + * @throws Exception + */ + @Test + public void testInsertHeaderFooterOnSlide() throws Exception{ + + //add header and footer + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + 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("<up>"); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + + //close header and footer dialog. + SD_ApplyButtonOnSlideFooter.focus(); + typeKeys("<tab>"); + typeKeys("<enter>"); + + //save this file + impress.menuItem("File->Save").select(); + String saveTo = fullPath("temp/" + "hello.odp"); + FileUtil.deleteFile(saveTo); + submitSaveDlg(saveTo); + impress.menuItem("File->Close").select(); + sleep(2); + + //Reopen this file + openStartcenter(); + app.dispatch(".uno:Open"); + String openFrom=fullPath("temp/" + "hello.odp"); + submitOpenDlg(openFrom); + + //check after reopen + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + } +} diff --git a/test/testoo/src/testcase/sd/headerandfooter/OpenPPTWithHeaderFooter.java b/test/testoo/src/testcase/presentation/headerandfooter/OpenDocumentWithHeaderFooter.java index 378652b4b30d..3bc1b8b77cfb 100644 --- a/test/testoo/src/testcase/sd/headerandfooter/OpenPPTWithHeaderFooter.java +++ b/test/testoo/src/testcase/presentation/headerandfooter/OpenDocumentWithHeaderFooter.java @@ -21,51 +21,82 @@ -package testcase.sd.headerandfooter; +/** + * + */ +package testcase.presentation.headerandfooter; import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; import static testlib.AppUtil.openStartcenter; import static testlib.AppUtil.submitSaveDlg; import static testlib.AppUtil.submitOpenDlg; import static testlib.AppUtil.testFile; -import static testlib.UIMap.startcenter; import static testlib.UIMap.*; - -import java.io.File; - import static org.junit.Assert.*; import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.openoffice.test.common.FileUtil; - import testlib.Log; -import testlib.UIMap; -public class OpenPPTWithHeaderFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ +public class OpenDocumentWithHeaderFooter { + @Rule public Log LOG = new Log(); - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ @Before public void setUp() throws Exception { - initApp(); + app.start(); + } + + @After + public void tearDown() throws Exception { + app.close(); + } + + /** + * Test open AOO3.4 presentation with header and footer. + * edit and save to ODP + * @throws Exception + */ + @Test + public void testOpenAOO34WithHeaderFooter() throws Exception{ + //open sample file + String file = testFile("sd/AOO3.4HeaderFooter.odp"); + app.dispatch(".uno:Open"); + submitOpenDlg(file); + + //check after reopen + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); + assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText()); + assertEquals(true,SD_FooterTextOnSlide.isChecked()); + assertEquals("footer test",SD_FooterTextOnSlideInput.getText()); + assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); + + SD_SlideNumAsFooterOnSlide.uncheck(); + SD_ApplyToAllButtonOnSlideFooter.click(); + + //save to odp and reopen + impress.menuItem("File->Save As...").select(); + String saveTo2 = fullPath("temp/" + "AOO3.4HeaderFooter.odp"); + FileUtil.deleteFile(saveTo2); + submitSaveDlg(saveTo2); + impress.menuItem("File->Close").select(); + sleep(1); + + openStartcenter(); + app.dispatch(".uno:Open"); + String openFrom2=fullPath("temp/" + "AOO3.4HeaderFooter.odp"); + submitOpenDlg(openFrom2); + + impress.menuItem("View->Header and Footer...").select(); + sleep(1); + assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); + //end-save to odp and reopen } /** @@ -77,7 +108,7 @@ public class OpenPPTWithHeaderFooter { public void testOpenPPTWithHeaderFooter() throws Exception{ //open sample file String file = testFile("sd/gfdd.ppt"); - startcenter.menuItem("File->Open").select(); + app.dispatch(".uno:Open"); submitOpenDlg(file); //check after reopen @@ -92,20 +123,19 @@ public class OpenPPTWithHeaderFooter { SD_SlideNumAsFooterOnSlide.uncheck(); SD_ApplyToAllButtonOnSlideFooter.click(); - //save to ppt and reopen impress.menuItem("File->Save As...").select(); String saveTo = fullPath("temp/" + "gfdd.ppt"); FileUtil.deleteFile(saveTo); submitSaveDlg(saveTo); - SaveInODFOrNot.focus(); - typeKeys("<enter>"); + if (AlienFormatDlg.exists(3)) + AlienFormatDlg.ok(); sleep(1); impress.menuItem("File->Close").select(); sleep(1); openStartcenter(); - startcenter.menuItem("File->Open").select(); + app.dispatch(".uno:Open"); String openFrom=fullPath("temp/" + "gfdd.ppt"); submitOpenDlg(openFrom); @@ -118,7 +148,6 @@ public class OpenPPTWithHeaderFooter { SD_ApplyButtonOnSlideFooter.focus(); typeKeys("<tab>"); typeKeys("<enter>"); - //end //save to odp and reopen @@ -130,7 +159,7 @@ public class OpenPPTWithHeaderFooter { sleep(1); openStartcenter(); - startcenter.menuItem("File->Open").select(); + app.dispatch(".uno:Open"); String openFrom2=fullPath("temp/" + "gfdd.odp"); submitOpenDlg(openFrom2); @@ -139,7 +168,4 @@ public class OpenPPTWithHeaderFooter { assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); //end-save to odp and reopen } - - - } diff --git a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyFooter.java b/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyFooter.java deleted file mode 100644 index 318abea61b5d..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyFooter.java +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.vcl.IDList; -import org.openoffice.test.vcl.widgets.VclButton; -import org.openoffice.test.vcl.widgets.VclDialog; -import org.openoffice.test.vcl.widgets.VclMessageBox; -import org.openoffice.test.vcl.widgets.VclTabControl; - -import testlib.Log; -import testlib.UIMap; - -public class CopySlideWithApplyFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Copy slide with Apply Footer to same file and different file - * @throws Exception - */ - @Test - public void testCopySlideWithApplyFooter() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - - 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); - - - SD_SlidesPanel.focus(); - for(int j=0; j<=2;j++){ - typeKeys("<up>"); - sleep(1); - } - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_SlideNumAsFooterOnSlide.uncheck(); - SD_ApplyButtonOnSlideFooter.click(); - - //paste to the same file - SD_SlidesPanel.focus(); - typeKeys("<$copy>"); - typeKeys("<$paste>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); - - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - - //paste to different file - impress.focus(); - impress.menuItem("File->New->Presentation").select(); - sleep(1); - typeKeys("<$paste>"); - SD_SlidesPanel.focus(); - typeKeys("<down>"); - sleep(1); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyToAllFooter.java b/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyToAllFooter.java deleted file mode 100644 index 467327ef3a36..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyToAllFooter.java +++ /dev/null @@ -1,158 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.vcl.IDList; -import org.openoffice.test.vcl.widgets.VclButton; -import org.openoffice.test.vcl.widgets.VclDialog; -import org.openoffice.test.vcl.widgets.VclMessageBox; -import org.openoffice.test.vcl.widgets.VclTabControl; - -import testlib.Log; -import testlib.UIMap; - -public class CopySlideWithApplyToAllFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Copy slide with Apply to all Footer to same file and different file - * @throws Exception - */ - @Test - public void testCopySlideWithApplyToAllFooter() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - - 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); - - - SD_SlidesPanel.focus(); - for(int j=0; j<=2;j++){ - typeKeys("<up>"); - sleep(1); - } - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_SlideNumAsFooterOnSlide.uncheck(); - SD_ApplyButtonOnSlideFooter.click(); - - //paste to the same file - SD_SlidesPanel.focus(); - typeKeys("<up>"); - typeKeys("<$copy>"); - typeKeys("<down>"); - sleep(1); - typeKeys("<$paste>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - - //paste to different file - impress.focus(); - impress.menuItem("File->New->Presentation").select(); - sleep(1); - typeKeys("<$paste>"); - SD_SlidesPanel.focus(); - typeKeys("<down>"); - sleep(1); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithNotesHeaderFooter.java b/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithNotesHeaderFooter.java deleted file mode 100644 index 87e43e8370bf..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/CopySlideWithNotesHeaderFooter.java +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import testlib.ImpressUtil; -import testlib.Log; -import testlib.UIMap; - -public class CopySlideWithNotesHeaderFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Copy slide with Notes Footer to same file and different file - * @throws Exception - */ - @Test - public void testCopySlideWithNotesHeaderFooter() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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 - SD_SlidesPanel.focus(); - typeKeys("<up>"); - typeKeys("<$copy>"); - typeKeys("<down>"); - sleep(1); - typeKeys("<$paste>"); - - ImpressUtil.getCurView().activate(); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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()); - - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - - //paste to different file - impress.focus(); - impress.menuItem("File->New->Presentation").select(); - sleep(1); - typeKeys("<$paste>"); - SD_SlidesPanel.focus(); - typeKeys("<down>"); - sleep(1); - ImpressUtil.getCurView().activate(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/DuplicateSlideWithApplyToAllFooter.java b/test/testoo/src/testcase/sd/headerandfooter/DuplicateSlideWithApplyToAllFooter.java deleted file mode 100644 index ba0c7de67081..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/DuplicateSlideWithApplyToAllFooter.java +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import testlib.Log; -import testlib.UIMap; - -public class DuplicateSlideWithApplyToAllFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test duplicate slide with Apply to all Footer to same file - * @throws Exception - */ - @Test - public void testDuplicateSlideWithApplyToAllFooter() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - - 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); - - - SD_SlidesPanel.focus(); - for(int j=0; j<=2;j++){ - typeKeys("<up>"); - sleep(1); - } - impress.menuItem("Insert->Duplicate Slide").select(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/FooterNotShowOn1stSlide.java b/test/testoo/src/testcase/sd/headerandfooter/FooterNotShowOn1stSlide.java deleted file mode 100644 index 2af93450ce85..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/FooterNotShowOn1stSlide.java +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; - -import testlib.Log; -import testlib.UIMap; - -public class FooterNotShowOn1stSlide { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test footer not show on the first slide. - * @throws Exception - */ - @Test - public void testFooterNotShowOn1stSlide() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<2;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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - SD_FooterTextOnSlide.check(); - sleep(1); - SD_FooterTextOnSlideInput.setText("Footer Test"); - sleep(1); - SD_FooterNotShowOn1stSlide.check(); - SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(1); - - SD_SlidesPanel.focus(); - for(int j=0; j<2;j++){ - typeKeys("<up>"); - sleep(1); - } - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked()); - assertEquals(false,SD_FooterTextOnSlide.isChecked()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyFooterOnSlide.java b/test/testoo/src/testcase/sd/headerandfooter/InsertApplyFooterOnSlide.java deleted file mode 100644 index 243122e061d9..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyFooterOnSlide.java +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.vcl.IDList; -import org.openoffice.test.vcl.widgets.VclButton; -import org.openoffice.test.vcl.widgets.VclDialog; -import org.openoffice.test.vcl.widgets.VclMessageBox; -import org.openoffice.test.vcl.widgets.VclTabControl; - -import testlib.Log; -import testlib.UIMap; - -public class InsertApplyFooterOnSlide { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert Footer to focus slide. - * @throws Exception - */ - @Test - public void testInsertApplyFooterOnSlide() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<5;i++){ - SD_InsertPageButtonOnToolbar.click(); - sleep(1); - } - - //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - - 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); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_SlidesPanel.focus(); - typeKeys("<up>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("",SD_FooterTextOnSlideInput.getText()); - assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("",SD_FooterTextOnSlideInput.getText()); - assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnNotes.java b/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnNotes.java deleted file mode 100644 index c71386a93f15..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnNotes.java +++ /dev/null @@ -1,158 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.vcl.IDList; -import org.openoffice.test.vcl.widgets.VclButton; -import org.openoffice.test.vcl.widgets.VclDialog; -import org.openoffice.test.vcl.widgets.VclMessageBox; -import org.openoffice.test.vcl.widgets.VclTabControl; - -import testlib.Log; -import testlib.UIMap; - -public class InsertApplyToAllFooterOnNotes { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert Footer to Notes View - * @throws Exception - */ - @Test - public void testInsertApplyToAllFooterOnNotes() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<5;i++){ - SD_InsertPageButtonOnToolbar.click(); - sleep(1); - } - - //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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); - SD_HeaderAndFooterOnNotesTabPage.select(); - assertEquals(true,SD_HeaderTextOnNotes.isChecked()); - assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_SlidesPanel.focus(); - typeKeys("<up>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_HeaderAndFooterOnNotesTabPage.select(); - assertEquals(true,SD_HeaderTextOnNotes.isChecked()); - assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_HeaderAndFooterOnNotesTabPage.select(); - assertEquals(true,SD_HeaderTextOnNotes.isChecked()); - assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnSlide.java b/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnSlide.java deleted file mode 100644 index 3a55f03593df..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnSlide.java +++ /dev/null @@ -1,147 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.initApp; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.vcl.IDList; -import org.openoffice.test.vcl.widgets.VclButton; -import org.openoffice.test.vcl.widgets.VclDialog; -import org.openoffice.test.vcl.widgets.VclMessageBox; -import org.openoffice.test.vcl.widgets.VclTabControl; - -import testlib.Log; -import testlib.UIMap; - -public class InsertApplyToAllFooterOnSlide { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert Footer to Slide, use Apply to All - * @throws Exception - */ - @Test - public void testInsertApplyToAllFooterOnSlide() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<5;i++){ - SD_InsertPageButtonOnToolbar.click(); - sleep(1); - } - - //add header and footer to focus slide. - impress.menuItem("View->Header and Footer...").select(); - sleep(2); - - 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); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_SlidesPanel.focus(); - typeKeys("<up>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - //end close - - SD_InsertPageButtonOnToolbar.click(); - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); - assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeFooter.java b/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeFooter.java deleted file mode 100644 index e7ce904c3a9d..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeFooter.java +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; -import static testlib.AppUtil.openStartcenter; -import static testlib.AppUtil.submitSaveDlg; -import static testlib.AppUtil.submitOpenDlg; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; -import java.util.Calendar; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; - -import testlib.Log; -import testlib.UIMap; - -public class InsertAutoUpdateTimeFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert update automatically time footer to slides. - * @throws Exception - */ - @Test - public void testInsertAutoUpdateTimeFooter() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<3;i++){ - SD_InsertPageButtonOnToolbar.click(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_AutoUpdateTimeFooter.check(); - SD_AutoUpdateTimeFooterType.select(7); - String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); - SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(2); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - - String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); - assertFalse(currentTime.equals(currentTime2)); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeOnNotes.java b/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeOnNotes.java deleted file mode 100644 index 62d312096086..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeOnNotes.java +++ /dev/null @@ -1,105 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; -import static testlib.AppUtil.openStartcenter; -import static testlib.AppUtil.submitSaveDlg; -import static testlib.AppUtil.submitOpenDlg; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; -import java.util.Calendar; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; - -import testlib.Log; -import testlib.UIMap; - -public class InsertAutoUpdateTimeOnNotes { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert update automatically time footer to Notes view. - * @throws Exception - */ - @Test - public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - for(int i=0; i<3;i++){ - SD_InsertPageButtonOnToolbar.click(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_HeaderAndFooterOnNotesTabPage.select(); - SD_AutoUpdateTimeFooter.check(); - SD_AutoUpdateTimeFooterType.select(7); - String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); - SD_ApplyToAllButtonOnSlideFooter.click(); - sleep(2); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - SD_HeaderAndFooterOnNotesTabPage.select(); - String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); - - assertFalse(currentTime.equals(currentTime2)); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnNotes.java b/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnNotes.java deleted file mode 100644 index f0ac5f2dc213..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnNotes.java +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; -import static testlib.AppUtil.openStartcenter; -import static testlib.AppUtil.submitSaveDlg; -import static testlib.AppUtil.submitOpenDlg; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; - -import testlib.Log; -import testlib.UIMap; - -public class InsertHeaderFooterOnNotes { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert Header and Footer to Notes view. - * Save and ReOpen - * @throws Exception - */ - @Test - public void testInsertHeaderFooterOnNotes() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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); - - SD_SlidesPanel.focus(); - typeKeys("<up>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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()); - - //close header and footer dialog. - SD_ApplyToAllButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - - //save this file - impress.menuItem("File->Save").select(); - String saveTo = fullPath("temp/" + "hello.odp"); - FileUtil.deleteFile(saveTo); - submitSaveDlg(saveTo); - impress.menuItem("File->Close").select(); - sleep(2); - - //Reopen this file - openStartcenter(); - startcenter.menuItem("File->Open").select(); - String openFrom=fullPath("temp/" + "hello.odp"); - submitOpenDlg(openFrom); - - //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnSlide.java b/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnSlide.java deleted file mode 100644 index 9e7b069122a3..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnSlide.java +++ /dev/null @@ -1,146 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; -import static testlib.AppUtil.openStartcenter; -import static testlib.AppUtil.submitSaveDlg; -import static testlib.AppUtil.submitOpenDlg; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; - -import testlib.Log; -import testlib.UIMap; - -public class InsertHeaderFooterOnSlide { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test Insert Header and Footer to Slide - * Save and Reopen - * @throws Exception - */ - @Test - public void testInsertHeaderFooterOnSlide() throws Exception{ - - startcenter.menuItem("File->New->Presentation").select(); - sleep(2); - - 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(); - sleep(1); - } - - //add header and footer - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - 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); - - SD_SlidesPanel.focus(); - typeKeys("<up>"); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - //close header and footer dialog. - SD_ApplyButtonOnSlideFooter.focus(); - typeKeys("<tab>"); - typeKeys("<enter>"); - - //save this file - impress.menuItem("File->Save").select(); - String saveTo = fullPath("temp/" + "hello.odp"); - FileUtil.deleteFile(saveTo); - submitSaveDlg(saveTo); - impress.menuItem("File->Close").select(); - sleep(2); - - //Reopen this file - openStartcenter(); - startcenter.menuItem("File->Open").select(); - String openFrom=fullPath("temp/" + "hello.odp"); - submitOpenDlg(openFrom); - - //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - } - -} diff --git a/test/testoo/src/testcase/sd/headerandfooter/OpenAOO34WithHeaderFooter.java b/test/testoo/src/testcase/sd/headerandfooter/OpenAOO34WithHeaderFooter.java deleted file mode 100644 index 66cb9e6fd1dd..000000000000 --- a/test/testoo/src/testcase/sd/headerandfooter/OpenAOO34WithHeaderFooter.java +++ /dev/null @@ -1,117 +0,0 @@ -/************************************************************** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *************************************************************/ - - - -package testcase.sd.headerandfooter; - -import static testlib.AppUtil.fullPath; -import static testlib.AppUtil.initApp; -import static testlib.AppUtil.openStartcenter; -import static testlib.AppUtil.submitSaveDlg; -import static testlib.AppUtil.submitOpenDlg; -import static testlib.AppUtil.testFile; -import static testlib.UIMap.startcenter; -import static testlib.UIMap.*; - -import java.io.File; - -import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; -import static org.openoffice.test.vcl.Tester.typeKeys; - -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.openoffice.test.common.FileUtil; - -import testlib.Log; -import testlib.UIMap; - -public class OpenAOO34WithHeaderFooter { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ - @Rule - public Log LOG = new Log(); - - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - initApp(); - } - - /** - * Test open AOO3.4 presentation with header and footer. - * edit and save to ODP - * @throws Exception - */ - @Test - public void testOpenAOO34WithHeaderFooter() throws Exception{ - //open sample file - String file = testFile("sd/AOO3.4HeaderFooter.odp"); - startcenter.menuItem("File->Open").select(); - submitOpenDlg(file); - - //check after reopen - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); - assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText()); - assertEquals(true,SD_FooterTextOnSlide.isChecked()); - assertEquals("footer test",SD_FooterTextOnSlideInput.getText()); - assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); - - SD_SlideNumAsFooterOnSlide.uncheck(); - SD_ApplyToAllButtonOnSlideFooter.click(); - - - //save to odp and reopen - impress.menuItem("File->Save As...").select(); - String saveTo2 = fullPath("temp/" + "AOO3.4HeaderFooter.odp"); - FileUtil.deleteFile(saveTo2); - submitSaveDlg(saveTo2); - impress.menuItem("File->Close").select(); - sleep(1); - - openStartcenter(); - startcenter.menuItem("File->Open").select(); - String openFrom2=fullPath("temp/" + "AOO3.4HeaderFooter.odp"); - submitOpenDlg(openFrom2); - - impress.menuItem("View->Header and Footer...").select(); - sleep(1); - assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); - //end-save to odp and reopen - } - - - -} diff --git a/test/testoo/src/testcase/sw/table/ConvertTableToText.java b/test/testoo/src/testcase/textdocument/table/Table.java index bef9838a894e..da1fb18f349f 100644 --- a/test/testoo/src/testcase/sw/table/ConvertTableToText.java +++ b/test/testoo/src/testcase/textdocument/table/Table.java @@ -24,51 +24,35 @@ /** * */ -package testcase.sw.table; +package testcase.textdocument.table; import static testlib.AppUtil.*; import static testlib.UIMap.*; - -import java.awt.Rectangle; -import java.io.File; - import static org.junit.Assert.*; -import static org.openoffice.test.vcl.Tester.*; - +import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; -import org.openoffice.test.common.FileUtil; -import org.openoffice.test.common.GraphicsUtil; +import org.openoffice.test.common.SystemUtil; -import testlib.CalcUtil; import testlib.Log; /** * */ -public class ConvertTableToText { +public class Table { - /** - * TestCapture helps us to do - * 1. Take a screenshot when failure occurs. - * 2. Collect extra data when OpenOffice crashes. - */ @Rule public Log LOG = new Log(); - /** - * initApp helps us to do - * 1. Patch the OpenOffice to enable automation if necessary. - * 2. Start OpenOffice with automation enabled if necessary. - * 3. Reset OpenOffice to startcenter. - * - * @throws java.lang.Exception - */ @Before public void setUp() throws Exception { - initApp(); + app.start(); + } + + @After + public void tearDown() throws Exception { + app.close(); } /** @@ -85,7 +69,7 @@ public class ConvertTableToText { // Insert a table and input some data writer.menuItem("Insert->Table...").select(); writer_InsertTable.ok(); - writer.click(1, 1); + writer.focus(); typeKeys("1<right>2<right>3<right>4"); sleep(1); @@ -97,7 +81,10 @@ public class ConvertTableToText { // Verify if text is converted successfully writer.menuItem("Edit->Select All").select(); - typeKeys("<$copy>"); - assertEquals("Converted text", "1 2\n3 4\n", app.getClipboard()); + app.dispatch(".uno:Copy"); + if (SystemUtil.isWindows()) + assertEquals("Converted text", "1\t2\r\n3\t4\r\n", app.getClipboard()); // windows�лس�������\r\n + else + assertEquals("Converted text", "1\t2\n3\t4\n", app.getClipboard()); } } diff --git a/test/testoo/src/testlib/AppUtil.java b/test/testoo/src/testlib/AppUtil.java index 29713c8e361f..0382d73addb1 100644 --- a/test/testoo/src/testlib/AppUtil.java +++ b/test/testoo/src/testlib/AppUtil.java @@ -57,6 +57,9 @@ public class AppUtil extends Tester { } } + public static void typeKeys(String keys) { + Tester.typeKeys(keys); + } public static void openStartcenter() { if (startcenter.exists()) diff --git a/test/testoo/src/testlib/UIMap.java b/test/testoo/src/testlib/UIMap.java index ed00f955d6c4..b7aa60e3408c 100644 --- a/test/testoo/src/testlib/UIMap.java +++ b/test/testoo/src/testlib/UIMap.java @@ -235,17 +235,17 @@ public class UIMap { public static final VclControl DataPilotFieldSelect = control("59030"); public static final VclButton DataPilotAutomaticallyUpdateCheckBox = button("3643262003"); public static final VclButton DataPilotTableUpdateButton = button("3643265586"); - public static final VclButton SD_DateAndTimeFooterOnSlide = button("553255938"); - public static final VclButton SD_FixedDateAndTimeFooterOnSlide = button("553255427"); - public static final VclEditBox SD_FixedDateAndTimeOnSlideInput = editbox("553256964"); - public static final VclButton SD_FooterTextOnSlide = button("553255946"); - public static final VclEditBox SD_FooterTextOnSlideInput = editbox("553256972"); - public static final VclButton SD_SlideNumAsFooterOnSlide = button("553255950"); - public static final VclButton SD_ApplyToAllButtonOnSlideFooter = button("553259537"); - public static final VclWindow SD_SlidesPanel = window("59787"); - public static final VclControl SD_SlidelistInNaviagtor = control("59793"); - public static final VclControl SD_HeaderAndFooterDialog = control("59901"); - public static final VclButton SD_ApplyButtonOnSlideFooter = button("553259538"); + public static final VclButton SD_DateAndTimeFooterOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_DATETIME"); + public static final VclButton SD_FixedDateAndTimeFooterOnSlide = button("sd:RadioButton:RID_SD_TABPAGE_HEADERFOOTER:RB_DATETIME_FIXED"); + public static final VclEditBox SD_FixedDateAndTimeOnSlideInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_DATETIME_FIXED"); + public static final VclButton SD_FooterTextOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_FOOTER"); + public static final VclEditBox SD_FooterTextOnSlideInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_FOOTER_FIXED"); + public static final VclButton SD_SlideNumAsFooterOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_SLIDENUMBER"); + public static final VclButton SD_ApplyToAllButtonOnSlideFooter = button("sd:PushButton:RID_SD_TABPAGE_HEADERFOOTER:BT_APPLYTOALL"); +// public static final VclWindow SD_SlidesPanel = window("HID_SD_WIN_DOCUMENT"); + public static final VclControl SD_SlidelistInNaviagtor = control("HID_SD_NAVIGATOR_TLB"); + public static final VclControl SD_HeaderAndFooterDialog = control("HID_SD_TABPAGE_HEADERFOOTER_SLIDE"); + public static final VclButton SD_ApplyButtonOnSlideFooter = button("sd:PushButton:RID_SD_TABPAGE_HEADERFOOTER:BT_APPLY"); public static final VclButton SD_InsertPageButtonOnToolbar = button(".uno:InsertPage"); public static final VclControl DataPilotPaneRowArea = control("59036"); public static final VclEditBox DataPilotFieldDisplayNameEditBox = editbox("971868166"); @@ -257,10 +257,10 @@ public class UIMap { public static final VclButton DataPilotFieldOptionSortDescendingRadioButton = button("958972620"); public static final VclControl DataPiloPaneDataArea = control("59038"); public static final VclControl DataPilotColumnArea = control("59034"); - public static final VclButton SD_HeaderTextOnNotes = button("553255958"); - public static final VclEditBox SD_HeaderTextOnNotesInput = editbox("553256984"); - public static final VclTabPage SD_HeaderAndFooterOnNotesTabPage = tabpage("59902"); - public static final VclButton SD_FooterNotShowOn1stSlide = button("553255952"); + public static final VclButton SD_HeaderTextOnNotes = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_HEADER"); + public static final VclEditBox SD_HeaderTextOnNotesInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_HEADER_FIXED"); + public static final VclTabPage SD_HeaderAndFooterOnNotesTabPage = tabpage("SD_HID_SD_TABPAGE_HEADERFOOTER_NOTESHANDOUT"); + public static final VclButton SD_FooterNotShowOn1stSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_NOTONTITLE"); public static final VclTabPage SortOptionsPage = tabpage("SC_HID_SCPAGE_SORT_OPTIONS"); public static final VclButton SortOptionsPage_CaseSensitive = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE"); public static final VclButton SortOptionsPage_CopyResultTo = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT"); @@ -272,12 +272,11 @@ public class UIMap { public static final VclButton DataPilotFieldOptionSubTotalsNeverRadioButton = button("958956135"); public static final VclButton DataPilotFieldOptionSortAscendingRadioButton = button("958972619"); public static final VclControl DataPilotPanePageArea = control("59032"); - public static final VclDialog SaveInODFOrNot = dialog("33388"); public static final VclButton OnlyDisplayTopNItemCheckBox = button("1495745540"); public static final VclField NumberOfItemShowInTopNEditBox = field("1495750661"); public static final VclDialog FieldTopNSettingDialog = dialog("59039"); - public static final VclButton SD_AutoUpdateTimeFooter = button("553255429"); - public static final VclListBox SD_AutoUpdateTimeFooterType = listbox("553258502"); + public static final VclButton SD_AutoUpdateTimeFooter = button("sd:RadioButton:RID_SD_TABPAGE_HEADERFOOTER:RB_DATETIME_AUTOMATIC"); + public static final VclListBox SD_AutoUpdateTimeFooterType = listbox("sd:ListBox:RID_SD_TABPAGE_HEADERFOOTER:CB_DATETIME_FORMAT"); public static final VclButton DataPilotButton = button("59270"); public static final VclDockingWin DataPilotPanel = dockingwin("3643260928"); public static final VclListBox SCSubTotalsGroupByListBox = listbox("SC_HID_SC_SUBT_GROUP"); |