summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2017-06-14 10:38:05 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2017-06-14 13:51:32 +0200
commit6db84250d1c4e7ec5a54ff75e124ea9a84ff89d9 (patch)
tree02c283faadce614eb00810ca246c207d2dda1fdb /uitest
parent96ef5d50da2c0c5a1edb279c413f73754d400537 (diff)
uitest: Add test for insertPageHeader and tdf#107427
Change-Id: I8dd7c1a802b021392f25e92d25d9122082f17722 Reviewed-on: https://gerrit.libreoffice.org/38770 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/writer_tests/insertPageHeader.py72
1 files changed, 72 insertions, 0 deletions
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()
+