Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / test.squish / suite_FEATURE_SKETCH / tst_sketch_001 / 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] Sketch - Point
25     #[step] Create point via clicking inside viewer
26     point_create_in_view((329, 255))
27     #[step] Check 'Auxiliary' check-box
28     #[step] Create point via clicking inside viewer
29     point_create_in_view((429, 300), 1)
30     #[step] Finish creation of points via viewer
31     #[step] Create point via direct input of coordinates. Use coordinates (50, 60)
32     point_create((50, 60))
33     #[step] Check 'Auxiliary' check-box
34     #[step] Create point via direct input of coordinates. Use coordinates (150, 60)
35     point_create((150, 60), 1)
36     #[step] Finish creation of points
37     #[step] Sketch - Line
38     #[step] Create line via direct input of coordinates. Use coordinates (0, 0) for start point and (100, 100) - for end point
39     line_create((0,0), (100, 100))
40     #[step] Check 'Auxiliary' check-box
41     #[step] Create line via direct input of coordinates. Use coordinates (100, 100) for start point and (100, 100) - for end point
42     line_create((100, 100), (200, 200), 1)
43     #[step] Create line via clicking inside viewer
44     line_create_in_view((400, 200), (600, 150))
45     #[step] Check 'Auxiliary' check-box
46     #[step] Create line via clicking inside viewer
47     line_create_in_view((600, 150), (500, 450), 1)
48     #[step] Finish creation of lines
49     #[step] Sketch - Circle
50     #[step] Create circle via direct input of coordinates. Use coordinates (0, 0) for center and 200 - for radius
51     circle_create((0, 0), 200)
52     #[step] Check 'Auxiliary' check-box
53     #[step] Create circle via direct input of coordinates. Use coordinates (0, 0) for center and 300 - for radius
54     circle_create((0, 0), 300, 1)
55     #[step] Create circle via clicking inside viewer
56     circle_create_in_view((400, 200), (260, 0))
57     #[step] Check 'Auxiliary' check-box
58     #[step] Create circle via clicking inside viewer
59     circle_create_in_view((400, 200), (300, 100), 1)
60     #[step] Finish creation of circles
61     #[step] Sketch - Arc
62     #[step] Create arc via direct input of coordinates. Use coordinates (0, 0) for center, (100, 50) - for start point and (80, 90) - for end point
63     arc_create((0, 0), (100, 50), (80, 90))
64     #[step] Check 'Auxiliary' check-box
65     #[step] Create arc via direct input of coordinates. Use coordinates (0, 0) for center, (200, 50) - for start point and (80, 90) - for end point
66     arc_create((0, 0), (200, 50), (80, 90), 1)
67     #[step] Create arc via clicking inside viewer
68     arc_create_in_view((218, 183), (102, 135), (128, 271))
69     #[step] Check 'Auxiliary' check-box
70     #[step] Create arc via clicking inside viewer
71     arc_create_in_view((203, 185), (51, 134), (104, 282), 1)
72     #[step] CLick 'Fit all' button
73     clickButton(waitForObject(":SALOME*.Fit All_QToolButton"))
74     #[check] All objects have been created. Check that objects of both types are shown (main and auxiliary)
75     test.vp("VP1")
76     #[step] Finish sketching
77
78
79 def main():
80     source(findFile("scripts", "common.py"))
81
82     # [project] SHAPER
83     # [Scenario] Sketch_001
84     #[Topic] Creation of objects in sketch
85     #[Tested functionality] Creation of objects during sketching by 2 ways: direct input of coordinates and clicking in viewer. Creation of auxiliary objects
86     #[Summary description]
87     #[Expected results]
88
89     #[section] Application start
90     #[step] Launch SALOME
91     startApplication("salome_run.sh")
92
93     set_defaults()
94
95     #[step] Activate SHAPER
96     #[step]Click 'New' button
97     activate_SHAPER()
98
99     #[section] Creation of sketch and objects inside it
100     #[step] Part - New part
101     part_create()
102     # clickButton(waitForObject(":Arc.Auxiliary_QCheckBox"))
103
104     sketch_create(help_points("XY_plane"), lambda: sketch())
105     #[check] Check that only main objects are shown
106     test.vp("VP2")
107     #[step] Close application without saving
108     close_application_wo_saving()
109
110