Salome HOME
Update copyrights
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_002 / test.py
1 # Copyright (C) 2014-2019  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] Create random closed contour
24     line_create_in_view((101, 183),(265, 107))
25     line_create_in_view((265, 107), (520, 192))
26     line_create_in_view((520, 192), (443, 411))
27     closing_line_create_in_view((443, 411), (101, 183))
28
29     #[step] Create one more closed contour inside previous, not parallel to it
30     line_create_in_view((219, 198),(269, 166))
31     line_create_in_view((269, 166), (451, 230))
32     line_create_in_view((451, 230), (410, 334))
33     closing_line_create_in_view((410, 334), (219, 199))
34
35     #[check] Check that lines are not parallel and there are no icons near lines
36     test.vp("VP1")
37     #[step] Make according lines parallel
38     parallel((394, 151), (361, 199))
39     parallel((201, 137), (244, 182))
40     parallel((245, 278), (292, 249))
41     parallel((430, 286), (482, 299))
42     # [check] Check that lines are parallel and there are icons near lines
43     test.vp("VP2")
44
45 def main():
46     # [project] SHAPER
47     #[Scenario] Sketch_002
48     #[Topic] Parallel objects
49     #[Tested functionality]Parallelism between main lines
50
51     source(findFile("scripts", "common.py"))
52
53     #[section] Application start
54     #[step] Launch SALOME
55     startApplication("salome_run.sh")
56
57     set_defaults()
58
59     #[step] Activate SHAPER
60     #[step]Click 'New' button
61     activate_SHAPER()
62     #[section] Creation of main lines and make them parallel
63
64     sketch_create(help_points("XY_plane"), lambda: sketch())
65     #[step] Save study
66     save("RESULTS_PATH + sketch_002")
67     if object.exists(":Warning.Yes_QPushButton"):
68         clickButton(waitForObject(":Warning.Yes_QPushButton"))
69     ##[step] Close application
70     close_application()