Salome HOME
d7d418890a50bf4753820ed27ca68eb1f5d80e77
[modules/shaper.git] / test.squish / suite_FEATURE_EXTRUSION / tst_extrusion_006 / test.py
1 def main():
2     # [project] NewGEOM
3     # [Scenario] Extrusion_006
4     # [Topic] 'Extrusion_cut by planes' functionality
5     # [Tested functionality]
6     # [Summary description]
7     # [Expected results]
8     # [General comments]
9
10     source(findFile("scripts", "common.py"))
11
12     # [section] Application start
13     # [step] Launch SALOME
14     startApplication("salome_run.sh")
15
16     set_defaults()
17
18     # [step] Open 'for_extrusion_006.hdf'
19     open(DATA_PATH + "/for_extrusion_006.hdf")
20
21     # [step] Activate NewGeom
22     clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
23
24     # [step] Activate Part_1
25     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
26     clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 71, 10, 0, Qt.LeftButton)
27     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 70, 9, 0)
28     activateItem(waitForObjectItem(":_QMenu", "Activate"))
29
30     # [step] Fit all
31     fit_all()
32     test.vp("INIT")
33
34     # [step] Features - ExtrusionCut
35     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
36     mouseClick(waitForObjectItem(":_QMenu", "ExtrusionCut"))
37
38     # [step] Select the upper face for sketching
39     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 243, 171, 0, Qt.LeftButton)
40
41     # [step] Click "Set plane view" in property panel [vp PLANE]
42     clickButton(waitForObject(":Sketcher plane.Set plane view_QPushButton"))
43     test.vp("PLANE")
44
45     # [step] Draw closing contour, consisting from 4 lines
46     lines_create_in_view([(110, 150), (110, 320), (640, 320), (640, 150), (110, 155)])
47
48     # [check] Check that lines have been executed successfully [cp LINES]
49     fit_all()
50     test.vp("LINES")
51
52     # [step] Ok
53     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
54
55     # [step] Select 'By planes and offsets' method
56     clickButton(waitForObject(":Extrusion_QToolButton_3"))
57     mouseClick(waitForObject(":To_QLineEdit_5"), 46, 15, 0, Qt.LeftButton)
58
59     # [step] Select Plane_1 as face 'To'
60     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 35, 220, 0, Qt.LeftButton)
61
62     # [check] Check that preview has been updated [cp PREVIEW]
63     fit_all()
64     test.vp("PREVIEW")
65
66     # [step] Ok
67     clickButton(waitForObject(":ExtrusionCut.property_panel_ok_QToolButton"))
68
69     # [step] Click 'Reset view' toolbar button
70     need_expand = not object.exists(":SALOME*.Reset_QToolButton")
71     if need_expand:
72         clickButton(waitForObject(":SALOME*.qt_toolbar_ext_button_QToolBarExtension_3"))
73
74     clickButton(waitForObject(":SALOME*.Reset_QToolButton"))
75
76     if need_expand:
77         clickButton(waitForObject(":SALOME*.qt_toolbar_ext_button_QToolBarExtension_3"))
78
79     # [check] Check that extrusionCut operation has been executed successfully [vp EXTRUSION_FUSE]
80     test.vp("EXTRUSION_CUT")
81
82     # [step] Close application without saving
83     close_application()