Squish: Be fuzzy when comparing snippet fetched from Pastebin.Com

Change-Id: If08b2b9136d55e2dddca6181c1075d845422a30b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2021-08-18 21:36:01 +02:00
committed by Christian Stenger
parent a1eb505fbd
commit f529051b58

View File

@@ -239,9 +239,16 @@ def main():
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton")) clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
continue continue
test.compare(filenameCombo.currentText, "%s: %s" % (protocol, pasteId), "Verify title of editor") test.compare(filenameCombo.currentText, "%s: %s" % (protocol, pasteId), "Verify title of editor")
if protocol in (NAME_DPCOM, NAME_PBCOM) and pastedText.endswith("\n"): if protocol in (NAME_PBCOM):
pastedText = pastedText[:-1] test.verify(abs(len(str(editor.plainText)) - len(pastedText)) < 2,
test.compare(editor.plainText, pastedText, "Verify that pasted and fetched texts are the same") "Verify that pasted and fetched texts have similar length")
test.compare(str(editor.plainText).rstrip(), pastedText.rstrip(),
"Verify that pasted and fetched texts have the same content")
else:
if protocol in (NAME_DPCOM) and pastedText.endswith("\n"):
pastedText = pastedText[:-1]
test.compare(editor.plainText, pastedText,
"Verify that pasted and fetched texts are the same")
if protocol == NAME_DPCOM: if protocol == NAME_DPCOM:
checkForMovedUrl() checkForMovedUrl()