Salome HOME
Add tests for the issue 818 and for the distance constraint.
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 10 Aug 2015 12:21:31 +0000 (15:21 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 10 Aug 2015 12:22:17 +0000 (15:22 +0300)
test.squish/objects.map
test.squish/suite_ISSUES/shared/scripts/common.py
test.squish/suite_ISSUES/tst_818/test.py [new file with mode: 0644]
test.squish/suite_ISSUES/tst_BASE/test.py
test.squish/suite_ISSUES/tst_DISTANCE/test.py [new file with mode: 0644]

index 3de686e4b7286b13becfadeea2762898b9b8e96c..455cdf5e38ad52b2230078fd48293c9d42ee8e46 100644 (file)
@@ -1,5 +1,8 @@
 :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'}
 :Basic.Sketch_AppElements_Button       {container=':Sketch.Basic_AppElements_MenuGroupPanel' text='Sketch' type='AppElements_Button' unnamed='1' visible='1'}
+:Sketch.Ok_QToolButton {container=':Sketch.Basic_AppElements_MenuGroupPanel' occurrence='6' type='QToolButton' unnamed='1' visible='1'}
 :Center.X:_ModuleBase_ParamSpinBox     {container=':Circle.Center_QGroupBox' leftWidget=':Center.X:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
 :Center.X:_QLabel      {container=':Circle.Center_QGroupBox' text='X:' type='QLabel' unnamed='1' visible='1'}
 :Center.Y:_ModuleBase_ParamSpinBox     {container=':Circle.Center_QGroupBox' leftWidget=':Center.Y:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
@@ -8,6 +11,21 @@
 :Circle.CircleRadius_ModuleBase_ParamSpinBox   {container=':OpenParts*.Circle_XGUI_PropertyPanel' name='CircleRadius' type='ModuleBase_ParamSpinBox' visible='1'}
 :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'}
+: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'}
+:Distance.ConstraintValue_ModuleBase_ParamSpinBox      {container=':OpenParts*.Distance_XGUI_PropertyPanel' name='ConstraintValue' type='ModuleBase_ParamSpinBox' visible='1'}
+:Distance.First object_QLabel  {container=':OpenParts*.Distance_XGUI_PropertyPanel' text='First object' type='QLabel' unnamed='1' visible='1'}
+:Distance.First object_QLineEdit       {container=':OpenParts*.Distance_XGUI_PropertyPanel' leftWidget=':Distance.First object_QLabel' type='QLineEdit' unnamed='1' visible='1'}
+:Distance.Second object_QLabel {container=':OpenParts*.Distance_XGUI_PropertyPanel' text='Second object' type='QLabel' unnamed='1' visible='1'}
+:Distance.Second object_QLineEdit      {container=':OpenParts*.Distance_XGUI_PropertyPanel' leftWidget=':Distance.Second object_QLabel' type='QLineEdit' unnamed='1' visible='1'}
+:End point.X:_ModuleBase_ParamSpinBox  {container=':Line.End point_QGroupBox' leftWidget=':End point.X:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:End point.X:_QLabel   {container=':Line.End point_QGroupBox' text='X:' type='QLabel' unnamed='1' visible='1'}
+:End point.Y:_ModuleBase_ParamSpinBox  {container=':Line.End point_QGroupBox' leftWidget=':End point.Y:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:End point.Y:_QLabel   {container=':Line.End point_QGroupBox' text='Y:' type='QLabel' unnamed='1' visible='1'}
+:End point.qt_spinbox_lineedit_QLineEdit       {container=':Line.End point_QGroupBox' name='qt_spinbox_lineedit' type='QLineEdit' visible='1'}
+:End point.qt_spinbox_lineedit_QLineEdit_2     {container=':Line.End point_QGroupBox' name='qt_spinbox_lineedit' occurrence='2' type='QLineEdit' visible='1'}
 :Extrusion.Extrusion_AppElements_Button        {container=':Features.Extrusion_AppElements_MenuGroupPanel' text='Extrusion' type='AppElements_Button' unnamed='1' visible='1'}
 :Extrusion.Select a sketch face_QLabel {container=':OpenParts*.Extrusion_XGUI_PropertyPanel' text='Select a sketch face' type='QLabel' unnamed='1' visible='1'}
 :Extrusion.Select a sketch face_QListWidget    {aboveWidget=':Extrusion.Select a sketch face_QLabel' container=':OpenParts*.Extrusion_XGUI_PropertyPanel' type='QListWidget' unnamed='1' visible='1'}
 :Features.Extrusion_AppElements_MenuGroupPanel {container=':qt_tabwidget_stackedwidget.Features_AppElements_Workbench' name='Extrusion' type='AppElements_MenuGroupPanel' visible='1'}
 :General.qt_tabwidget_stackedwidget_QStackedWidget     {container=':OpenParts*.General_AppElements_DockWidget' name='qt_tabwidget_stackedwidget' type='QStackedWidget' visible='1'}
 :General.qt_tabwidget_tabbar_QTabBar   {container=':OpenParts*.General_AppElements_DockWidget' name='qt_tabwidget_tabbar' type='QTabBar' visible='1'}
+:Line.End point_QGroupBox      {container=':OpenParts*.Line_XGUI_PropertyPanel' title='End point' type='QGroupBox' unnamed='1' visible='1'}
+:Line.Start point_QGroupBox    {container=':OpenParts*.Line_XGUI_PropertyPanel' title='Start point' type='QGroupBox' unnamed='1' visible='1'}
+:Line.property_panel_ok_QToolButton    {container=':OpenParts*.Line_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'}
+:Object browser_XGUI_DataTree  {container=':OpenParts*.Object browser_QDockWidget' type='XGUI_DataTree' unnamed='1' visible='1'}
 :OpenParts*.Circle_XGUI_PropertyPanel  {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Circle'}
+:OpenParts*.Distance_XGUI_PropertyPanel        {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Distance'}
 :OpenParts*.Extrusion_XGUI_PropertyPanel       {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Extrusion'}
 :OpenParts*.General_AppElements_DockWidget     {type='AppElements_DockWidget' unnamed='1' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='General'}
+:OpenParts*.Line_XGUI_PropertyPanel    {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Line'}
+:OpenParts*.Object browser_QDockWidget {type='QDockWidget' unnamed='1' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Object browser'}
 :OpenParts*.Parameter_XGUI_PropertyPanel       {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Parameter'}
+:OpenParts*.Point_XGUI_PropertyPanel   {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Point'}
 :OpenParts*.Sketch_XGUI_PropertyPanel  {name='property_panel_dock' type='XGUI_PropertyPanel' visible='1' window=':OpenParts*_AppElements_MainWindow' windowTitle='Sketch'}
 :OpenParts*_AppElements_MainWindow     {type='AppElements_MainWindow' unnamed='1' visible='1' windowTitle?='OpenParts*'}
 :OpenParts*_AppElements_ViewPort       {type='AppElements_ViewPort' unnamed='1' visible='1' window=':OpenParts*_AppElements_MainWindow'}
 :Parameters.Parameter_AppElements_Button       {container=':Part.Parameters_AppElements_MenuGroupPanel' text='Parameter' type='AppElements_Button' unnamed='1' visible='1'}
 :Part.Operations_AppElements_MenuGroupPanel    {container=':qt_tabwidget_stackedwidget.Part_AppElements_Workbench' name='Operations' type='AppElements_MenuGroupPanel' visible='1'}
 :Part.Parameters_AppElements_MenuGroupPanel    {container=':qt_tabwidget_stackedwidget.Part_AppElements_Workbench' name='Parameters' type='AppElements_MenuGroupPanel' visible='1'}
+:Point.Point_QGroupBox {container=':OpenParts*.Point_XGUI_PropertyPanel' title='Point' type='QGroupBox' unnamed='1' visible='1'}
+:Point.X:_ModuleBase_ParamSpinBox      {container=':Point.Point_QGroupBox' leftWidget=':Point.X:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:Point.X:_QLabel       {container=':Point.Point_QGroupBox' text='X:' type='QLabel' unnamed='1' visible='1'}
+:Point.Y:_ModuleBase_ParamSpinBox      {container=':Point.Point_QGroupBox' leftWidget=':Point.Y:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:Point.Y:_QLabel       {container=':Point.Point_QGroupBox' text='Y:' type='QLabel' unnamed='1' visible='1'}
+: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'}
 :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.property_panel_ok_QToolButton  {container=':OpenParts*.Sketch_XGUI_PropertyPanel' name='property_panel_ok' type='QToolButton' visible='1'}
+:Sketch_QScrollArea    {container=':qt_tabwidget_stackedwidget.Sketch_AppElements_Workbench' type='QScrollArea' unnamed='1' visible='1'}
+:Start point.X:_ModuleBase_ParamSpinBox        {container=':Line.Start point_QGroupBox' leftWidget=':Start point.X:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:Start point.X:_QLabel {container=':Line.Start point_QGroupBox' text='X:' type='QLabel' unnamed='1' visible='1'}
+:Start point.Y:_ModuleBase_ParamSpinBox        {container=':Line.Start point_QGroupBox' leftWidget=':Start point.Y:_QLabel' type='ModuleBase_ParamSpinBox' unnamed='1' visible='1'}
+:Start point.Y:_QLabel {container=':Line.Start point_QGroupBox' text='Y:' type='QLabel' unnamed='1' visible='1'}
+:Start point.qt_spinbox_lineedit_QLineEdit     {container=':Line.Start point_QGroupBox' name='qt_spinbox_lineedit' type='QLineEdit' visible='1'}
+:Start point.qt_spinbox_lineedit_QLineEdit_2   {container=':Line.Start point_QGroupBox' name='qt_spinbox_lineedit' occurrence='2' type='QLineEdit' visible='1'}
+:_ModuleBase_ParamSpinBox      {type='ModuleBase_ParamSpinBox' unnamed='1' visible='1' window=':_QDialog'}
+:_QDialog      {type='QDialog' unnamed='1' visible='1'}
+:_QMenu        {type='QMenu' unnamed='1' visible='1'}
 :qt_tabwidget_stackedwidget.Features_AppElements_Workbench     {container=':General.qt_tabwidget_stackedwidget_QStackedWidget' name='Features' type='AppElements_Workbench' visible='1'}
 :qt_tabwidget_stackedwidget.Part_AppElements_Workbench {container=':General.qt_tabwidget_stackedwidget_QStackedWidget' name='Part' type='AppElements_Workbench' visible='1'}
 :qt_tabwidget_stackedwidget.Sketch_AppElements_Workbench       {container=':General.qt_tabwidget_stackedwidget_QStackedWidget' name='Sketch' type='AppElements_Workbench' visible='1'}
index 0abcfc1f7fda60ca5d984562699dc76552599ddd..e0f3f9f6d01d4821cbb3d51a7af02cb6941ebe2c 100644 (file)
@@ -15,18 +15,59 @@ def sketch_create(point, actions):
     
     actions()
     
-    clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
+    clickButton(waitForObject(":Sketch.Ok_QToolButton"))
+    
+def point_create(point):
+    clickButton(waitForObject(":Basic.Point_AppElements_Button"))
+
+    type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
+    type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
+
+    clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))       
+    
+def line_create(start_point, end_point):
+    clickButton(waitForObject(":Basic.Line_AppElements_Button"))
+
+    type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
+    type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
+
+    type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
+    type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
+
+    clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))    
     
 def circle_create(x, y, radius):
     clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
+    
     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
+    
     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
+    
     clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
     
+def distance_create(point_1, point_2, annotaion_point, distance):
+    clickButton(waitForObject(":Constraints.Distance_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)
+    mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
+
+    type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+    type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
+    type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
+
+    clickButton(waitForObject(":Constraints.Distance_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_818/test.py b/test.squish/suite_ISSUES/tst_818/test.py
new file mode 100644 (file)
index 0000000..0807c4f
--- /dev/null
@@ -0,0 +1,21 @@
+def main():
+    source(findFile("scripts", "common.py"))
+    
+    startApplication("GeomApp")
+    parameter_create("a", "100")
+    
+    point = (446, 297) # one of the construction planes
+    sketch_create(point, lambda: line_create((0, 0), ("a", 0)))
+
+    waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1)")
+    clickItem(":Object browser_XGUI_DataTree", "Parameters (1)", -10, 10, 0, Qt.LeftButton)
+    waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100")
+    clickItem(":Object browser_XGUI_DataTree", "Parameters (1).a = 100", 10, 10, 0, Qt.LeftButton)
+    openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Parameters (1).a = 100", 10, 10, 0)
+    
+    activateItem(waitForObjectItem(":_QMenu", "Delete"))
+    
+    waitFor("object.exists(':Delete features.Label_QLabel')", 20000)
+    test.compare(str(findObject(":Delete features.Label_QLabel").text), "Selected features are used in the following features: SketchLine_1.These features will be deleted.\nAlso these features will be deleted: Sketch_1.\nWould you like to continue?")
+
+    clickButton(waitForObject(":Delete features.Yes_QPushButton"))
index cd646fb9d9a96761ee5868cab5e99181136556f0..83c68dc745ee03c7ab46e61ee6f30cb8fb92dcb9 100644 (file)
@@ -8,3 +8,4 @@ def main():
     sketch_create(point, lambda: circle_create(0, 0, "a"))
     points = [(489, 319)] # circle
     extrusion_feature(points, "a")
+    
\ No newline at end of file
diff --git a/test.squish/suite_ISSUES/tst_DISTANCE/test.py b/test.squish/suite_ISSUES/tst_DISTANCE/test.py
new file mode 100644 (file)
index 0000000..413377a
--- /dev/null
@@ -0,0 +1,24 @@
+def sketch():
+    line_create((0, 0), (100, 0))
+    point_create((50, 50))
+
+    point_1 = (536, 273) # point
+    point_2 = (543, 299) # line 
+    annotaion_point = (392, 291)
+    distance_create(point_1,point_2, annotaion_point, 100)
+    
+    mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton)
+    waitFor("object.exists(':Distance.First object_QLineEdit')", 20000)
+    test.compare(str(findObject(":Distance.First object_QLineEdit").text), "SketchPoint_1/PointCoordindates")
+    waitFor("object.exists(':Distance.Second object_QLineEdit')", 20000)
+    test.compare(str(findObject(":Distance.Second object_QLineEdit").text), "SketchLine_1")
+    waitFor("object.exists(':Distance.ConstraintValue_ModuleBase_ParamSpinBox')", 20000)
+    test.compare(str(findObject(":Distance.ConstraintValue_ModuleBase_ParamSpinBox").text), "100")
+
+def main():
+    source(findFile("scripts", "common.py"))
+    
+    startApplication("GeomApp")
+    
+    point = (446, 297) # one of the construction planes
+    sketch_create(point, lambda: sketch())