summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-02-20 16:00:03 +0100
committerAndras Timar <andras.timar@collabora.com>2023-03-06 20:14:10 +0000
commit97766e9a67f5f36cd824bdbfab290177b3d5a05a (patch)
tree8b5c0b9dc5b5b1570f197f9b27617030238adc08 /cui
parent24e8473094839ca43a4347f843c55cfd2e12cc67 (diff)
fix build tests: cui: rework uitest to work with --without-java
This fixes make UITest_cui_dialogs on Ubuntu 20.04/gcc 9.4.0. Change-Id: I6ed187f515b47b7e54ed85c08ee9523f1b777575 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147335 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148361 Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
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: