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()
15 document
.StyleFamilies
.PageStyles
.Standard
.HeaderIsOn
, False)
17 self
.xUITest
.executeCommand(
18 ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=true")
21 document
.StyleFamilies
.PageStyles
.Standard
.HeaderIsOn
, True)
23 def delete_header(self
):
24 document
= self
.ui_test
.get_component()
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())
38 document
.StyleFamilies
.PageStyles
.Standard
.HeaderIsOn
, False)
40 def test_header(self
):
41 self
.ui_test
.create_doc_in_start_center("writer")
47 self
.ui_test
.close_doc()
49 def test_tdf107427(self
):
50 self
.ui_test
.create_doc_in_start_center("writer")
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")
71 self
.ui_test
.close_doc()