diff options
author | Robert Loehning <robert.loehning@digia.com> | 2014-08-12 16:14:53 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@digia.com> | 2014-08-12 16:39:47 +0200 |
commit | 646dcf0eea7d56025933b3a73cb7ebcbf8820001 (patch) | |
tree | 5ed53f336a78397c55d1e1c12e304a9b114ab66f /tests/system/shared/utils.py | |
parent | 2b02c0067fddc291c5e49b1faf697fc4967f7e76 (diff) | |
download | qt-creator-646dcf0eea7d56025933b3a73cb7ebcbf8820001.tar.gz |
Squish: Hack when "Open File" dialog can't be found
Happens to me with binary packages for Linux.
Change-Id: I688103ba2df26056468e89271e815b5717effeee
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'tests/system/shared/utils.py')
-rw-r--r-- | tests/system/shared/utils.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index b9e35782ec..15f53bd04e 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -252,15 +252,21 @@ def selectFromFileDialog(fileName, waitForFile=False): else: fName = os.path.basename(os.path.abspath(fileName)) pName = os.path.dirname(os.path.abspath(fileName)) + os.sep - waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}") - pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}") - snooze(1) - replaceEditorContent(pathLine, pName) - clickButton(waitForObject("{text='Open' type='QPushButton'}")) - waitFor("str(pathLine.text)==''") - snooze(1) - replaceEditorContent(pathLine, fName) - clickButton(waitForObject("{text='Open' type='QPushButton'}")) + try: + waitForObject("{name='QFileDialog' type='QFileDialog' visible='1'}", 5000) + pathLine = waitForObject("{name='fileNameEdit' type='QLineEdit' visible='1'}") + snooze(1) + replaceEditorContent(pathLine, pName) + clickButton(waitForObject("{text='Open' type='QPushButton'}")) + waitFor("str(pathLine.text)==''") + snooze(1) + replaceEditorContent(pathLine, fName) + clickButton(waitForObject("{text='Open' type='QPushButton'}")) + except: + nativeType(pName + fName) + snooze(1) + nativeType("<Return>") + snooze(3) if waitForFile: fileCombo = waitForObject(":Qt Creator_FilenameQComboBox") if not waitFor("str(fileCombo.currentText) in fileName", 5000): |