From 7534e8811c933e3d83113463d950841d0c173e1e Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 13 Aug 2015 16:59:39 +0300 Subject: [PATCH] SQUIHS test for issue #474 --- src/XGUI/XGUI_Workshop.cpp | 2 +- test.squish/suite_ISSUES_SALOME/objects.map | 4 +++ .../suite_ISSUES_SALOME/tst_474/test.py | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 test.squish/suite_ISSUES_SALOME/tst_474/test.py diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 5f6b0e9fb..59c061997 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1159,7 +1159,7 @@ bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theList, QMessageBox::StandardButton aRes = QMessageBox::warning( theParent, tr("Delete features"), QString(tr("Selected features are used in the following features: %1.\ -These features will be deleted.\n%2Would you like to continue?")).arg(aDirectNames) + These features will be deleted.\n%2Would you like to continue?")).arg(aDirectNames) .arg(aIndirectNames.isEmpty() ? QString() : QString("Also these features will be deleted: %1.\n").arg(aIndirectNames)), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); if (aRes != QMessageBox::Yes) diff --git a/test.squish/suite_ISSUES_SALOME/objects.map b/test.squish/suite_ISSUES_SALOME/objects.map index e1895baa8..71520ec62 100644 --- a/test.squish/suite_ISSUES_SALOME/objects.map +++ b/test.squish/suite_ISSUES_SALOME/objects.map @@ -2,6 +2,9 @@ :Activate module_LightApp_ModuleDlg {type='LightApp_ModuleDlg' unnamed='1' visible='1' windowTitle='Activate module'} :Close active study.Close w/o saving_QPushButton {text='Close w/o saving' type='QPushButton' unnamed='1' visible='1' window=':Close active study_SUIT_MessageBox'} :Close active study_SUIT_MessageBox {type='SUIT_MessageBox' unnamed='1' visible='1' windowTitle='Close active study'} +:Delete features.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':Delete features_QMessageBox'} +:Delete features._QLabel {name='qt_msgbox_label' type='QLabel' visible='1' window=':Delete features_QMessageBox'} +:Delete features_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Delete features'} :Exit.Ok_QPushButton {text='Ok' type='QPushButton' unnamed='1' visible='1' window=':Exit_SalomeApp_ExitDlg'} :Exit.Shutdown servers_QCheckBox {text='Shutdown servers' type='QCheckBox' unnamed='1' visible='1' window=':Exit_SalomeApp_ExitDlg'} :Exit_SalomeApp_ExitDlg {type='SalomeApp_ExitDlg' unnamed='1' visible='1' windowTitle='Exit'} @@ -18,6 +21,7 @@ :Point_QFrame {container=':SALOME*.Point_XGUI_PropertyPanel' type='QFrame' unnamed='1' visible='1'} :SALOME*.ConstructionPoint_QToolButton {container=':SALOME*.Construction_QtxToolBar' text='Point' type='QToolButton' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop'} :SALOME*.Construction_QtxToolBar {name='Construction' type='QtxToolBar' visible='1' window=':SALOME*_STD_TabDesktop' windowTitle='Construction'} +:SALOME*.New part_QToolButton {text='New part' type='QToolButton' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop'} :SALOME*.NewGeom_QToolButton {text='NewGeom' type='QToolButton' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop'} :SALOME*.Object browser_QDockWidget {type='QDockWidget' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop' windowTitle='Object browser'} :SALOME*.Parameter_QToolButton {text='Parameter' type='QToolButton' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop'} diff --git a/test.squish/suite_ISSUES_SALOME/tst_474/test.py b/test.squish/suite_ISSUES_SALOME/tst_474/test.py new file mode 100644 index 000000000..38ad1ce45 --- /dev/null +++ b/test.squish/suite_ISSUES_SALOME/tst_474/test.py @@ -0,0 +1,26 @@ +def main(): + source(findFile("scripts", "common.py")) + + startApplication("salome_run.sh") + + create_new_document() + + clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) + type(waitForObject(":Parameter_QLineEdit"), "aa") + type(waitForObject(":Parameter_ExpressionEditor"), "4") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + clickButton(waitForObject(":SALOME*.New part_QToolButton")) + + clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) + type(waitForObject(":Parameter_QLineEdit"), "bb") + type(waitForObject(":Parameter_ExpressionEditor"), "aa+1") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).aa = 4", 10, 10, 0) + activateItem(waitForObjectItem(":_QMenu", "Delete")) + waitFor("object.exists(':Delete features._QLabel')", 20000) + test.compare(str(findObject(":Delete features._QLabel").text), "Selected features are used in the following features: bb.These features will be deleted.\nWould you like to continue?") + clickButton(waitForObject(":Delete features.No_QPushButton")) + + close_application() -- 2.39.2