Salome HOME
NewGeom is renamed to SHAPER
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_016 / test.py
1
2 def main():
3     #[project] SHAPER
4     #[Scenario] Sketch_016
5     #[Topic] 'Translation' 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 - Translation
35     activateItem(waitForObjectItem(":SALOME*_QMenuBar", "Sketch"))
36     activateItem(waitForObjectItem(":Sketch_QMenu", "Translation"))
37     mouseClick(waitForObject(":Translation.Segments:_QListWidget"), 115, 35, 0, Qt.LeftButton)
38
39     #[step] Select all objects for translation
40     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Shift>")
41     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 90, 130, 33554432, Qt.LeftButton)
42     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 440, 132, 33554432, Qt.LeftButton)
43     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 573, 199, 33554432, Qt.LeftButton)
44     
45     #[step] Click in viewer to define start point
46     mouseClick(waitForObject(":Start point.qt_spinbox_lineedit_QLineEdit"), 53, 7, 0, Qt.LeftButton)
47     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 112, 453, 0, Qt.LeftButton)
48     
49     #[step] Click in viewer to define end point, for this zoom out preview    
50     mouseClick(waitForObject(":End point.qt_spinbox_lineedit_QLineEdit"), 154, 9, 0, Qt.LeftButton)
51     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 451, 434, -120, 0, 2)
52     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 451, 434, -120, 0, 2)
53     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 451, 434, -120, 0, 2)
54     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 451, 434, -120, 0, 2)
55     sendEvent("QWheelEvent", waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 451, 434, -120, 0, 2)
56     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 426, 256, 0, Qt.LeftButton)
57     
58     #[step] Define the number of copies
59     mouseClick(waitForObject(":Translation.qt_spinbox_lineedit_QLineEdit"), 41, 9, 0, Qt.LeftButton)
60     type(waitForObject(":Translation.MultiTranslationCopies_QSpinBox"), "<Ctrl+A>")
61     type(waitForObject(":Translation.MultiTranslationCopies_QSpinBox"), 3)
62
63
64     #[step] Fit all 
65     fit_all()
66     
67     #[check] that preview is updated
68     test.vp("VP1")
69     
70     #[step] Ok
71     clickButton(waitForObject(":Translation.property_panel_ok_QToolButton"))
72     
73     #[check] Check that translation has been executed successfully
74     test.vp("VP2")
75     
76     # [step] Close application without saving
77     close_application()