summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-02-20 16:00:03 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-02-20 16:16:13 +0000
commit9ba251fb3e7d3b76c8ce730e4b3a3a7859bc119b (patch)
tree375b3edca50d2a8f3e66daee885543e9674f4c23 /cui
parentbd8a213c8ceccf66ab296ef0aea0fa4c451047e5 (diff)
cui: rework uitest to work with --without-java
Change-Id: I6ed187f515b47b7e54ed85c08ee9523f1b777575 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147335 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'cui')
-rw-r--r--cui/qa/uitest/dialogs/macroselectordlg.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/cui/qa/uitest/dialogs/macroselectordlg.py b/cui/qa/uitest/dialogs/macroselectordlg.py
index cb0d1928ba46..96ba11a2d888 100644
--- a/cui/qa/uitest/dialogs/macroselectordlg.py
+++ b/cui/qa/uitest/dialogs/macroselectordlg.py
@@ -9,29 +9,36 @@ from uitest.uihelper.common import get_state_as_dict
class tdf145978(UITestCase):
def test_tdf145978(self):
- with self.ui_test.execute_dialog_through_command(".uno:RunMacro", close_button="") as xDialog:
+ with self.ui_test.execute_dialog_through_command(".uno:RunMacro") as xDialog:
xCategoriesTree = xDialog.getChild("categories")
xCategoriesTreeEntry = xCategoriesTree.getChild('1') #Application Macros
xCategoriesTreeEntry.executeAction("EXPAND", tuple())
- xCategoriesTreeEntry = xCategoriesTreeEntry.getChild('8') #HelloWorld
- xCategoriesTreeEntry.executeAction("SELECT", tuple())
- aCategoriesTreeEntryText = get_state_as_dict(xCategoriesTreeEntry)["Text"]
+ xSubCategoriesTreeEntry = None
+ for i in xCategoriesTreeEntry.getChildren():
+ xChild = xCategoriesTreeEntry.getChild(i)
+ if get_state_as_dict(xChild)["Text"] == "HelloWorld":
+ xSubCategoriesTreeEntry = xChild
+ break
+
+ xSubCategoriesTreeEntry.executeAction("SELECT", tuple())
xCommandsTree = xDialog.getChild("commands")
- xCommandsTreeEntry = xCommandsTree.getChild('2') #HelloWorld Python
- xCommandsTreeEntry.executeAction("SELECT", tuple())
- aCommandsTreeEntryText = get_state_as_dict(xCommandsTreeEntry)["Text"]
+ xCommandsTreeEntry = None
+ for i in xCommandsTree.getChildren():
+ xChild = xCommandsTree.getChild(i)
+ if get_state_as_dict(xChild)["Text"] == "HelloWorldPython":
+ xCommandsTreeEntry = xChild
+ break
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xCommandsTreeEntry.executeAction("SELECT", tuple())
#Verify the dialog reloads with previous run macro selected
with self.ui_test.execute_dialog_through_command(".uno:RunMacro") as xDialog:
xTree = xDialog.getChild("categories")
- self.assertEqual(get_state_as_dict(xTree)["SelectEntryText"], aCategoriesTreeEntryText)
+ self.assertEqual("HelloWorld", get_state_as_dict(xTree)["SelectEntryText"])
xTree = xDialog.getChild("commands")
- self.assertEqual(get_state_as_dict(xTree)["SelectEntryText"], aCommandsTreeEntryText)
+ self.assertEqual("HelloWorldPython", get_state_as_dict(xTree)["SelectEntryText"])
# vim: set shiftwidth=4 softtabstop=4 expandtab: