Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sw / qa / uitest / writer_tests / insertPageFooter.py
blobfd9b31368d6f29d14bc2f331a8730c6a67763476
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from uitest.framework import UITestCase
9 from uitest.debug import sleep
10 from uitest.path import get_srcdir_url
12 class WriterInsertPageFooter(UITestCase):
14 def insert_footer(self):
15 document = self.ui_test.get_component()
17 self.assertEqual(
18 document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
20 self.xUITest.executeCommand(
21 ".uno:InsertPageFooter?PageStyle:string=Default%20Style&On:bool=true")
23 self.assertEqual(
24 document.StyleFamilies.PageStyles.Standard.FooterIsOn, True)
26 def delete_footer(self):
27 document = self.ui_test.get_component()
29 self.assertEqual(
30 document.StyleFamilies.PageStyles.Standard.FooterIsOn, True)
32 self.ui_test.execute_dialog_through_command(
33 ".uno:InsertPageFooter?PageStyle:string=Default%20Style&On:bool=false")
35 xDialog = self.xUITest.getTopFocusWindow()
37 xOption = xDialog.getChild("yes")
38 xOption.executeAction("CLICK", tuple())
40 self.assertEqual(
41 document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
43 def test_footer(self):
44 self.ui_test.create_doc_in_start_center("writer")
46 self.insert_footer()
48 self.delete_footer()
50 self.ui_test.close_doc()
52 def test_tdf107427(self):
53 self.ui_test.create_doc_in_start_center("writer")
55 self.insert_footer()
57 self.ui_test.execute_dialog_through_command(".uno:InsertTable")
59 xInsertDlg = self.xUITest.getTopFocusWindow()
61 xOkBtn = xInsertDlg.getChild("ok")
62 xOkBtn.executeAction("CLICK", tuple())
64 document = self.ui_test.get_component()
66 tables = document.getTextTables()
67 self.assertEqual(len(tables[0].getRows()), 2)
68 self.assertEqual(len(tables[0].getColumns()), 2)
70 self.xUITest.executeCommand(".uno:SelectAll")
72 self.delete_footer()
74 self.ui_test.close_doc()
75 # vim: set shiftwidth=4 softtabstop=4 expandtab: