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