summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-06-04 13:17:34 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-04 14:00:42 +0200
commit4839b7ca3b5a730edf90ebebc749db145efec098 (patch)
tree584a651a353aabae13f996c62ed54767f3fe1434 /sc
parent191a5bc8bce278d93d8e52d83771fcf59a0fbe9f (diff)
Fix UITests that use File Open dialog to load documents
It relied upon the component being loaded before the next Python code line is executed. OTOH, UITest.load_file uses EventListener to wait for the OnLoad event, which should be reused in all such cases. This moves the waiting code to a dedicated context manager, and modifies UITest.load_file to use it. Respective tests using the File dialog also use the new manager to wrap the action starting the loading process. Change-Id: Ic6eb0533b06e0ccc63dffc2ddc0e91d8159cae4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116693 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/calc_tests9/tdf57841.py3
-rw-r--r--sc/qa/uitest/calc_tests9/tdf60468.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/sc/qa/uitest/calc_tests9/tdf57841.py b/sc/qa/uitest/calc_tests9/tdf57841.py
index 4c3722bf29d2..0eb2d260b699 100644
--- a/sc/qa/uitest/calc_tests9/tdf57841.py
+++ b/sc/qa/uitest/calc_tests9/tdf57841.py
@@ -36,7 +36,8 @@ class Tdf57841(UITestCase):
xTextDelimiter.executeAction("TYPE", mkPropertyValues({"TEXT": "\""}))
xOK = xDialog.getChild('ok')
- self.ui_test.close_dialog_through_button(xOK)
+ with self.ui_test.wait_until_component_loaded():
+ self.ui_test.close_dialog_through_button(xOK)
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/calc_tests9/tdf60468.py b/sc/qa/uitest/calc_tests9/tdf60468.py
index 33230737db73..48af292df505 100644
--- a/sc/qa/uitest/calc_tests9/tdf60468.py
+++ b/sc/qa/uitest/calc_tests9/tdf60468.py
@@ -36,7 +36,8 @@ class Tdf60468(UITestCase):
xTextDelimiter.executeAction("TYPE", mkPropertyValues({"TEXT": "\""}))
xOK = xDialog.getChild('ok')
- self.ui_test.close_dialog_through_button(xOK)
+ with self.ui_test.wait_until_component_loaded():
+ self.ui_test.close_dialog_through_button(xOK)
document = self.ui_test.get_component()