From ac19c0f902c0addea4a6cb89cfcd38a5e86239f2 Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 13 Aug 2015 16:44:19 +0300 Subject: [PATCH] SQUISH test for issue #679 --- test.squish/suite_ISSUES_SALOME/objects.map | 10 ++++++- .../shared/scripts/common.py | 9 +++++++ .../suite_ISSUES_SALOME/tst_576/test.py | 13 ++++----- .../suite_ISSUES_SALOME/tst_679/test.py | 27 +++++++++++++++++++ 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 test.squish/suite_ISSUES_SALOME/shared/scripts/common.py create mode 100644 test.squish/suite_ISSUES_SALOME/tst_679/test.py diff --git a/test.squish/suite_ISSUES_SALOME/objects.map b/test.squish/suite_ISSUES_SALOME/objects.map index bd4b3185b..e1895baa8 100644 --- a/test.squish/suite_ISSUES_SALOME/objects.map +++ b/test.squish/suite_ISSUES_SALOME/objects.map @@ -6,17 +6,25 @@ :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'} :Object browser_XGUI_DataTree {container=':SALOME*.Object browser_QDockWidget' type='XGUI_DataTree' unnamed='1' visible='1'} -:Parameter.Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty._ExpressionEditor {aboveWidget=':Parameter.Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty._QLabel' container=':SALOME*.Parameter_XGUI_PropertyPanel' type='ExpressionEditor' unnamed='1' visible='1'} :Parameter.Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty._QLabel {container=':SALOME*.Parameter_XGUI_PropertyPanel' text='Attribute "expression" invalidated by "Parameters_ExpressionValidator" with error: Expression is empty.' type='QLabel' unnamed='1' visible='1'} :Parameter.property_panel_ok_QToolButton {container=':SALOME*.Parameter_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'} :Parameter_ExpressionEditor {container=':SALOME*.Parameter_XGUI_PropertyPanel' type='ExpressionEditor' unnamed='1' visible='1'} :Parameter_QLineEdit {container=':SALOME*.Parameter_XGUI_PropertyPanel' type='QLineEdit' unnamed='1' visible='1'} :Parameters (1).b = 3_QModelIndex {column='0' container=':Parameters (1)_QModelIndex' text='b = 3' type='QModelIndex'} :Parameters (1)_QModelIndex {column='0' container=':Object browser_XGUI_DataTree' text='Parameters (1)' type='QModelIndex'} +:Point.qt_spinbox_lineedit_QLineEdit {container=':SALOME*.Point_XGUI_PropertyPanel' name='qt_spinbox_lineedit' type='QLineEdit' visible='1'} +:Point.qt_spinbox_lineedit_QLineEdit_2 {container=':SALOME*.Point_XGUI_PropertyPanel' name='qt_spinbox_lineedit' occurrence='2' type='QLineEdit' visible='1'} +:Point.x_ModuleBase_ParamSpinBox {container=':SALOME*.Point_XGUI_PropertyPanel' name='x' type='ModuleBase_ParamSpinBox' visible='1'} +: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*.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'} :SALOME*.Parameter_XGUI_PropertyPanel {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':SALOME*_STD_TabDesktop' windowTitle='Parameter'} +:SALOME*.Point_XGUI_PropertyPanel {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':SALOME*_STD_TabDesktop' windowTitle='Point'} +:SALOME*.SketchPoint_QToolButton {container=':SALOME*.Sketch_QtxToolBar' text='Point' type='QToolButton' unnamed='1' visible='1' window=':SALOME*_STD_TabDesktop'} +:SALOME*.Sketch_QtxToolBar {name='Sketch' type='QtxToolBar' visible='1' window=':SALOME*_STD_TabDesktop' windowTitle='Sketch'} :SALOME*_STD_TabDesktop {type='STD_TabDesktop' unnamed='1' visible='1' windowTitle?='SALOME*'} :_QExpandingLineEdit {columnIndex='0' container=':Object browser_XGUI_DataTree' rowIndex='0' type='QExpandingLineEdit' unnamed='1' visible='1'} :_QMenu {type='QMenu' unnamed='1' visible='1'} diff --git a/test.squish/suite_ISSUES_SALOME/shared/scripts/common.py b/test.squish/suite_ISSUES_SALOME/shared/scripts/common.py new file mode 100644 index 000000000..071e7f990 --- /dev/null +++ b/test.squish/suite_ISSUES_SALOME/shared/scripts/common.py @@ -0,0 +1,9 @@ +def create_new_document(): + clickButton(waitForObject(":SALOME*.NewGeom_QToolButton")) + clickButton(waitForObject(":Activate module.New_QPushButton")) + +def close_application(): + sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop")) + clickButton(waitForObject(":Exit.Shutdown servers_QCheckBox")) + clickButton(waitForObject(":Exit.Ok_QPushButton")) + clickButton(waitForObject(":Close active study.Close w/o saving_QPushButton")) \ No newline at end of file diff --git a/test.squish/suite_ISSUES_SALOME/tst_576/test.py b/test.squish/suite_ISSUES_SALOME/tst_576/test.py index 22b1f8c33..6c7e47513 100644 --- a/test.squish/suite_ISSUES_SALOME/tst_576/test.py +++ b/test.squish/suite_ISSUES_SALOME/tst_576/test.py @@ -1,8 +1,9 @@ def main(): - startApplication("salome_run.sh") + source(findFile("scripts", "common.py")) - clickButton(waitForObject(":SALOME*.NewGeom_QToolButton")) - clickButton(waitForObject(":Activate module.New_QPushButton")) + startApplication("salome_run.sh") + + create_new_document() clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) type(waitForObject(":Parameter_QLineEdit"), "a") @@ -24,8 +25,4 @@ def main(): waitFor("object.exists(':Parameter_ExpressionEditor')", 20000) test.compare(str(findObject(":Parameter_ExpressionEditor").plainText), "3") - sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop")) - clickButton(waitForObject(":Exit.Shutdown servers_QCheckBox")) - clickButton(waitForObject(":Exit.Ok_QPushButton")) - clickButton(waitForObject(":Close active study.Close w/o saving_QPushButton")) - + close_application() diff --git a/test.squish/suite_ISSUES_SALOME/tst_679/test.py b/test.squish/suite_ISSUES_SALOME/tst_679/test.py new file mode 100644 index 000000000..0a0a95b41 --- /dev/null +++ b/test.squish/suite_ISSUES_SALOME/tst_679/test.py @@ -0,0 +1,27 @@ +def main(): + source(findFile("scripts", "common.py")) + + startApplication("salome_run.sh") + + create_new_document() + + clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) + type(waitForObject(":Parameter_QLineEdit"), "a") + type(waitForObject(":Parameter_ExpressionEditor"), "3") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + clickButton(waitForObject(":SALOME*.ConstructionPoint_QToolButton")) + type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "") + type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "a") + waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000) + test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate") + + type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "") + type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "b") + + waitFor("object.exists(':Point_QFrame')", 20000) + test.compare(str(findObject(":Point_QFrame").toolTip), "Attribute \"x\" invalidated by \"Model_AttributeValidator\" with error: name 'b' is not defined") + waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000) + test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate\nErrors:\nAttribute \"x\" invalidated by \"Model_AttributeValidator\" with error: name 'b' is not defined") + + close_application() -- 2.39.2