Salome HOME
dd3fd84fc2f4e82c23c67e7ce1b627ab8275ab4b
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_005 / test.py
1 # Copyright (C) 2014-2023  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 email : webmaster.salome@opencascade.com
18 #
19
20 def sketch():
21     #[step] Click 'Create sketch' toolbar button
22     #[step] Select XY plane for sketching
23     #[step] Sketch - Point
24     #[step] Create point via clicking inside viewer
25     point_create_in_view((340, 205))
26     #[step] Check 'Auxiliary' check-box
27     #[step] Create point via clicking inside viewer
28     point_create_in_view((489, 380), 1)
29     #[step] Finish creation of points via viewer
30     #[step] Create point via direct input of coordinates. Use coordinates (50, 60)
31     point_create((80, 160))
32     #[step] Check 'Auxiliary' check-box
33     #[step] Create point via direct input of coordinates. Use coordinates (150, 60)
34     point_create((250, 50), 1)
35     #[step] Fix positions of 2 points
36     point_fixe((340, 205))
37     point_fixe((504, 227))
38     #[check] Check that 2 points have 'anchor' icons near themselves
39     test.vp("VP1")
40     #[step] Define distance between fixed and free points
41     distance((340, 205), (490, 381), (201, 320))
42     # [step] Change distance set
43     change_distance((275, 407), 200)
44     # [step] Check that distance has been modified, free point moved
45     test.vp("VP3")
46
47 def main():
48
49     # [project] SHAPER
50     # [Scenario] Sketch_005
51     #[Topic] Fixed point
52     #[Tested functionality]
53     #[Summary description]
54     #[Expected results]
55
56     source(findFile("scripts", "common.py"))
57     #[section] Application start
58     #[step] Launch SALOME
59     startApplication("salome_run.sh")
60
61     set_defaults()
62
63     #[step] Activate SHAPER
64     #[step]Click 'New' button
65     activate_SHAPER()
66
67     #[section] Creation of sketch and objects inside it
68     #[step] Part - New part
69     part_create()
70
71     sketch_create(help_points("XY_plane"), lambda: sketch())
72
73     #[step] Close application without saving
74     close_application()