Salome HOME
Fix suite_FEATURE_REVOLUTION
[modules/shaper.git] / test.squish / suite_FEATURE_REVOLUTION / tst_revolution_003 / test.py
1 def main():
2     # [project] NewGEOM
3     # [Scenario] Revolution_003
4     # [Topic] 'RevolutionCut by angles' 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 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 [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 RevolutionCut 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] Define angle 'To'
75     mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_5"), 10, 10, 0, Qt.LeftButton)
76     type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
77     type(waitForObject(":Revolution.to_angle_ModuleBase_ParamSpinBox_3"), 90)
78
79     # [step] Define angle 'From'
80     mouseClick(waitForObject(":Revolution.qt_spinbox_lineedit_QLineEdit_6"), 10, 10, 0, Qt.LeftButton)
81     type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
82     type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), 90)
83     type(waitForObject(":Revolution.from_angle_ModuleBase_ParamSpinBox_3"), "<Return>")
84
85     # [step] Apply the feature
86     clickButton(waitForObject(":RevolutionCut.property_panel_ok_QToolButton"))
87
88     # [step] Click 'Reset view' toolbar button
89     clickButton(waitForObject(":SALOME*.Reset_QToolButton_2"))
90     mouseClick(waitForObject(":SALOME*_OCCViewer_ViewPort3d"), 10, 450, 0, Qt.LeftButton)  # close tool bar extension bar
91
92     # [check] Check that operation has been executed successfully
93     test.vp("REVOLUTION_CUT")
94
95     # [step] Close application without saving
96     close_application()