]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add test for radius
authorEugeny SAVCHENKO <eso@squeezex2.nnov.opencascade.com>
Tue, 11 Aug 2015 08:41:19 +0000 (11:41 +0300)
committerEugeny SAVCHENKO <eso@squeezex2.nnov.opencascade.com>
Tue, 11 Aug 2015 08:41:19 +0000 (11:41 +0300)
test.squish/objects.map
test.squish/suite_ISSUES/shared/scripts/common.py
test.squish/suite_ISSUES/tst_RADIUS/test.py [new file with mode: 0644]

index 393728813e7d63d8ab355ca739670cff00959c3e..e30c3ccc0ceb62ab705b2229f1b9ccc282f3263b 100644 (file)
@@ -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'}
index 61a9e29860d373757aa4c6350be4a7b98f7ec091..05d6f93b8534553bb08b237d6afa08d3c235379b 100644 (file)
@@ -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"), "<Ctrl+A>")
+    type(waitForObject(":_ModuleBase_ParamSpinBox"), radius)
+    type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Keypad_Enter>")
+    
+    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 (file)
index 0000000..01c702c
--- /dev/null
@@ -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"))