From 39510f5382b6790a2e122ca101bac05141aaeb91 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 16 Nov 2018 11:03:27 +0100 Subject: [PATCH] Squish: Fix tst_CSUP02 Squish (and therefore the test) "is typing" too fast which breaks some assumption and the (nowadays?) normal behavior of the CppEditor. Fix this by introducing a delayedType() function to be more realistic when doing this test. Also removes a workaround for QTCREATORBUG-18769 as this seems no more valid at all. Task-number: QTCREATORBUG-18679 Change-Id: Ie43554c5b198bf3dc4a26ad12c8368f43bfd21af Reviewed-by: Christian Stenger Reviewed-by: Robert Loehning --- tests/system/suite_CSUP/tst_CSUP02/test.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP02/test.py b/tests/system/suite_CSUP/tst_CSUP02/test.py index 147f1b09350..881a7e709e3 100644 --- a/tests/system/suite_CSUP/tst_CSUP02/test.py +++ b/tests/system/suite_CSUP/tst_CSUP02/test.py @@ -25,6 +25,13 @@ source("../../shared/qtcreator.py") +import time + +def delayedType(editor, text): + for c in text: + type(editor, c) + time.sleep(0.1) + # entry of test def main(): for useClang in [False, True]: @@ -46,15 +53,10 @@ def main(): # Focus "class derived from QObject" in the list and press Tab or Enter to complete the code. editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton) + jumpToFirstLine(editorWidget) type(editorWidget, "") type(editorWidget, "") - type(editorWidget, "class") - if useClang and JIRA.isBugStillOpen(18769): - snooze(4) - if platform.system() == "Darwin": - type(editorWidget, "") - else: - type(editorWidget, "") + delayedType(editorWidget, "class") listView = waitForObject(":popupFrame_Proposal_QListView") shownProposals = dumpItems(listView.model()) usedProposal = "class derived from QObject"