From: spo Date: Thu, 15 Oct 2015 13:40:09 +0000 (+0300) Subject: Add SQUISH tests X-Git-Tag: V_2.0.0_alfa1~89 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0dea68c1a576f9d6ec93571fd717e484bc414236;p=modules%2Fshaper.git Add SQUISH tests --- diff --git a/test.squish/suite_ERROR_NOTIFICATION/envvars b/test.squish/suite_ERROR_NOTIFICATION/envvars new file mode 100644 index 000000000..e69de29bb diff --git a/test.squish/suite_ERROR_NOTIFICATION/shared/scripts/common.py b/test.squish/suite_ERROR_NOTIFICATION/shared/scripts/common.py new file mode 120000 index 000000000..c9dd6a8ec --- /dev/null +++ b/test.squish/suite_ERROR_NOTIFICATION/shared/scripts/common.py @@ -0,0 +1 @@ +../../../shared/scripts/common.py \ No newline at end of file diff --git a/test.squish/suite_ERROR_NOTIFICATION/suite.conf b/test.squish/suite_ERROR_NOTIFICATION/suite.conf new file mode 100644 index 000000000..bae54b56b --- /dev/null +++ b/test.squish/suite_ERROR_NOTIFICATION/suite.conf @@ -0,0 +1,10 @@ +AUT=salome_run.sh +CWD= +ENVVARS=envvars +HOOK_SUB_PROCESSES=true +IMPLICITAUTSTART=0 +LANGUAGE=Python +OBJECTMAP=../objects_salome.map +TEST_CASES=tst_BASE +VERSION=3 +WRAPPERS=Qt diff --git a/test.squish/suite_ERROR_NOTIFICATION/tst_679/test.py b/test.squish/suite_ERROR_NOTIFICATION/tst_679/test.py new file mode 100644 index 000000000..b186d752a --- /dev/null +++ b/test.squish/suite_ERROR_NOTIFICATION/tst_679/test.py @@ -0,0 +1,31 @@ +#[tested functionality] 1. Add parameter 2. Use wrong parameter name 3. Error notification in header 3. Error notification in widget + +def main(): + source(findFile("scripts", "common.py")) + + startApplication("salome_run.sh") + + activate_newgeom() + + 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), "ModelAPI_StateInvalidArgument") + + waitFor("object.exists(':Point.x_ModuleBase_ParamSpinBox')", 20000) + test.compare(str(findObject(":Point.x_ModuleBase_ParamSpinBox").toolTip), "X coordinate\nErrors:\nx - Model_AttributeValidator: name 'b' is not defined") + + close_application() diff --git a/test.squish/suite_FEATURE_PARAMETERS/envvars b/test.squish/suite_FEATURE_PARAMETERS/envvars new file mode 100644 index 000000000..e69de29bb diff --git a/test.squish/suite_FEATURE_PARAMETERS/shared/scripts/common.py b/test.squish/suite_FEATURE_PARAMETERS/shared/scripts/common.py new file mode 120000 index 000000000..c9dd6a8ec --- /dev/null +++ b/test.squish/suite_FEATURE_PARAMETERS/shared/scripts/common.py @@ -0,0 +1 @@ +../../../shared/scripts/common.py \ No newline at end of file diff --git a/test.squish/suite_FEATURE_PARAMETERS/suite.conf b/test.squish/suite_FEATURE_PARAMETERS/suite.conf new file mode 100644 index 000000000..bae54b56b --- /dev/null +++ b/test.squish/suite_FEATURE_PARAMETERS/suite.conf @@ -0,0 +1,10 @@ +AUT=salome_run.sh +CWD= +ENVVARS=envvars +HOOK_SUB_PROCESSES=true +IMPLICITAUTSTART=0 +LANGUAGE=Python +OBJECTMAP=../objects_salome.map +TEST_CASES=tst_BASE +VERSION=3 +WRAPPERS=Qt diff --git a/test.squish/suite_FEATURE_PARAMETERS/tst_474/test.py b/test.squish/suite_FEATURE_PARAMETERS/tst_474/test.py new file mode 100644 index 000000000..181b7f495 --- /dev/null +++ b/test.squish/suite_FEATURE_PARAMETERS/tst_474/test.py @@ -0,0 +1,49 @@ +#[tested functionality] 1. Add parameter 2. Calculate parameter 3. Delete parameter + +def main(): + source(findFile("scripts", "common.py")) + + startApplication("salome_run.sh") + + activate_newgeom() + + #[step] Create parameter 'aa = 4' + activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part")) + activateItem(waitForObjectItem(":Part_QMenu", "Parameter")) + type(waitForObject(":Parameter_QLineEdit"), "aa") + type(waitForObject(":Parameter_ExpressionEditor"), "4") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + # check the new parameter + waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).aa = 4") + + clickButton(waitForObject(":SALOME*.New part_QToolButton")) + + activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part")) + activateItem(waitForObjectItem(":Part_QMenu", "Parameter")) + type(waitForObject(":Parameter_QLineEdit"), "bb") + type(waitForObject(":Parameter_ExpressionEditor"), "aa+1") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + # check the new parameter + waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (1).bb = 5") + + openContextMenu(waitForObject(":Object browser_QLineEdit"), 10, 10, 0) + activateItem(waitForObjectItem(":_QMenu", "Activate")) + + openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).aa = 4", 10, 10, 0) + activateItem(waitForObjectItem(":_QMenu", "Delete")) + waitFor("object.exists(':Delete features._QLabel')", 20000) + + an_expected = """Selected parameters are used in the following features: bb. +These features will be deleted. +Or parameters could be replaced by their values. +Would you like to continue?""" + test.compare(str(findObject(":Delete features._QLabel").text), an_expected) + clickButton(waitForObject(":Delete features.No_QPushButton")) + + # nothing is deleted + waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).aa = 4") + waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (1).bb = 5") + + close_application() diff --git a/test.squish/suite_FEATURE_PARAMETERS/tst_576/test.py b/test.squish/suite_FEATURE_PARAMETERS/tst_576/test.py new file mode 100644 index 000000000..6d375a471 --- /dev/null +++ b/test.squish/suite_FEATURE_PARAMETERS/tst_576/test.py @@ -0,0 +1,29 @@ +#[tested functionality] 1. Add parameter 2. Rename parameter + +def main(): + source(findFile("scripts", "common.py")) + + startApplication("salome_run.sh") + + activate_newgeom() + + clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) + type(waitForObject(":Parameter_QLineEdit"), "a") + type(waitForObject(":Parameter_ExpressionEditor"), "3") + clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) + + openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).a = 3", 10, 10, 0) + activateItem(waitForObjectItem(":_QMenu", "Rename")) + type(waitForObject(":_QExpandingLineEdit"), "b") + type(waitForObject(":_QExpandingLineEdit"), "") + + test.compare(waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).b = 3").text, "b = 3") + + openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).b = 3", 111, 5, 0) + activateItem(waitForObjectItem(":_QMenu", "Edit...")) + waitFor("object.exists(':Parameter_QLineEdit')", 20000) + test.compare(str(findObject(":Parameter_QLineEdit").text), "b") + waitFor("object.exists(':Parameter_ExpressionEditor')", 20000) + test.compare(str(findObject(":Parameter_ExpressionEditor").plainText), "3") + + close_application() diff --git a/test.squish/suite_ISSUES_SALOME/tst_474/test.py b/test.squish/suite_ISSUES_SALOME/tst_474/test.py deleted file mode 100644 index 9cea5a865..000000000 --- a/test.squish/suite_ISSUES_SALOME/tst_474/test.py +++ /dev/null @@ -1,47 +0,0 @@ -def main(): - source(findFile("scripts", "common.py")) - - startApplication("salome_run.sh") - - activate_newgeom() - - #[step] Create parameter 'aa = 4' - activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part")) - activateItem(waitForObjectItem(":Part_QMenu", "Parameter")) - type(waitForObject(":Parameter_QLineEdit"), "aa") - type(waitForObject(":Parameter_ExpressionEditor"), "4") - clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) - - # check the new parameter - waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).aa = 4") - - clickButton(waitForObject(":SALOME*.New part_QToolButton")) - - activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part")) - activateItem(waitForObjectItem(":Part_QMenu", "Parameter")) - type(waitForObject(":Parameter_QLineEdit"), "bb") - type(waitForObject(":Parameter_ExpressionEditor"), "aa+1") - clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) - - # check the new parameter - waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (1).bb = 5") - - openContextMenu(waitForObject(":Object browser_QLineEdit"), 10, 10, 0) - activateItem(waitForObjectItem(":_QMenu", "Activate")) - - openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).aa = 4", 10, 10, 0) - activateItem(waitForObjectItem(":_QMenu", "Delete")) - waitFor("object.exists(':Delete features._QLabel')", 20000) - - an_expected = """Selected parameters are used in the following features: bb. -These features will be deleted. -Or parameters could be replaced by their values. -Would you like to continue?""" - test.compare(str(findObject(":Delete features._QLabel").text), an_expected) - clickButton(waitForObject(":Delete features.No_QPushButton")) - - # nothing is deleted - waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).aa = 4") - waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Parameters (1).bb = 5") - - close_application() diff --git a/test.squish/suite_ISSUES_SALOME/tst_576/test.py b/test.squish/suite_ISSUES_SALOME/tst_576/test.py deleted file mode 100644 index 6ba9e5ef9..000000000 --- a/test.squish/suite_ISSUES_SALOME/tst_576/test.py +++ /dev/null @@ -1,27 +0,0 @@ -def main(): - source(findFile("scripts", "common.py")) - - startApplication("salome_run.sh") - - activate_newgeom() - - clickButton(waitForObject(":SALOME*.Parameter_QToolButton")) - type(waitForObject(":Parameter_QLineEdit"), "a") - type(waitForObject(":Parameter_ExpressionEditor"), "3") - clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton")) - - openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).a = 3", 10, 10, 0) - activateItem(waitForObjectItem(":_QMenu", "Rename")) - type(waitForObject(":_QExpandingLineEdit"), "b") - type(waitForObject(":_QExpandingLineEdit"), "") - - test.compare(waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).b = 3").text, "b = 3") - - openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).b = 3", 111, 5, 0) - activateItem(waitForObjectItem(":_QMenu", "Edit...")) - waitFor("object.exists(':Parameter_QLineEdit')", 20000) - test.compare(str(findObject(":Parameter_QLineEdit").text), "b") - waitFor("object.exists(':Parameter_ExpressionEditor')", 20000) - test.compare(str(findObject(":Parameter_ExpressionEditor").plainText), "3") - - close_application() diff --git a/test.squish/suite_ISSUES_SALOME/tst_679/test.py b/test.squish/suite_ISSUES_SALOME/tst_679/test.py deleted file mode 100644 index 978caa9a2..000000000 --- a/test.squish/suite_ISSUES_SALOME/tst_679/test.py +++ /dev/null @@ -1,28 +0,0 @@ -def main(): - source(findFile("scripts", "common.py")) - - startApplication("salome_run.sh") - - activate_newgeom() - - 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), "x - Model_AttributeValidator: 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:\nx - Model_AttributeValidator: name 'b' is not defined") - - close_application() diff --git a/test.squish/suite_STANDALONE/tst_c/test.py b/test.squish/suite_STANDALONE/tst_c/test.py index ebab2b407..818f97ff7 100644 --- a/test.squish/suite_STANDALONE/tst_c/test.py +++ b/test.squish/suite_STANDALONE/tst_c/test.py @@ -15,16 +15,22 @@ def main(): mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), 531, 537, 0, Qt.LeftButton) mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), 241, 169, 0, Qt.LeftButton) clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton")) - + + test.vp("VP_SKETCH") + clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features") -# mouseDrag(waitForObject(":Features_QScrollArea"), 31, 1, -2, -2, 1, Qt.LeftButton) clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button")) mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), 216, 270, 0, Qt.LeftButton) clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton")) + test.vp("VP_EXTRUSION") + clickButton(waitForObject(":Extrusion.ExtrusionFuse_AppElements_Button")) mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), 290, 316, 0, Qt.LeftButton) + clickButton(waitForObject(":OpenParts*.Fit all_QToolButton")) + test.vp("VP_EXTRUSIONFUSE") + mouseClick(waitForObject(":Sketch.Basic_AppElements_MenuGroupPanel"), 143, 56, 0, Qt.LeftButton) clickButton(waitForObject(":Basic.Circle_AppElements_Button")) mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), 259, 248, 0, Qt.LeftButton) diff --git a/test_squish.sh b/test_squish.sh index 4a3b2d4cf..72db2fc1c 100755 --- a/test_squish.sh +++ b/test_squish.sh @@ -56,13 +56,19 @@ TESTCASES="${TESTCASES} --testcase tst_DISTANCE" TESTCASES="${TESTCASES} --testcase tst_RADIUS" squishrunner-run suite_STANDALONE "${TESTCASES}" +TESTCASES="" +TESTCASES="${TESTCASES} --testcase tst_679" +squishrunner-run suite_ERROR_NOTIFICATION "${TESTCASES}" + TESTCASES="" TESTCASES="${TESTCASES} --testcase tst_474" +TESTCASES="${TESTCASES} --testcase tst_576" +squishrunner-run suite_FEATURE_PARAMETERS "${TESTCASES}" + +TESTCASES="" #TESTCASES="${TESTCASES} --testcase tst_532" -#TESTCASES="${TESTCASES} --testcase tst_576" -#TESTCASES="${TESTCASES} --testcase tst_679" #TESTCASES="${TESTCASES} --testcase tst_903" -squishrunner-run suite_ISSUES_SALOME "${TESTCASES}" +#squishrunner-run suite_ISSUES_SALOME "${TESTCASES}" TESTCASES="" #TESTCASES="${TESTCASES} --testcase tst_boolean_001"