Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / uitest / writer_tests / insertPageHeader.py
blobd510e726e66938e19fab17426307ea6da64bbd8b
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest.framework import UITestCase
9 class WriterInsertPageHeader(UITestCase):
11 def insert_header(self):
12 document = self.ui_test.get_component()
14 self.assertEqual(
15 document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
17 self.xUITest.executeCommand(
18 ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=true")
20 self.assertEqual(
21 document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
23 def delete_header(self):
24 document = self.ui_test.get_component()
26 self.assertEqual(
27 document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
29 self.ui_test.execute_dialog_through_command(
30 ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=false")
32 xDialog = self.xUITest.getTopFocusWindow()
34 xOption = xDialog.getChild("yes")
35 xOption.executeAction("CLICK", tuple())
37 self.assertEqual(
38 document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
40 def test_header(self):
41 self.ui_test.create_doc_in_start_center("writer")
43 self.insert_header()
45 self.delete_header()
47 self.ui_test.close_doc()
49 def test_tdf107427(self):
50 self.ui_test.create_doc_in_start_center("writer")
52 self.insert_header()
54 self.ui_test.execute_dialog_through_command(".uno:InsertTable")
56 xInsertDlg = self.xUITest.getTopFocusWindow()
58 xOkBtn = xInsertDlg.getChild("ok")
59 xOkBtn.executeAction("CLICK", tuple())
61 document = self.ui_test.get_component()
63 tables = document.getTextTables()
64 self.assertEqual(len(tables[0].getRows()), 2)
65 self.assertEqual(len(tables[0].getColumns()), 2)
67 self.xUITest.executeCommand(".uno:SelectAll")
69 self.delete_header()
71 self.ui_test.close_doc()