diff options
author | Robert Loehning <robert.loehning@qt.io> | 2018-04-10 14:21:59 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2018-04-13 11:44:42 +0000 |
commit | 6a62717271ed651f1c1467647499992d1104ca37 (patch) | |
tree | 037b360f6f0b447a3925995e429d888697ec3071 /tests | |
parent | 33d48093a8d32f2a99c41dc1a35f9da7922b3b7f (diff) |
Squish: Update tst_designer_goto_slot for Qt>=5.10
Change-Id: I29b3788f2daed5ca27069cc8ab9d972bdcee3c02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/objects.map | 1 | ||||
-rw-r--r-- | tests/system/suite_tools/tst_designer_goto_slot/test.py | 19 | ||||
-rw-r--r-- | tests/system/suite_tools/tst_designer_goto_slot/testdata/connections.tsv | 8 |
3 files changed, 19 insertions, 9 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map index 388424259b..fce477feb6 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -192,6 +192,7 @@ :Select a Git Commit.detailsText_QPlainTextEdit {name='detailsText' type='QPlainTextEdit' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} :Select a Git Commit.workingDirectoryEdit_QLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':Select a Git Commit_Git::Internal::ChangeSelectionDialog'} :Select a Git Commit_Git::Internal::ChangeSelectionDialog {name='Git__Internal__ChangeSelectionDialog' type='Git::Internal::ChangeSelectionDialog' visible='1' windowTitle='Select a Git Commit'} +:Select signal.signalList_QTreeView {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeView' visible='1'} :Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'} :Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} :Send to Codepaster.Description:_QLabel {name='descriptionLabel' text='Description:' type='QLabel' visible='1' window=':Send to Codepaster_CodePaster::PasteView'} diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py index 56200fa3fd..18aa5730b1 100644 --- a/tests/system/suite_tools/tst_designer_goto_slot/test.py +++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py @@ -39,7 +39,8 @@ def main(): ":FormEditorStack_qdesigner_internal::FormWindow", 20, widgets[current], Qt.CopyAction) connections = [] for record in testData.dataset("connections.tsv"): - connections.append([testData.field(record, col) for col in ["widget", "signal", "slot"]]) + connections.append([testData.field(record, col) for col in ["widget", "baseclass", + "signal", "slot"]]) for con in connections: selectFromLocator("mainwindow.ui") openContextMenu(waitForObject(con[0]), 5, 5, 0) @@ -49,13 +50,21 @@ def main(): waitFor("macHackActivateContextMenuItem('Go to slot...', con[0])", 6000) else: activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot...")) - waitForObjectItem(":Select signal.signalList_QTreeWidget", con[1]) - clickItem(":Select signal.signalList_QTreeWidget", con[1], 5, 5, 0, Qt.LeftButton) + try: + # Creator built with Qt <= 5.9 + signalWidgetObject = waitForObject(":Select signal.signalList_QTreeWidget", 5000) + signalName = con[2] + except: + # Creator built with Qt >= 5.10 + signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView") + signalName = con[1] + "." + con[2] + waitForObjectItem(signalWidgetObject, signalName) + clickItem(signalWidgetObject, signalName, 5, 5, 0, Qt.LeftButton) clickButton(waitForObject(":Go to slot.OK_QPushButton")) editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") type(editor, "<Up>") type(editor, "<Up>") - test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[2]', 1000), - 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[2])) + test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000), + 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3])) invokeMenuItem("File", "Save All") invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_tools/tst_designer_goto_slot/testdata/connections.tsv b/tests/system/suite_tools/tst_designer_goto_slot/testdata/connections.tsv index e222ef4544..db3dc814d6 100644 --- a/tests/system/suite_tools/tst_designer_goto_slot/testdata/connections.tsv +++ b/tests/system/suite_tools/tst_designer_goto_slot/testdata/connections.tsv @@ -1,4 +1,4 @@ -"widget" "signal" "slot" -":FormEditorStack.PushButton_QPushButton" "clicked()" "void MainWindow::on_pushButton_clicked()" -":FormEditorStack.CheckBox_QCheckBox" "toggled(bool)" "void MainWindow::on_checkBox_toggled(bool checked)" -":FormEditorStack.centralWidget_QDesignerWidget" "destroyed()" "void MainWindow::on_MainWindow_destroyed()" +"widget" "baseclass" "signal" "slot" +":FormEditorStack.PushButton_QPushButton" "QAbstractButton" "clicked()" "void MainWindow::on_pushButton_clicked()" +":FormEditorStack.CheckBox_QCheckBox" "QAbstractButton" "toggled(bool)" "void MainWindow::on_checkBox_toggled(bool checked)" +":FormEditorStack.centralWidget_QDesignerWidget" "QObject" "destroyed()" "void MainWindow::on_MainWindow_destroyed()" |