From 4f1e9aa485de7f2646ed100a0404dd321d352d74 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 13 Jan 2015 10:42:07 +0100 Subject: [PATCH] Squish: Re-enable testing of Pastebin.Ca code pasting Change-Id: I67f8d9705cd7b5063322e53fb3d745d0314b9fc0 Reviewed-by: Robert Loehning --- tests/system/suite_tools/tst_codepasting/test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_tools/tst_codepasting/test.py b/tests/system/suite_tools/tst_codepasting/test.py index 6aefb5ee7a8..dde459b1b9c 100644 --- a/tests/system/suite_tools/tst_codepasting/test.py +++ b/tests/system/suite_tools/tst_codepasting/test.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. @@ -41,7 +41,7 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - protocolsToTest = ["Paste.KDE.Org"]#, "Pastebin.Ca"] + protocolsToTest = ["Paste.KDE.Org", "Pastebin.Ca"] # Be careful with Pastebin.Com, there are only 10 pastes per 24h # for all machines using the same IP-address like you. # protocolsToTest += ["Pastebin.Com"] @@ -104,6 +104,14 @@ def main(): selectFromCombo(":CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox", protocol) pasteModel = waitForObject(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget").model() waitFor("pasteModel.rowCount() > 1", 20000) + if (pasteId not in dumpItems(pasteModel)): + test.warning("Fetching too fast for server of %s - waiting 3s and trying to refresh." + % protocol) + snooze(3) + clickButton("{text='Refresh' type='QPushButton' unnamed='1' visible='1' " + "window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}") + waitFor("pasteModel.rowCount() == 1", 1000) + waitFor("pasteModel.rowCount() > 1", 20000) if protocol == 'Pastebin.Ca': description = description[:32] if pasteId == -1: