diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-16 11:34:07 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-06-16 10:42:16 +0000 |
commit | 92a28473afb97ee50332f6fe81960c7241ca82d5 (patch) | |
tree | 4af2fde4a959d81c8f38976f90ec312ce270c102 /tests | |
parent | d5cde6f1b4f7a8a2cfd4a9dbdf63cd2e2502c000 (diff) |
Stabilize FilePicker QML autotests
Switch from timed wait to using tryCompare.
Task-number: QTBUG-53777
Change-Id: I845fb8ee7b84641bd23314794512960634423d54
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_filePicker.qml | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml index 02b2dd024..f9c50c4e8 100644 --- a/tests/auto/quick/qmltests/data/tst_filePicker.qml +++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml @@ -81,10 +81,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html") } function test_acceptMultipleFilesSelection() { @@ -96,10 +94,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test2.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html,test2.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html,test2.html") } function test_acceptDirectory() { @@ -110,10 +106,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "data") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "data") } function test_reject() { |