From: Eugeny SAVCHENKO Date: Tue, 11 Aug 2015 08:41:19 +0000 (+0300) Subject: Add test for radius X-Git-Tag: V_1.4.0_beta4~408 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=18630b249e23b861ff8891f390d67eeb161f3bed;p=modules%2Fshaper.git Add test for radius --- diff --git a/test.squish/objects.map b/test.squish/objects.map index 393728813..e30c3ccc0 100644 --- a/test.squish/objects.map +++ b/test.squish/objects.map @@ -1,3 +1,5 @@ +:Application errors.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Application errors_XGUI_ErrorDialog'} +:Application errors_XGUI_ErrorDialog {type='XGUI_ErrorDialog' unnamed='1' visible='1' windowTitle='Application errors'} :Basic.Circle_AppElements_Button {container=':Sketch.Basic_AppElements_MenuGroupPanel' text='Circle' type='AppElements_Button' unnamed='1' visible='1'} :Basic.Line_AppElements_Button {container=':Sketch.Basic_AppElements_MenuGroupPanel' text='Line' type='AppElements_Button' unnamed='1' visible='1'} :Basic.Point_AppElements_Button {container=':Sketch.Basic_AppElements_MenuGroupPanel' text='Point' type='AppElements_Button' unnamed='1' visible='1'} @@ -11,6 +13,7 @@ :Circle.property_panel_ok_QToolButton {container=':OpenParts*.Circle_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'} :Circle.qt_spinbox_lineedit_QLineEdit {container=':OpenParts*.Circle_XGUI_PropertyPanel' name='qt_spinbox_lineedit' occurrence='3' type='QLineEdit' visible='1'} :Constraints.Distance_AppElements_Button {container=':Sketch.Constraints_AppElements_MenuGroupPanel' text='Distance' type='AppElements_Button' unnamed='1' visible='1'} +:Constraints.Radius_AppElements_Button {container=':Sketch.Constraints_AppElements_MenuGroupPanel' text='Radius' type='AppElements_Button' unnamed='1' visible='1'} :Delete features.Label_QLabel {name='qt_msgbox_label' type='QLabel' visible='1' window=':Delete features_QMessageBox'} :Delete features.Yes_QPushButton {text='Yes' type='QPushButton' unnamed='1' visible='1' window=':Delete features_QMessageBox'} :Delete features_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Delete features'} @@ -63,6 +66,8 @@ :Point.property_panel_ok_QToolButton {container=':OpenParts*.Point_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'} :Point.qt_spinbox_lineedit_QLineEdit {container=':Point.Point_QGroupBox' name='qt_spinbox_lineedit' type='QLineEdit' visible='1'} :Point.qt_spinbox_lineedit_QLineEdit_2 {container=':Point.Point_QGroupBox' name='qt_spinbox_lineedit' occurrence='2' type='QLineEdit' visible='1'} +:Save current file.Discard_QPushButton {text='Discard' type='QPushButton' unnamed='1' visible='1' window=':Save current file_QMessageBox'} +:Save current file_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Save current file'} :Sketch.Basic_AppElements_MenuGroupPanel {container=':qt_tabwidget_stackedwidget.Sketch_AppElements_Workbench' name='Basic' type='AppElements_MenuGroupPanel' visible='1'} :Sketch.Constraints_AppElements_MenuGroupPanel {container=':qt_tabwidget_stackedwidget.Sketch_AppElements_Workbench' name='Constraints' type='AppElements_MenuGroupPanel' visible='1'} :Sketch.Ok_QToolButton {container=':Sketch.Basic_AppElements_MenuGroupPanel' occurrence='6' type='QToolButton' unnamed='1' visible='1'} diff --git a/test.squish/suite_ISSUES/shared/scripts/common.py b/test.squish/suite_ISSUES/shared/scripts/common.py index 61a9e2986..05d6f93b8 100644 --- a/test.squish/suite_ISSUES/shared/scripts/common.py +++ b/test.squish/suite_ISSUES/shared/scripts/common.py @@ -57,6 +57,14 @@ def circle_create(x, y, radius): type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius) clickButton(waitForObject(":Circle.property_panel_ok_QToolButton")) + +def circle_create_in_view(point_1, point_2): + clickButton(waitForObject(":Basic.Circle_AppElements_Button")) + + mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton) + mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton) + + clickButton(waitForObject(":Basic.Circle_AppElements_Button")) def distance_create(point_1, point_2, annotaion_point, distance): clickButton(waitForObject(":Constraints.Distance_AppElements_Button")) @@ -71,6 +79,17 @@ def distance_create(point_1, point_2, annotaion_point, distance): clickButton(waitForObject(":Constraints.Distance_AppElements_Button")) +def radius_create(point_1, point_2, radius): + clickButton(waitForObject(":Constraints.Radius_AppElements_Button")) + + mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton) + mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton) + type(waitForObject(":_ModuleBase_ParamSpinBox"), "") + type(waitForObject(":_ModuleBase_ParamSpinBox"), radius) + type(waitForObject(":_ModuleBase_ParamSpinBox"), "") + + clickButton(waitForObject(":Constraints.Radius_AppElements_Button")) + def extrusion_feature(points, to_size): clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features") clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button")) diff --git a/test.squish/suite_ISSUES/tst_RADIUS/test.py b/test.squish/suite_ISSUES/tst_RADIUS/test.py new file mode 100644 index 000000000..01c702ccb --- /dev/null +++ b/test.squish/suite_ISSUES/tst_RADIUS/test.py @@ -0,0 +1,21 @@ +def sketch(): + circle_border = (229, 290) + circle_create_in_view((334, 237), circle_border) + radius_create(circle_border, (148, 97), 150) + + # check + circle_border = (392, 179) + mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), circle_border[0], circle_border[1], 0, Qt.LeftButton) + waitFor("object.exists(':Circle.CircleRadius_ModuleBase_ParamSpinBox')", 20000) + test.compare(str(findObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox").text), "150") + +def main(): + source(findFile("scripts", "common.py")) + + startApplication("GeomApp") + + point = (446, 297) # one of the construction planes + sketch_create(point, lambda: sketch()) + + sendEvent("QCloseEvent", waitForObject(":OpenParts*_AppElements_MainWindow")) + clickButton(waitForObject(":Save current file.Discard_QPushButton"))