Salome HOME
Show "not loaded" suffix for names of not loaded parts
[modules/shaper.git] / test.squish / suite_FEATURE_EXTRUSION / tst_extrusion_004 / test.py
index 5dbbd53b67f15d89eb14c31896ca52c9cebedb52..9fef5adfe941cf8fa8dd28ff02934708e2811df3 100644 (file)
+## Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
+##
+
 def main():
-    #[project] NewGEOM
-    #[Scenario] Extrusion_004
-    #[Topic] 'Extrusion_Fuse by sizes' functionality
-    #[Tested functionality] 
-    #[Summary description]
-    #[Expected results]
-    #[General comments]
-    
+    # [project] SHAPER
+    # [Scenario] Extrusion_004
+    # [Topic] 'Extrusion_Fuse by sizes' functionality
+    # [Tested functionality]
+    # [Summary description]
+    # [Expected results]
+    # [General comments]
+
     source(findFile("scripts", "common.py"))
-    
-    #[section] Application start
-    #[step] Launch SALOME
+
+    # [section] Application start
+    # [step] Launch SALOME
     startApplication("salome_run.sh")
 
     set_defaults()
-    
-    #[step] Open 'for_extrusion_003.hdf'
+
+    # [step] Open 'for_extrusion_003.hdf'
     open(DATA_PATH + "/for_extrusion_003.hdf")
-    
-    #[step] Activate NewGeom
-    clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
-    
+
+    # [step] Activate SHAPER
+    clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
+
     # [step] Activate Part_1
     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
     clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 71, 10, 0, Qt.LeftButton)
     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 70, 9, 0)
     activateItem(waitForObjectItem(":_QMenu", "Activate"))
-    
-    #[step] Fit all
+
+    # [step] Fit all
     fit_all()
-    
-    #[step] Features - ExtrusionFuse
+    test.vp("INIT")
+
+    # [step] Features - ExtrusionFuse
     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
     mouseClick(waitForObjectItem(":_QMenu", "ExtrusionFuse"))
-    
-    #[step] Select the upper face for sketching
+
+    # [step] Select the upper face for sketching
     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 243, 171, 0, Qt.LeftButton)
-    
-    #[step] Draw close contour, consisting from 4 lines
+
+    # [step] Click "Set plane view" in property panel [vp PLANE]
+    clickButton(waitForObject(":Sketcher plane.Set plane view_QPushButton"))
+    test.vp("PLANE")
+
+    # [step] Draw close contour, consisting from 4 lines
     lines_create_in_view([(83, 152), (85, 346), (669, 344), (669, 162), (83, 152)])
-    
-    #[step] Ok
+
+    # [check] Check that lines have been executed successfully [cp LINES]
+    fit_all()
+    test.vp("LINES")
+
+    # [step] Ok
     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
-    
-    # [step] Define value of 'To size' parameter of ExtrusionFuse, set it equal to 100 
+
+    # [step] Define value of 'To size' parameter of ExtrusionFuse, set it equal to 100
     type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
     type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox_3"), 100)
+    type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox_3"), "<Return>")
 
-    #[step] Define value of 'From size' parameter of ExtrusionFuse, set it equal to 150 
+    # [check] Check that preview updated [cp PREVIEW_TO_SIZE]
+    fit_all()
+    test.vp("PREVIEW_TO_SIZE")
+
+    # [step] Define value of 'From size' parameter of ExtrusionFuse, set it equal to 150
     type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
     type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_3"), 150)
+    type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_3"), "<Return>")
 
-    #[step] Ok
+    # [check] Check that preview updated [cp PREVIEW_FROM_SIZE]
+    fit_all()
+    test.vp("PREVIEW_FROM_SIZE")
+
+    # [step] Ok
     clickButton(waitForObject(":ExtrusionFuse.property_panel_ok_QToolButton"))
 
-    #[step] Click 'Reset view' toolbar button    
-    clickButton(waitForObject(":SALOME*.Reset_QToolButton"))
+    # [step] Click 'Reset view' toolbar button
+    clickButton(waitForObject(":SALOME*.Reset_QToolButton_2"))
+    mouseClick(waitForObject(":SALOME*_OCCViewer_ViewPort3d"), 10, 450, 0, Qt.LeftButton)  # close tool bar extension bar
+
+    # [check] Check that extrusionCut operation has been executed successfully [vp EXTRUSION_FUSE]
+    test.vp("EXTRUSION_FUSE")
 
-    #[check] Check that ExtrusionFuse operation has been executed successfully  
-    test.vp("VP1")
-   
     # [step] Close application without saving
     close_application()