Salome HOME
NewGeom is renamed to SHAPER
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_017 / test.py
1
2 def main():
3     #[project] SHAPER
4     #[Scenario] Sketch_017
5     #[Topic] 'Rotation' functionality
6     #[Tested functionality] 
7     #[Summary description]
8     #[Expected results]
9     #[General comments]
10     
11     source(findFile("scripts", "common.py"))
12     
13     #[section] Application start
14     #[step] Launch SALOME
15     startApplication("salome_run.sh")
16
17     set_defaults()
18     
19     #[step] Open 'for_sketch_016.hdf'
20     open(DATA_PATH + "/for_sketch_016.hdf")
21     
22     #[step] Activate SHAPER
23     clickButton(waitForObject(":SALOME*.SHAPER_QToolButton"))
24     
25     #[step] Edit 'Sketch_1'
26     waitForObjectItem(":Object browser_XGUI_DataTree", "Sketch\\_1")
27     clickItem(":Object browser_XGUI_DataTree", "Sketch\\_1", 43, 12, 0, Qt.LeftButton)
28     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Sketch\\_1", 43, 12, 0)
29     activateItem(waitForObjectItem(":_QMenu", "Edit..."))
30     
31     #[step] Click '+OZ' button
32     clickButton(waitForObject(":SALOME*.+OZ_QToolButton"))
33     
34     #[step] Sketch - Rotation
35     mouseClick(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
36     mouseClick(waitForObjectItem(":Sketch_QMenu", "Rotation"))
37     
38     #[step] Select all object for rotation
39     mouseClick(waitForObject(":Rotation.Segments:_QListWidget"), 59, 66, 0, Qt.LeftButton)
40     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Shift>")
41     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 135, 116, 33554432, Qt.LeftButton)
42     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 447, 187, 33554432, Qt.LeftButton)
43     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 573, 209, 33554432, Qt.LeftButton)
44     
45     #[step] Click on the viewer to select center of rotation
46     mouseClick(waitForObject(":Center of rotation.qt_spinbox_lineedit_QLineEdit"), 107, 8, 0, Qt.LeftButton)
47     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 328, -120, 0, 2)
48     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 328, -120, 0, 2)
49     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 328, -120, 0, 2)
50     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 325, -120, 0, 2)
51     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 325, -120, 0, 2)
52     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 387, 325, -120, 0, 2)
53     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 605, 257, 0, Qt.LeftButton)
54     
55     #[step] Input angle of rotation
56     mouseClick(waitForObject(":Rotation.qt_spinbox_lineedit_QLineEdit"), 146, 5, 0, Qt.LeftButton)
57     type(waitForObject(":Rotation.MultiRotationAngle_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
58     type(waitForObject(":Rotation.MultiRotationAngle_ModuleBase_ParamSpinBox"), 45)
59     
60     #[step] Input number of copies
61     mouseClick(waitForObject(":Rotation.qt_spinbox_lineedit_QLineEdit_2"), 13, 5, 0, Qt.LeftButton)
62     type(waitForObject(":Rotation.MultiRotationCopies_QSpinBox"), "<Ctrl+A>")
63     type(waitForObject(":Rotation.MultiRotationCopies_QSpinBox"), 7)
64     
65     mouseClick(waitForObject(":Rotation.Segments:_QListWidget"), 59, 66, 0, Qt.LeftButton)
66     
67     #[step] Click Fit all button
68     fit_all()
69     
70     #[check] Check that preview is updated
71     test.vp("VP1")
72     
73     #[step] Ok
74     clickButton(waitForObject(":Rotation.property_panel_ok_QToolButton"))
75     
76     #[check] Check that rotation has been executed successfully
77     test.vp("VP2")
78     
79     # [step] Close application without saving
80     close_application()