1 testSettings.logScreenshotOnError = True
2 testSettings.logScreenshotOnFail = True
4 def parameter_create(name, expression):
5 clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
6 type(waitForObject(":Parameter_QLineEdit"), name)
7 type(waitForObject(":Parameter_ExpressionEditor"), expression)
8 clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
11 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
12 clickButton(waitForObject(":Operations.New part_AppElements_Button"))
14 def sketch_create(point, actions):
15 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
16 clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
17 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
21 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
23 def point_create(point):
24 clickButton(waitForObject(":Basic.Point_AppElements_Button"))
26 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
27 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
28 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
29 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
31 clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
33 def line_create(start_point, end_point):
34 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
36 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
37 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
38 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
39 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
41 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
42 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
43 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
44 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
46 clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))
48 def circle_create(x, y, radius):
49 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
51 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
52 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
53 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
54 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
56 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
57 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
59 clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
61 def distance_create(point_1, point_2, annotaion_point, distance):
62 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
64 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
65 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
66 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
68 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
69 type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
70 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
72 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
74 def extrusion_feature(points, to_size):
75 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
76 clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))
78 mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
80 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
82 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
83 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
85 clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))