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 libreoffice
.uno
.propertyvalue
import mkPropertyValues
10 from uitest
.uihelper
.common
import get_state_as_dict
11 from uitest
.debug
import sleep
12 from uitest
.uihelper
.common
import select_pos
14 #Bug 116737 - INSERT TABLE: Can't select table style (gen/gtk)
15 class tdf116737(UITestCase
):
16 def test_tdf116737_select_table_style(self
):
18 self
.ui_test
.create_doc_in_start_center("writer")
19 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
20 document
= self
.ui_test
.get_component()
22 #Insert => Insert Table / It's not possible to select a table style
23 self
.ui_test
.execute_dialog_through_command(".uno:InsertTable")
24 xDialog
= self
.xUITest
.getTopFocusWindow()
26 formatlbinstable
= xDialog
.getChild("formatlbinstable")
27 entry
= formatlbinstable
.getChild("11") #Simple List Shaded
28 entry
.executeAction("SELECT", tuple())
30 xOkBtn
= xDialog
.getChild("ok")
31 self
.ui_test
.close_dialog_through_button(xOkBtn
)
33 #verify .uno:TableDialog
34 self
.ui_test
.execute_dialog_through_command(".uno:TableDialog")
35 xDialog
= self
.xUITest
.getTopFocusWindow()
36 xTabs
= xDialog
.getChild("tabcontrol")
37 select_pos(xTabs
, "4") #tab Background
39 btncolor
= xDialog
.getChild("btncolor")
40 btncolor
.executeAction("CLICK", tuple())
42 R_custom
= xDialog
.getChild("R_custom")
43 G_custom
= xDialog
.getChild("G_custom")
44 B_custom
= xDialog
.getChild("B_custom")
45 #"Simple List Shaded" -> header should be black
46 self
.assertEqual(get_state_as_dict(R_custom
)["Text"], "0")
47 self
.assertEqual(get_state_as_dict(G_custom
)["Text"], "0")
48 self
.assertEqual(get_state_as_dict(B_custom
)["Text"], "0")
50 xOkBtn
= xDialog
.getChild("ok")
51 self
.ui_test
.close_dialog_through_button(xOkBtn
)
53 self
.ui_test
.close_doc()
54 # vim: set shiftwidth=4 softtabstop=4 expandtab: