Salome HOME
NewGeom is renamed to SHAPER: "Shaper" named button is shown in SALOME, :SALOME*...
[modules/shaper.git] / test.squish / suite_FEATURE_REVOLUTION / tst_revolution_006 / test.py
1 def main():
2     # [project] SHAPER
3     # [Scenario] Revolution_006
4     # [Topic] 'RevolutionCut by 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_revolution_003.hdf'
19     open(DATA_PATH + "/for_revolution_003.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)", 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 [vp INIT]
31     fit_all()
32     test.vp("INIT")
33
34     # TODO(spo): remove: workaround for the bug given RevolutionCut sketch created when select axis_object then apply is disabled
35     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
36     clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 10, 10, 0, Qt.LeftButton)
37     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 10, 10, 0)
38     activateItem(waitForObjectItem(":_QMenu", "Edit..."))
39     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
40
41     # [step] Execute RevolutionFuse operation
42     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Features"))
43     mouseClick(waitForObjectItem(":_QMenu", "RevolutionCut"))
44
45     # [step] Select sketch face
46     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 287, 236, 0, Qt.LeftButton)
47
48     # [step] Click "Set plane view" in property panel [vp PLANE]
49     clickButton(waitForObject(":Sketcher plane.Set plane view_QPushButton"))
50     test.vp("PLANE")
51
52     # [step] Create 2 circles on the plane [vp CIRCLES]
53     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
54     activateItem(waitForObjectItem(":Sketch_QMenu", "Circle"))
55     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 650, 350, 0, Qt.LeftButton)
56     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 690, 350, 0, Qt.LeftButton)
57     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
58
59     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
60     activateItem(waitForObjectItem(":Sketch_QMenu", "Circle"))
61     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 650, 110, 0, Qt.LeftButton)
62     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 700, 110, 0, Qt.LeftButton)
63     clickButton(waitForObject(":Boolean.property_panel_ok_QToolButton"))
64
65     test.vp("CIRCLES")
66
67     # [step] Approve sketching
68     clickButton(waitForObject(":Sketch.property_panel_ok_QToolButton"))
69
70     # [step] Select axis for revolution
71     mouseClick(waitForObject(":Revolution_QLineEdit_3"), 10, 10, 0, Qt.LeftButton)
72     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 750, 237, 0, Qt.LeftButton)
73
74     # [step] Select method 'by planes and offsets'
75     clickButton(waitForObject(":Revolution_QToolButton_5"))
76
77     # [step] Select face 'To': front face
78     mouseClick(waitForObject(":To_QLineEdit_4"), 10, 10, 0, Qt.LeftButton)
79     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 334, 352, 0, Qt.LeftButton)
80
81     # [step] Select face 'From': back face
82     mouseClick(waitForObject(":From_QLineEdit_4"), 117, 10, 0, Qt.LeftButton)
83     clickButton(waitForObject(":SALOME*.-OY_QToolButton"))
84     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 334, 352, 0, Qt.LeftButton)
85
86     # [step] Apply the feature
87     clickButton(waitForObject(":RevolutionCut.property_panel_ok_QToolButton"))
88
89     # [step] Click 'Reset view' toolbar button
90     clickButton(waitForObject(":SALOME*.Reset_QToolButton_2"))
91     mouseClick(waitForObject(":SALOME*_OCCViewer_ViewPort3d"), 10, 450, 0, Qt.LeftButton)  # close tool bar extension bar
92
93     # [check] Check that operation has been executed successfully
94     fit_all()
95     test.vp("REVOLUTION_CUT")
96
97     # [step] Close application without saving
98     close_application()