1 testSettings.logScreenshotOnError = True
2 testSettings.logScreenshotOnFail = True
4 g_points = {"XY_plane": (320, 320)} # one of the construction planes
9 waitForObject(":OpenParts*_AppElements_MainWindow").resize(1024, 768)
11 def close_application():
12 sendEvent("QCloseEvent", waitForObject(":OpenParts*_AppElements_MainWindow"))
13 if object.exists(":Save current file.Discard_QPushButton"):
14 clickButton(waitForObject(":Save current file.Discard_QPushButton"))
16 def parameter_create(name, expression):
17 clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
18 type(waitForObject(":Parameter_QLineEdit"), name)
19 type(waitForObject(":Parameter_ExpressionEditor"), expression)
20 clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
23 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
24 clickButton(waitForObject(":Operations.New part_AppElements_Button"))
26 def sketch_create(point, actions):
27 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
28 clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
29 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
33 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
35 def point_create(point):
36 clickButton(waitForObject(":Basic.Point_AppElements_Button"))
38 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
39 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
40 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
41 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
43 clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
45 def line_create(start_point, end_point):
46 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
48 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
49 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
50 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
51 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
53 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
54 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
55 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
56 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
58 clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))
60 def line_create_in_view(start_point, end_point):
61 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
63 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), start_point[0], start_point[1], 0, Qt.LeftButton)
64 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), end_point[0], end_point[1], 0, Qt.LeftButton)
66 def auxiliary_line_create(start_point, end_point):
67 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
68 clickButton(waitForObject(":Line.Auxiliary_QCheckBox"))
70 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
71 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
72 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
73 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
75 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
76 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
77 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
78 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
80 #clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))
82 def circle_create(x, y, radius):
83 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
85 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
86 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
87 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
88 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
90 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
91 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
93 clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
95 def circle_create_in_view(point_1, point_2):
96 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
98 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
99 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
101 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
103 def distance_create(point_1, point_2, annotaion_point, distance):
104 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
106 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
107 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
108 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
110 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
111 type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
112 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Keypad_Enter>")
114 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
116 def parallel_create(point_1, point_2):
117 clickButton(waitForObject(":Constraints.Parallel_AppElements_Button"))
119 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
120 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
122 clickButton(waitForObject(":Constraints.Parallel_AppElements_Button"))
124 def perpendicular_create(point_1, point_2):
125 clickButton(waitForObject(":Constraints.Perpendicular_AppElements_Button"))
127 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
128 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
130 clickButton(waitForObject(":Perpendicular.property_panel_cancel_QToolButton"))
132 def horizontal_create(point_1):
133 clickButton(waitForObject(":Constraints.Horizontal_AppElements_Button"))
135 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
137 clickButton(waitForObject(":Constraints.Horizontal_AppElements_Button"))
139 def vertical_create(point_1):
140 cclickButton(waitForObject(":Constraints.Vertical_AppElements_Button"))
142 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
144 clickButton(waitForObject(":Constraints.Vertical_AppElements_Button"))
146 def radius_create(point_1, point_2, radius):
147 clickButton(waitForObject(":Constraints.Radius_AppElements_Button"))
149 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
150 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
151 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
152 type(waitForObject(":_ModuleBase_ParamSpinBox"), radius)
153 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Keypad_Enter>")
155 clickButton(waitForObject(":Constraints.Radius_AppElements_Button"))
158 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
159 clickButton(waitForObject(":Operations.New part_AppElements_Button"))
161 def extrusion_feature(points, to_size=0, from_size=0):
162 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
163 clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))
165 mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
167 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
169 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
170 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
172 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
173 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox"), from_size)
175 clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))
177 def extrusion_cut_by_sizes_feature(point, actions, to_size, from_size):
178 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
179 clickButton(waitForObject(":Extrusion.ExtrusionCut_AppElements_Button"))
181 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
185 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
187 type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
188 type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox"), to_size)
190 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
191 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_2"), from_size)
193 clickButton(waitForObject(":ExtrusionCut.property_panel_ok_QToolButton"))
194 #clickButton(waitForObject(":Sketch.property_panel_cancel_QToolButton"))
196 def extrusion_fuse_by_sizes_feature(point, actions, to_size, from_size):
198 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
199 clickButton(waitForObject(":Extrusion.ExtrusionFuse_AppElements_Button"))
201 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
205 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
207 type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox_2"), "<Ctrl+A>")
208 type(waitForObject(":Extrusion.to_size_ModuleBase_ParamSpinBox_2"), to_size)
210 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_3"), "<Ctrl+A>")
211 type(waitForObject(":Extrusion.from_size_ModuleBase_ParamSpinBox_3"), from_size)
213 clickButton(waitForObject(":ExtrusionFuse.property_panel_ok_QToolButton"))
214 #clickButton(waitForObject(":Sketch.property_panel_cancel_QToolButton"))