def main():
- #[project] NewGEOM
- #[Scenario] Extrusion_006
- #[Topic] 'Extrusion_cut by planes' functionality
- #[Tested functionality]
- #[Summary description]
- #[Expected results]
- #[General comments]
-
+ # [project] NewGEOM
+ # [Scenario] Extrusion_006
+ # [Topic] 'Extrusion_cut by planes' 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_006.hdf'
+
+ # [step] Open 'for_extrusion_006.hdf'
open(DATA_PATH + "/for_extrusion_006.hdf")
-
- #[step] Activate NewGeom
+
+ # [step] Activate NewGeom
clickButton(waitForObject(":SALOME*.NewGeom_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 - ExtrusionCut
+ test.vp("INIT")
+
+ # [step] Features - ExtrusionCut
mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
mouseClick(waitForObjectItem(":_QMenu", "ExtrusionCut"))
-
- #[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 closing contour, consisting from 4 lines
- lines_create_in_view([(83, 152), (85, 346), (669, 344), (669, 162), (83, 152)])
-
- #[step] Ok
+
+ # [step] Click "Set plane view" in property panel [vp PLANE]
+ clickButton(waitForObject(":Sketcher plane.Set plane view_QPushButton"))
+ test.vp("PLANE")
+
+ # [step] Draw closing contour, consisting from 4 lines
+ lines_create_in_view([(110, 150), (110, 320), (640, 320), (640, 150), (110, 155)])
+
+ # [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] Select 'By planes aand offsets' method
+
+ # [step] Select 'By planes and offsets' method
clickButton(waitForObject(":Extrusion_QToolButton_3"))
mouseClick(waitForObject(":To_QLineEdit_5"), 46, 15, 0, Qt.LeftButton)
-
- #[step] Select Plane_1 as face 'To'
- mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 35, 130, 0, Qt.LeftButton)
-
- #[step] Ok
+
+ # [step] Select Plane_1 as face 'To'
+ mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 35, 220, 0, Qt.LeftButton)
+
+ # [check] Check that preview has been updated [cp PREVIEW]
+ fit_all()
+ test.vp("PREVIEW")
+
+ # [step] Ok
clickButton(waitForObject(":ExtrusionCut.property_panel_ok_QToolButton"))
-
- #[step] Click 'Reset view' toolbar button
+
+ # [step] Click 'Reset view' toolbar button
+ need_expand = not object.exists(":SALOME*.Reset_QToolButton")
+ if need_expand:
+ clickButton(waitForObject(":SALOME*.qt_toolbar_ext_button_QToolBarExtension_3"))
+
clickButton(waitForObject(":SALOME*.Reset_QToolButton"))
-
- #[check] Check that extrusionCut operation has been executed successfully
- test.vp("VP1")
-
+
+ if need_expand:
+ clickButton(waitForObject(":SALOME*.qt_toolbar_ext_button_QToolBarExtension_3"))
+
+ # [check] Check that extrusionCut operation has been executed successfully [vp EXTRUSION_FUSE]
+ test.vp("EXTRUSION_CUT")
+
# [step] Close application without saving
close_application()