Salome HOME
Updated copyright comment
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_004 / test.py
1 # Copyright (C) 2014-2024  CEA, EDF
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 import os
21
22 def main():
23     #[project] SHAPER
24     #[Scenario] Sketch_004
25     #[Topic] 'Distance' constraint
26     #[Tested functionality]
27     #[Summary description]
28     #[Expected results]
29     #[General comments]
30
31     source(findFile("scripts", "common.py"))
32
33     #[section] Application start
34     #[step] Launch SALOME
35     startApplication("salome_run.sh")
36
37     set_defaults()
38
39     #[step] Open 'for_sketch_004.hdf'
40     open(os.path.join(DATA_PATH, "for_sketch_004.hdf"))
41
42     #[step] Activate SHAPER
43     clickButton(waitForObject(":SALOME*.Shaper_QToolButton"))
44
45     #[step] Activate Part_1
46     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)")
47     clickItem(":Object browser_XGUI_DataTree", "Part\\_1 (Not loaded)", 51, 7, 0, Qt.LeftButton)
48     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1 (Not loaded)", 51, 7, 0)
49     activateItem(waitForObjectItem(":_QMenu", "Activate"))
50
51     #[step] Edit Sketch_1
52     waitForObjectItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1")
53     clickItem(":Object browser_XGUI_DataTree", "Part\\_1.Sketch\\_1", 54, 11, 0, Qt.LeftButton)
54     openItemContextMenu(waitForObject(":Object browser_XGUI_DataTree"), "Part\\_1.Sketch\\_1", 54, 11, 0)
55     activateItem(waitForObjectItem(":_QMenu", "Edit..."))
56
57     #[step] Click '+OY' view button
58     clickButton(waitForObject(":SALOME*.+OY_QToolButton"))
59
60     #[step] Set constraint 'Distance' between circle and point
61     distance((44, 224), (601, 259), (561, 195))
62     #[check] Check that constraint has been set
63     test.vp("VP1")
64     #[step] Change distance to 500
65     change_distance((324, 176), 500)
66     #[check] Check that distance is 500
67     test.vp("VP2")
68     #[step] Delete constraint
69     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 302, 270, 0, Qt.LeftButton)
70     mouseClick(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), 326, 181, 0, Qt.LeftButton)
71     type(waitForObject(":SALOME*.3D View Operations_OCCViewer_ViewPort3d"), "<Del>")
72     #[check] Check that constraint has been removed
73     test.vp("VP3")
74     #[step] Close application
75
76     close_application()
77
78     #[section]
79     #[step]
80     #[step]
81     #[comment]
82     #[check]
83