Salome HOME
Update copyrights
[modules/shaper.git] / test.squish / shared / scripts / common.py
index f72d38546b03fe6126b5cdaaa9bd9a8c8df5f6c9..cd6f8ac1c5603172c6f7626e2e1043b4a71d2c59 100644 (file)
@@ -1,20 +1,42 @@
+# Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import filecmp
 import os
+import shutil
 
 testSettings.logScreenshotOnError = True
 testSettings.logScreenshotOnFail = True
-#RESULTS_PATH = "/dn48/newgeom/eso/sources/test.squish/shared/testresults/"
+# RESULTS_PATH = "/dn48/SHAPER/eso/sources/test.squish/shared/testresults/"
 DATA_PATH = os.getenv('TEST_DATA_DIR')
+TMP_DIR = os.path.join(DATA_PATH, 'tmp')
 
-g_points = {"XY_plane": (332, 250), "XZ_plane": (355, 207)} # one of the construction planes
+g_points = {"XY_plane": (332, 250), "XZ_plane": (355, 207)}  # one of the construction planes
 def help_points(name):
-    return g_points[name] 
+    return g_points[name]
 
 #---------------------------------------------------------------------------------------------
 # Tools
 def findMenuItem(menuObject, item):
     for child in object.children(menuObject):
         if child.text == item:
-            return child    
+            return child
     return None
 
 #---------------------------------------------------------------------------------------------
@@ -25,53 +47,65 @@ def getPropertyPanelRealName():
 def getSpinBoxRealName(name):
     return "{container=%s name='%s' type='ModuleBase_ParamSpinBox' visible='1'}" % (getPropertyPanelRealName(), name)
 
+#---------------------------------------------------------------------------------------------
+def create_tmp():
+    remove_tmp()
+    os.makedirs(TMP_DIR)
+
+def remove_tmp():
+    if os.path.exists(TMP_DIR):
+        shutil.rmtree(TMP_DIR)
+
 #---------------------------------------------------------------------------------------------
 def set_defaults():
     waitForObject(":SALOME*_STD_TabDesktop").resize(1024, 768)
-    
-def activate_newgeom():
-    clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
+    create_tmp()
+
+def activate_SHAPER():
+    clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
     clickButton(waitForObject(":Activate module.New_QPushButton"))
-    
+
 def close_application():
     sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop"))
     clickButton(waitForObject(":Exit.Ok_QPushButton"))
     clickButton(waitForObject(":Close active study.Close w/o saving_QPushButton"))
 #     snooze(10)
+    remove_tmp()
 
 def close_application_wo_saving():
     sendEvent("QCloseEvent", waitForObject(":SALOME*_STD_TabDesktop"))
     clickButton(waitForObject(":Exit.Ok_QPushButton"))
     clickButton(waitForObject(":Close active study.Close w/o saving_QPushButton"))
-    
+    remove_tmp()
+
 def part_create():
     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Part"))
     activateItem(waitForObjectItem(":Part_QMenu", "New part"))
-    
+
 def sketch_create(point, actions):
     clickButton(waitForObject(":SALOME*.Sketch_QToolButton"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
-    
+
     actions()
-    
+
     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
-    
+
 def point_create_in_view(point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Point"))
-    
-    if aux==1:    
+
+    if aux == 1:
         clickButton(waitForObject(":Point.Auxiliary_QCheckBox"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Point.property_panel_cancel_QToolButton"))
-    
+
 def point_create(point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
-    mouseClick(waitForObjectItem(":Sketch_QMenu", "Point"))  
-               
-    if aux==1:    
+    mouseClick(waitForObjectItem(":Sketch_QMenu", "Point"))
+
+    if aux == 1:
         clickButton(waitForObject(":Point.Auxiliary_QCheckBox"))
 
     type(waitForObject(":Point.X _ModuleBase_ParamSpinBox"), "<Ctrl+A>")
@@ -81,82 +115,82 @@ def point_create(point, aux=0):
     type(waitForObject(":Point.Y _ModuleBase_ParamSpinBox"), point[1])
 
     clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
-    
+
 def line_create_in_view(start_point, end_point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Line"))
-    
-    if aux==1:       
+
+    if aux == 1:
         clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), start_point[0], start_point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), end_point[0], end_point[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Line.property_panel_cancel_QToolButton"))
 
 def closing_line_create_in_view(start_point, end_point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Line"))
-    
-    if aux==1:       
+
+    if aux == 1:
         clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), start_point[0], start_point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), end_point[0], end_point[1], 0, Qt.LeftButton)
-        
+
 def lines_create_in_view(points, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Line"))
-    
-    if aux==1:       
+
+    if aux == 1:
         clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))
-    
+
     for point in points:
       mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
 
 def lines_close():
-    clickButton(waitForObject(":Line.property_panel_cancel_QToolButton"))        
-        
-def line_create(start_point, end_point, aux=0): #Set aux=1 to create auxiliary line
+    clickButton(waitForObject(":Line.property_panel_cancel_QToolButton"))
+
+def line_create(start_point, end_point, aux=0):  # Set aux=1 to create auxiliary line
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Line"))
-    
-    if aux==1:       
-        clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))        
-        
+
+    if aux == 1:
+        clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))
+
     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(":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_in_view(center, radius, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Circle"))
-    
-    if aux==1:
+
+    if aux == 1:
         clickButton(waitForObject(":Circle.Auxiliary_QCheckBox"))
-        
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), center[0], center[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), radius[0], radius[1], 0, Qt.LeftButton)
 
     clickButton(waitForObject(":Circle.property_panel_cancel_QToolButton"))
-    
+
 def circle_create(center, radius, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Circle"))
-    
-    if aux==1:
+
+    if aux == 1:
         clickButton(waitForObject(":Circle.Auxiliary_QCheckBox"))
-    
+
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox"), center[0])
 
@@ -167,68 +201,68 @@ def circle_create(center, radius, aux=0):
     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
 
     clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
-    
+
 def arc_create(center, start_point, end_point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Arc"))
-    
-    if aux==1:
+
+    if aux == 1:
         clickButton(waitForObject(":Arc.Auxiliary_QCheckBox"))
 
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":Center.X _ModuleBase_ParamSpinBox_2"), center[0])
-    
+
     type(waitForObject(":Center.Y _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":Center.Y _ModuleBase_ParamSpinBox_2"), center[1])
-    
+
     type(waitForObject(":Start point.X _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":Start point.X _ModuleBase_ParamSpinBox_2"), start_point[0])
-    
+
     type(waitForObject(":Start point.Y _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":Start point.Y _ModuleBase_ParamSpinBox_2"), start_point[1])
 
     type(waitForObject(":End point.X _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":End point.X _ModuleBase_ParamSpinBox_2"), end_point[0])
-    
+
     type(waitForObject(":End point.Y _ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
     type(waitForObject(":End point.Y _ModuleBase_ParamSpinBox_2"), end_point[1])
-    
-    clickButton(waitForObject(":Arc.property_panel_ok_QToolButton"))    
-       
+
+    clickButton(waitForObject(":Arc.property_panel_ok_QToolButton"))
+
 def arc_create_in_view(center, start_point, end_point, aux=0):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Arc"))
-               
-    if aux==1:
+
+    if aux == 1:
         clickButton(waitForObject(":Arc.Auxiliary_QCheckBox"))
-        
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), center[0], center[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), start_point[0], start_point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), end_point[0], end_point[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Arc.property_panel_cancel_QToolButton"))
-    
+
 def save(filename):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "File"))
     mouseClick(waitForObjectItem(":_QMenu", "Save As..."))
-    
+
     type(waitForObject(":fileNameEdit_QLineEdit"), filename)
     clickButton(waitForObject(":Save File.Save_QPushButton"))
-    
+
 def extrusion(point, to_size, from_size):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "Extrusion"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
-    
+
     type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox"), to_size)
-    
+
     type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox"), from_size)
-    
+
     clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))
-    
+
 def open(filename):
     clickButton(waitForObject(":SALOME*.Open_QToolButton"))
     waitForObject(":fileNameEdit_QLineEdit_2").setText(filename)
@@ -239,55 +273,55 @@ def point_fixe(point):
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Fixed"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Fixed.property_panel_cancel_QToolButton"))
-    
-    
+
+
 def distance(start_point, end_point, annotation_point):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Distance"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), start_point[0], start_point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), end_point[0], end_point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), annotation_point[0], annotation_point[1], 0, Qt.LeftButton)
-    
-    #if length!=0:
-        #type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
-        #type(waitForObject(":_ModuleBase_ParamSpinBox"), length)
-           
+
+    # if length!=0:
+        # type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
+        # type(waitForObject(":_ModuleBase_ParamSpinBox"), length)
+
     clickButton(waitForObject(":Distance.property_panel_cancel_QToolButton"))
-    
+
 def change_distance(point, value):
     doubleClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     type(waitForObject(":Distance.ConstraintValue_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Distance.ConstraintValue_ModuleBase_ParamSpinBox"), value)
-    clickButton(waitForObject(":Distance.property_panel_ok_QToolButton"))    
-    
+    clickButton(waitForObject(":Distance.property_panel_ok_QToolButton"))
+
 def parallel(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Parallel"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0], point_1[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Parallel.property_panel_cancel_QToolButton_2"))
-    
+
 def perpendicular(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Perpendicular"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0], point_1[1], 0, Qt.LeftButton)
-    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton) 
-    
+    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton)
+
     clickButton(waitForObject(":Perpendicular.property_panel_cancel_QToolButton"))
-    
+
 def coincident(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Coincident"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0], point_1[1], 0, Qt.LeftButton)
-    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton) 
+    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Coincident.property_panel_cancel_QToolButton"))
-    
+
 def equal(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Equal"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0], point_1[1], 0, Qt.LeftButton)
-    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton) 
+    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Equal.property_panel_cancel_QToolButton"))
 
 def vertical(point):
@@ -295,70 +329,71 @@ def vertical(point):
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Vertical"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Vertical.property_panel_cancel_QToolButton"))
-    
+
 def horizontal(point):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Horizontal"))
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     clickButton(waitForObject(":Horizontal.property_panel_cancel_QToolButton"))
-    
+
 def fit_all():
     clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
-    
+
+def boolean_select_operation_type(type):
+    real_name = "{container=':property_panel_dock.Operation type_QGroupBox' toolTip='%s' type='QToolButton' unnamed='1' visible='1'}" % type
+    clickButton(waitForObject(real_name))
+
 def boolean_cut(main_object, tool_object):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "Boolean"))
-    
-    mouseClick(waitForObject(":Boolean.Type_QComboBox"), 57, 9, 0, Qt.LeftButton)
-    mouseClick(waitForObjectItem(":Boolean.Type_QComboBox", "Cut"), 26, 7, 0, Qt.LeftButton)
-    
+
+    boolean_select_operation_type("Cut")
+
     mouseClick(waitForObject(":Boolean.Main objects_QListWidget"), 89, 62, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), main_object[0], main_object[1], 0, Qt.LeftButton)
-    
+
     mouseClick(waitForObject(":Boolean.Tool object_QListWidget"), 98, 87, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), tool_object[0], tool_object[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
-    
+
 def boolean_fuse(main_object, tool_object):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "Boolean"))
-    
-    mouseClick(waitForObject(":Boolean.Type_QComboBox"), 57, 9, 0, Qt.LeftButton)
-    mouseClick(waitForObjectItem(":Boolean.Type_QComboBox", "Fuse"), 26, 7, 0, Qt.LeftButton)
-    
+
+    boolean_select_operation_type("Fuse")
+
     mouseClick(waitForObject(":Boolean.Main objects_QListWidget"), 89, 62, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), main_object[0], main_object[1], 0, Qt.LeftButton)
-    
+
     mouseClick(waitForObject(":Boolean.Tool object_QListWidget"), 98, 87, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), tool_object[0], tool_object[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
-    
+
 def boolean_common(main_object, tool_object):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "Boolean"))
-    
-    mouseClick(waitForObject(":Boolean.Type_QComboBox"), 57, 9, 0, Qt.LeftButton)
-    mouseClick(waitForObjectItem(":Boolean.Type_QComboBox", "Common"), 26, 7, 0, Qt.LeftButton)
-    
+
+    boolean_select_operation_type("Common")
+
     mouseClick(waitForObject(":Boolean.Main objects_QListWidget"), 89, 62, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), main_object[0], main_object[1], 0, Qt.LeftButton)
-    
+
     mouseClick(waitForObject(":Boolean.Tool object_QListWidget"), 98, 87, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), tool_object[0], tool_object[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
-    
+
 def length(point, annotation_point):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Length"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), annotation_point[0], annotation_point[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Length.property_panel_cancel_QToolButton"))
-    
+
 def change_length(point, value):
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
 
@@ -366,16 +401,16 @@ def change_length(point, value):
     type(waitForObject(":Length.ConstraintValue_ModuleBase_ParamSpinBox"), value)
 
     clickButton(waitForObject(":Length.property_panel_ok_QToolButton"))
-    
+
 def radius(point, annotation_point):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Radius"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), annotation_point[0], annotation_point[1], 0, Qt.LeftButton)
-    
+
     clickButton(waitForObject(":Radius.property_panel_cancel_QToolButton"))
-    
+
 def change_radius(point, value):
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
 
@@ -383,66 +418,68 @@ def change_radius(point, value):
     type(waitForObject(":Radius.ConstraintValue_ModuleBase_ParamSpinBox"), value)
 
     clickButton(waitForObject(":Radius.property_panel_ok_QToolButton"))
-    
+
 def tangent(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
     mouseClick(waitForObjectItem(":Sketch_QMenu", "Tangent"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0], point_1[1], 0, Qt.LeftButton)
-    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton) 
+    mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0], point_2[1], 0, Qt.LeftButton)
 
     clickButton(waitForObject(":Tangent.property_panel_cancel_QToolButton"))
-    
+
 def partition(main_objects, tool_object):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "Partition"))
-    
+
     for main_object in main_objects:
         mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), main_object[0], main_object[1], 33554432, Qt.LeftButton)
-    
-    mouseClick(waitForObject(":Partition.Tool object_QListWidget"), 116, 69, 0, Qt.LeftButton)
+
+    mouseClick(waitForObject(":Boolean.Tool object_QListWidget"), 83, 132, 0, Qt.LeftButton)
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), tool_object[0], tool_object[1], 0, Qt.LeftButton)
-    clickButton(waitForObject(":Partition.property_panel_ok_QToolButton"))
-    
+    clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
+
 def plane(point, distance):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Construction"))
     mouseClick(waitForObjectItem(":_QMenu", "Plane"))
-    
+
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point[0], point[1], 0, Qt.LeftButton)
 
     type(waitForObject(":Plane.distance_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Plane.distance_ModuleBase_ParamSpinBox"), 100)
+    type(waitForObject(":Plane.distance_ModuleBase_ParamSpinBox"), "<Return>")
 
     clickButton(waitForObject(":Plane.property_panel_ok_QToolButton"))
-    
+
 def point(x, y, z):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Construction"))
     mouseClick(waitForObjectItem(":_QMenu", "Point"))
-    
+
     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Point.x_ModuleBase_ParamSpinBox"), x)
-    
+
     type(waitForObject(":Point.y_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Point.y_ModuleBase_ParamSpinBox"), y)
-    
+
     type(waitForObject(":Point.z_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
     type(waitForObject(":Point.z_ModuleBase_ParamSpinBox"), z)
-    
+    type(waitForObject(":Point.z_ModuleBase_ParamSpinBox"), "<Return>")
+
     clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
-    
+
 def axis(point_1, point_2):
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Construction"))
     mouseClick(waitForObjectItem(":_QMenu", "Axis"))
-    
-    mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0]-40, point_1[1]-40, 80, 80, 1, Qt.LeftButton)
-    mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0]-40, point_2[1]-40, 80, 80, 1, Qt.LeftButton)
-    
+
+    mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_1[0] - 40, point_1[1] - 40, 80, 80, 1, Qt.LeftButton)
+    mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), point_2[0] - 40, point_2[1] - 40, 80, 80, 1, Qt.LeftButton)
+
     clickButton(waitForObject(":Axis.property_panel_ok_QToolButton"))
-        
 
 
-    
-    
-    
-    
-    
+
+
+
+
+
+