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