forked from qt-creator/qt-creator
Squish: Drop testing of pastebin.ca
Change-Id: Ideab89362bb839f27f10234d13d4cfa92b1beba6 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -35,7 +35,6 @@ def __platformToBeRunToday__():
|
|||||||
skipPastingToPastebinCom = platform.system() not in __platformToBeRunToday__()
|
skipPastingToPastebinCom = platform.system() not in __platformToBeRunToday__()
|
||||||
|
|
||||||
NAME_KDE = "Paste.KDE.Org"
|
NAME_KDE = "Paste.KDE.Org"
|
||||||
NAME_PBCA = "Pastebin.Ca"
|
|
||||||
NAME_PBCOM = "Pastebin.Com"
|
NAME_PBCOM = "Pastebin.Com"
|
||||||
NAME_PCXYZ = "Pastecode.Xyz"
|
NAME_PCXYZ = "Pastecode.Xyz"
|
||||||
|
|
||||||
@@ -134,16 +133,13 @@ def fetchSnippet(protocol, description, pasteId, skippedPasting):
|
|||||||
closeHTTPStatusAndPasterDialog(protocol, ':PasteSelectDialog_CodePaster::PasteSelectDialog')
|
closeHTTPStatusAndPasterDialog(protocol, ':PasteSelectDialog_CodePaster::PasteSelectDialog')
|
||||||
return -1
|
return -1
|
||||||
waitFor("pasteModel.rowCount() > 1", 20000)
|
waitFor("pasteModel.rowCount() > 1", 20000)
|
||||||
if (not skippedPasting and not protocol == NAME_PBCA
|
if (not skippedPasting and not any(map(lambda str:pasteId in str, dumpItems(pasteModel)))):
|
||||||
and not any(map(lambda str:pasteId in str, dumpItems(pasteModel)))):
|
|
||||||
test.warning("Fetching too fast for server of %s - waiting 3s and trying to refresh." % protocol)
|
test.warning("Fetching too fast for server of %s - waiting 3s and trying to refresh." % protocol)
|
||||||
snooze(3)
|
snooze(3)
|
||||||
clickButton("{text='Refresh' type='QPushButton' unnamed='1' visible='1' "
|
clickButton("{text='Refresh' type='QPushButton' unnamed='1' visible='1' "
|
||||||
"window=':PasteSelectDialog_CodePaster::PasteSelectDialog'}")
|
"window=':PasteSelectDialog_CodePaster::PasteSelectDialog'}")
|
||||||
waitFor("pasteModel.rowCount() == 1", 1000)
|
waitFor("pasteModel.rowCount() == 1", 1000)
|
||||||
waitFor("pasteModel.rowCount() > 1", 20000)
|
waitFor("pasteModel.rowCount() > 1", 20000)
|
||||||
if protocol == NAME_PBCA:
|
|
||||||
description = description[:32]
|
|
||||||
if pasteId == -1:
|
if pasteId == -1:
|
||||||
try:
|
try:
|
||||||
pasteLine = filter(lambda str:description in str, dumpItems(pasteModel))[0]
|
pasteLine = filter(lambda str:description in str, dumpItems(pasteModel))[0]
|
||||||
@@ -155,13 +151,11 @@ def fetchSnippet(protocol, description, pasteId, skippedPasting):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
pasteLine = filter(lambda str:pasteId in str, dumpItems(pasteModel))[0]
|
pasteLine = filter(lambda str:pasteId in str, dumpItems(pasteModel))[0]
|
||||||
if protocol in (NAME_PBCA, NAME_PBCOM):
|
if protocol == NAME_PBCOM:
|
||||||
test.verify(description in pasteLine,
|
test.verify(description in pasteLine,
|
||||||
"Verify that line in list of pastes contains the description")
|
"Verify that line in list of pastes contains the description")
|
||||||
except:
|
except:
|
||||||
if protocol == NAME_PBCA:
|
if not skippedPasting:
|
||||||
test.xfail("%s does not list the pasted snippet on time" % NAME_PBCA)
|
|
||||||
elif not skippedPasting:
|
|
||||||
test.fail("Could not find id '%s' in list of pastes from %s" % (pasteId, protocol))
|
test.fail("Could not find id '%s' in list of pastes from %s" % (pasteId, protocol))
|
||||||
foundSnippet = False
|
foundSnippet = False
|
||||||
replaceEditorContent(waitForObject(":PasteSelectDialog.pasteEdit_QLineEdit"), pasteId)
|
replaceEditorContent(waitForObject(":PasteSelectDialog.pasteEdit_QLineEdit"), pasteId)
|
||||||
@@ -176,7 +170,7 @@ def main():
|
|||||||
startQC()
|
startQC()
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
protocolsToTest = [NAME_KDE, NAME_PBCA, NAME_PBCOM, NAME_PCXYZ]
|
protocolsToTest = [NAME_KDE, NAME_PBCOM, NAME_PCXYZ]
|
||||||
sourceFile = os.path.join(os.getcwd(), "testdata", "main.cpp")
|
sourceFile = os.path.join(os.getcwd(), "testdata", "main.cpp")
|
||||||
# make sure General Messages is open
|
# make sure General Messages is open
|
||||||
openGeneralMessages()
|
openGeneralMessages()
|
||||||
|
Reference in New Issue
Block a user