]> SALOME platform Git repositories - modules/shaper.git/blob - test.squish/suite_ISSUES/shared/scripts/common.py
Salome HOME
Add tests for the issue 818 and for the distance constraint.
[modules/shaper.git] / test.squish / suite_ISSUES / shared / scripts / common.py
1 def parameter_create(name, expression):
2     clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
3     type(waitForObject(":Parameter_QLineEdit"), name)
4     type(waitForObject(":Parameter_ExpressionEditor"), expression)
5     clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
6
7 def part_create():
8     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
9     clickButton(waitForObject(":Operations.New part_AppElements_Button"))
10     
11 def sketch_create(point, actions):
12     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
13     clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
14     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
15     
16     actions()
17     
18     clickButton(waitForObject(":Sketch.Ok_QToolButton"))
19     
20 def point_create(point):
21     clickButton(waitForObject(":Basic.Point_AppElements_Button"))
22
23     type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
24     type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
25     type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
26     type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
27
28     clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))       
29     
30 def line_create(start_point, end_point):
31     clickButton(waitForObject(":Basic.Line_AppElements_Button"))
32
33     type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
34     type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
35     type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
36     type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
37
38     type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
39     type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
40     type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
41     type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
42
43     clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))    
44     
45 def circle_create(x, y, radius):
46     clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
47     
48     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
49     type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
50     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
51     type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
52     
53     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
54     type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
55     
56     clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
57     
58 def distance_create(point_1, point_2, annotaion_point, distance):
59     clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
60     
61     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
62     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
63     mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
64
65     type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
66     type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
67     type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
68
69     clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))    
70     
71 def extrusion_feature(points, to_size):
72     clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
73     clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))    
74
75     mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
76     for point in points:
77         mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
78     
79     type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
80     type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
81
82     clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))