1 # Copyright (C) 2014-2022 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 circle_create_in_view((302, 221), (436, 287))
25 #[Scenario] Sketch_003
27 #[Tested functionality] Saving and opening studies
28 #[Summary description]
32 source(findFile("scripts", "common.py"))
34 #[section] Application start
36 startApplication("salome_run.sh")
39 #[section] Creation of 3D model
40 #[step] Activate SHAPER
41 #[step]Click 'New' button
44 #[step] Create new part
46 #[step] Create sketch, consisting from one circle
47 sketch_create(help_points("XZ_plane"), lambda: sketch())
49 #[step] Execute extrusion. Use parameters to size = 100 and from size = 50
50 extrusion((182, 140), 100, 50)
52 #[step] Rotate obtained model
53 type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
54 mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 425, 422, 20, -23, 67108865, Qt.LeftButton)
55 type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Control>")
56 mouseDrag(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 446, 411, -13, -137, 67108866, Qt.RightButton)
60 #[step] File - Save as
61 #[step] 'Save as' dialog appears
62 #[step] Type name of file
63 #[step] Click 'Save' button
64 save("RESULTS_PATH + sketch_003")
65 if object.exists(":Warning.Yes_QPushButton"):
66 clickButton(waitForObject(":Warning.Yes_QPushButton"))
68 #[step] Close document
69 clickButton(waitForObject(":SALOME*.Close_QToolButton"))
72 #[step} Open just saved file
73 open("RESULTS_PATH + sketch_003.hdf")
74 #[step] Activate SHAPER
75 clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
77 #[step] Activate Part_1
78 waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
79 clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 50, 11, 0, Qt.LeftButton)
80 openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 50, 11, 0)
81 activateItem(waitForObjectItem(":_QMenu", "Activate"))
83 #[check] Check that file was loaded correct
85 #[step] Close application