aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2019-09-09 11:14:46 +0200
committerChristian Stenger <christian.stenger@qt.io>2019-10-02 19:32:00 +0000
commitea829fa6d51b46d1c2f06d14150c0948ffd044d5 (patch)
tree3e185a57a0ddda851852e5edf333f6177b641a3b
parentd907df03496551907259d95fe417b9910d7f7963 (diff)
Squish: Workaround bad focus issue when using Squishv4.10.1
When interacting with the file dialog QC seems to lose its focus and never gets it completely back. This in turn makes lots of short cuts useless and (context) menu entries disappear or being disabled. Avoid this by explicitly closing the popup of the line edit if there is one. Change-Id: I79f86b3133d2d0780d73d75e15416d59f35dfa1e Reviewed-by: Robert Loehning <robert.loehning@qt.io>
-rw-r--r--tests/system/shared/utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index e8bc1425a7..ef46aca7b2 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -235,6 +235,11 @@ def getOutputFromCmdline(cmdline, environment=None, acceptedError=0):
return e.output
def selectFromFileDialog(fileName, waitForFile=False, ignoreFinalSnooze=False):
+ def __closePopupIfNecessary__():
+ if not isNull(QApplication.activePopupWidget()):
+ test.log("Closing active popup widget")
+ QApplication.activePopupWidget().close()
+
if platform.system() == "Darwin":
snooze(1)
nativeType("<Command+Shift+g>")
@@ -252,12 +257,13 @@ def selectFromFileDialog(fileName, waitForFile=False, ignoreFinalSnooze=False):
try:
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}", 5000)
pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}")
- snooze(1)
replaceEditorContent(pathLine, pName)
+ snooze(1)
clickButton(waitForObject("{text='Open' type='QPushButton'}"))
waitFor("str(pathLine.text)==''")
- snooze(1)
replaceEditorContent(pathLine, fName)
+ snooze(1)
+ __closePopupIfNecessary__()
clickButton(waitForObject("{text='Open' type='QPushButton'}"))
except:
nativeType("<Ctrl+a>")