Salome HOME
NewGeom is renamed to SHAPER: "Shaper" named button is shown in SALOME, :SALOME*...
[modules/shaper.git] / test.squish / suite_FEATURE_EXTRUSION / tst_extrusion_002 / test.py
1 def main():
2     # [project] SHAPER
3     # [Scenario] Extrusion_002
4     # [Topic] 'Extrusion by boarding planes and offsets' 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_001.hdf'
19     open(DATA_PATH + "/for_extrusion_002.hdf")
20
21     # [step] Activate SHAPER
22     clickButton(waitForObject(":SALOME*.Shaper_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)", 48, 10, 0, Qt.LeftButton)
27     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 48, 10, 0)
28     activateItem(waitForObjectItem(":_QMenu", "Activate"))
29
30     # [step] Fit all
31     fit_all()
32     test.vp("INIT")
33
34     # [step] Execute extrusion for sketch_1
35     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
36     mouseClick(waitForObjectItem(":_QMenu", "Extrusion"))
37
38     # [step] Select sketch_1 as base
39     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 324, 222, 0, Qt.LeftButton)
40
41     # [step] Select 'By boarding planes and offsets' button
42     clickButton(waitForObject(":Extrusion_QToolButton"))
43
44     # [check] Check that no result is previewed [vp NO_PREVIEW]
45     fit_all()
46     test.vp("NO_PREVIEW")
47
48     # [step] Select upper face as face 'To'
49     mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 80, 47, 0, Qt.LeftButton)
50     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 350, 231, 0, Qt.LeftButton)
51     mouseClick(waitForObject(":To_QLineEdit"), 31, 11, 0, Qt.LeftButton)
52     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 369, 87, 0, Qt.LeftButton)
53
54     # [check] Check that preview is updated [vp PREVIEW_TO]
55     fit_all()
56     test.vp("PREVIEW_TO")
57
58     # [step] Select lower face as face 'From'
59     mouseClick(waitForObject(":From_QLineEdit"), 80, 11, 0, Qt.LeftButton)
60     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 350, 413, 0, Qt.LeftButton)
61
62     # [check] Check that preview is updated [vp PREVIEW_FROM]
63     test.vp("PREVIEW_FROM")
64
65     # [step] Define offset for face 'To'
66     type(waitForObject(":To.to_offset_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
67     type(waitForObject(":To.to_offset_ModuleBase_ParamSpinBox"), 200)
68     type(waitForObject(":To.to_offset_ModuleBase_ParamSpinBox"), "<Return>")
69
70     # [step] Fit all
71     fit_all()
72
73     # [check] Check that preview is updated [vp PREVIEW_TO_OFFSET]
74     test.vp("PREVIEW_TO_OFFSET")
75
76     # [step] Define offset for face 'From'
77     type(waitForObject(":From.from_offset_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
78     type(waitForObject(":From.from_offset_ModuleBase_ParamSpinBox"), 200)
79     type(waitForObject(":From.from_offset_ModuleBase_ParamSpinBox"), "<Return>")
80
81     # [step] Fit all
82     fit_all()
83
84     # [check] Check that preview is updated [vp PREVIEW_FROM_OFFSET]
85     test.vp("PREVIEW_FROM_OFFSET")
86
87     # [step] Ok
88     clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))
89
90     # [step] Fit all
91     fit_all()
92
93     # [check] Check that extrusion is built [vp EXTRUSION]
94     test.vp("EXTRUSION")
95
96     # [step] Close application without saving
97     close_application()