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 parameter_create(name, expression):
12 clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
13 type(waitForObject(":Parameter_QLineEdit"), name)
14 type(waitForObject(":Parameter_ExpressionEditor"), expression)
15 clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
18 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
19 clickButton(waitForObject(":Operations.New part_AppElements_Button"))
21 def sketch_create(point, actions):
22 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
23 clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
24 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
28 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
30 def point_create(point):
31 clickButton(waitForObject(":Basic.Point_AppElements_Button"))
33 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
34 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
35 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
36 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
38 clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
40 def line_create(start_point, end_point):
41 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
43 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
44 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
45 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
46 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
48 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
49 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
50 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
51 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
53 clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))
55 def circle_create(x, y, radius):
56 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
58 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
59 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
60 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
61 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
63 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
64 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
66 clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
68 def circle_create_in_view(point_1, point_2):
69 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
71 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
72 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
74 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
76 def distance_create(point_1, point_2, annotaion_point, distance):
77 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
79 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
80 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
81 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
83 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
84 type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
85 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
87 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
89 def radius_create(point_1, point_2, radius):
90 clickButton(waitForObject(":Constraints.Radius_AppElements_Button"))
92 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
93 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
94 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
95 type(waitForObject(":_ModuleBase_ParamSpinBox"), radius)
96 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Keypad_Enter>")
98 clickButton(waitForObject(":Constraints.Radius_AppElements_Button"))
100 def extrusion_feature(points, to_size):
101 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
102 clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))
104 mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
106 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
108 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
109 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
111 clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))