[Libreoffice-commits] core.git: uitest/writer_tests

Xisco Fauli anistenis at gmail.com
Wed Jun 14 11:51:56 UTC 2017


 uitest/writer_tests/insertPageHeader.py |   72 ++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

New commits:
commit 6db84250d1c4e7ec5a54ff75e124ea9a84ff89d9
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Wed Jun 14 10:38:05 2017 +0200

    uitest: Add test for insertPageHeader and tdf#107427
    
    Change-Id: I8dd7c1a802b021392f25e92d25d9122082f17722
    Reviewed-on: https://gerrit.libreoffice.org/38770
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>

diff --git a/uitest/writer_tests/insertPageHeader.py b/uitest/writer_tests/insertPageHeader.py
new file mode 100644
index 000000000000..d510e726e669
--- /dev/null
+++ b/uitest/writer_tests/insertPageHeader.py
@@ -0,0 +1,72 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+
+class WriterInsertPageHeader(UITestCase):
+
+    def insert_header(self):
+        document = self.ui_test.get_component()
+
+        self.assertEqual(
+            document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+
+        self.xUITest.executeCommand(
+            ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=true")
+
+        self.assertEqual(
+            document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
+
+    def delete_header(self):
+        document = self.ui_test.get_component()
+
+        self.assertEqual(
+            document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
+
+        self.ui_test.execute_dialog_through_command(
+            ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=false")
+
+        xDialog = self.xUITest.getTopFocusWindow()
+
+        xOption = xDialog.getChild("yes")
+        xOption.executeAction("CLICK", tuple())
+
+        self.assertEqual(
+            document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+
+    def test_header(self):
+        self.ui_test.create_doc_in_start_center("writer")
+
+        self.insert_header()
+
+        self.delete_header()
+
+        self.ui_test.close_doc()
+
+    def test_tdf107427(self):
+        self.ui_test.create_doc_in_start_center("writer")
+
+        self.insert_header()
+
+        self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+
+        xInsertDlg = self.xUITest.getTopFocusWindow()
+
+        xOkBtn = xInsertDlg.getChild("ok")
+        xOkBtn.executeAction("CLICK", tuple())
+
+        document = self.ui_test.get_component()
+
+        tables = document.getTextTables()
+        self.assertEqual(len(tables[0].getRows()), 2)
+        self.assertEqual(len(tables[0].getColumns()), 2)
+
+        self.xUITest.executeCommand(".uno:SelectAll")
+
+        self.delete_header()
+
+        self.ui_test.close_doc()
+


More information about the Libreoffice-commits mailing list