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 <christian.stenger@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2018-11-16 11:03:27 +01:00
committed by Robert Loehning
parent d51ddbb8f0
commit 39510f5382

View File

@@ -25,6 +25,13 @@
source("../../shared/qtcreator.py") source("../../shared/qtcreator.py")
import time
def delayedType(editor, text):
for c in text:
type(editor, c)
time.sleep(0.1)
# entry of test # entry of test
def main(): def main():
for useClang in [False, True]: 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. # Focus "class derived from QObject" in the list and press Tab or Enter to complete the code.
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton) mouseClick(editorWidget, 5, 5, 0, Qt.LeftButton)
jumpToFirstLine(editorWidget)
type(editorWidget, "<Return>") type(editorWidget, "<Return>")
type(editorWidget, "<Up>") type(editorWidget, "<Up>")
type(editorWidget, "class") delayedType(editorWidget, "class")
if useClang and JIRA.isBugStillOpen(18769):
snooze(4)
if platform.system() == "Darwin":
type(editorWidget, "<Meta+Space>")
else:
type(editorWidget, "<Ctrl+Space>")
listView = waitForObject(":popupFrame_Proposal_QListView") listView = waitForObject(":popupFrame_Proposal_QListView")
shownProposals = dumpItems(listView.model()) shownProposals = dumpItems(listView.model())
usedProposal = "class derived from QObject" usedProposal = "class derived from QObject"