Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / cui / qa / uitest / dialogs / macroselectordlg.py
blob96ba11a2d8880409b22abe71893e7a7b17b67972
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
22 break
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
33 break
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: