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