Salome HOME
Merge with Dev_1.5.0
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_003 / test.py
1 def sketch():
2     circle_create_in_view((302, 221), (436, 287))
3     
4 def main():
5     #[project] NewGEOM
6     #[Scenario] Sketch_003
7     #[Topic]
8     #[Tested functionality] Saving and opening studies
9     #[Summary description]
10     #[Expected results]
11     #[General comments]
12     
13     source(findFile("scripts", "common.py"))
14     
15     #[section] Application start
16     #[step] Launch SALOME
17     startApplication("salome_run.sh")
18
19     set_defaults()
20     #[section] Creation of 3D model
21     #[step] Activate NewGeom
22     #[step]Click 'New' button
23     
24     activate_newgeom()
25     #[step] Create new part
26     part_create()
27     #[step] Create sketch, consisting from one circle
28     sketch_create(help_points("XZ_plane"), lambda: sketch())
29     
30     #[step] Execute extrusion. Use parameters to size = 100 and from size = 50
31     extrusion((182, 140), 100, 50)
32     
33     #[step] Rotate obtained model
34     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
35     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 425, 422, 20, -23, 67108865, Qt.LeftButton)
36     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
37     mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 446, 411, -13, -137, 67108866, Qt.RightButton)
38     test.vp("VP1")
39
40     #[section] Save file
41     #[step] File - Save as
42     #[step] 'Save as' dialog appears
43     #[step] Type name of file
44     #[step] Click 'Save' button    
45     save("RESULTS_PATH + sketch_003")
46     if object.exists(":Warning.Yes_QPushButton"):
47         clickButton(waitForObject(":Warning.Yes_QPushButton"))
48     
49     #[step] Close document
50     clickButton(waitForObject(":SALOME*.Close_QToolButton"))
51     
52     #[step] File - Open 
53     #[step} Open just saved file  
54     open("RESULTS_PATH + sketch_003.hdf")
55     #[step] Activate NewGeom
56     clickButton(waitForObject(":SALOME*.NewGeom_QToolButton"))
57     
58     #[step] Activate Part_1
59     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
60     clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 50, 11, 0, Qt.LeftButton)
61     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 50, 11, 0)
62     activateItem(waitForObjectItem(":_QMenu", "Activate"))
63     
64     #[check] Check that file was loaded correct
65     test.vp("VP2")
66     #[step] Close application
67     close_application()