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
8 from uitest
.uihelper
.common
import get_state_as_dict
10 class tdf145978(UITestCase
):
11 def test_tdf145978(self
):
12 with self
.ui_test
.execute_dialog_through_command(".uno:RunMacro") as xDialog
:
13 xCategoriesTree
= xDialog
.getChild("categories")
14 xCategoriesTreeEntry
= xCategoriesTree
.getChild('1') #Application Macros
15 xCategoriesTreeEntry
.executeAction("EXPAND", tuple())
17 xSubCategoriesTreeEntry
= None
18 for i
in xCategoriesTreeEntry
.getChildren():
19 xChild
= xCategoriesTreeEntry
.getChild(i
)
20 if get_state_as_dict(xChild
)["Text"] == "HelloWorld":
21 xSubCategoriesTreeEntry
= xChild
24 xSubCategoriesTreeEntry
.executeAction("SELECT", tuple())
26 xCommandsTree
= xDialog
.getChild("commands")
28 xCommandsTreeEntry
= None
29 for i
in xCommandsTree
.getChildren():
30 xChild
= xCommandsTree
.getChild(i
)
31 if get_state_as_dict(xChild
)["Text"] == "HelloWorldPython":
32 xCommandsTreeEntry
= xChild
35 xCommandsTreeEntry
.executeAction("SELECT", tuple())
37 #Verify the dialog reloads with previous run macro selected
38 with self
.ui_test
.execute_dialog_through_command(".uno:RunMacro") as xDialog
:
39 xTree
= xDialog
.getChild("categories")
40 self
.assertEqual("HelloWorld", get_state_as_dict(xTree
)["SelectEntryText"])
41 xTree
= xDialog
.getChild("commands")
42 self
.assertEqual("HelloWorldPython", get_state_as_dict(xTree
)["SelectEntryText"])
44 # vim: set shiftwidth=4 softtabstop=4 expandtab: