testSettings.logScreenshotOnError = True
testSettings.logScreenshotOnFail = True
+g_points = {"XY_plane": (320, 320)} # one of the construction planes
+def help_points(name):
+ return g_points[name]
+
+def set_defaults():
+ waitForObject(":OpenParts*_AppElements_MainWindow").resize(1024, 768)
+
def parameter_create(name, expression):
clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
type(waitForObject(":Parameter_QLineEdit"), name)
source(findFile("scripts", "common.py"))
startApplication("GeomApp")
+ set_defaults()
+
parameter_create("a", "100")
- point = (446, 297) # one of the construction planes
- sketch_create(point, lambda: line_create((0, 0), ("a", 0)))
+ sketch_create(points["XY_plane"], lambda: line_create((0, 0), ("a", 0)))
waitForObjectItem(":Object browser_XGUI_DataTree", "Parameters (1)")
clickItem(":Object browser_XGUI_DataTree", "Parameters (1)", -10, 10, 0, Qt.LeftButton)
source(findFile("scripts", "common.py"))
startApplication("GeomApp")
+ set_defaults()
+
parameter_create("a", "100")
part_create()
- point = (446, 297) # one of the construction planes
- sketch_create(point, lambda: circle_create(0, 0, "a"))
- points = [(489, 319)] # circle
+ sketch_create(help_points("XY_plane"), lambda: circle_create(0, 0, "a"))
+
+ points = [(313, 336)] # circle
extrusion_feature(points, "a")
source(findFile("scripts", "common.py"))
startApplication("GeomApp")
+ set_defaults()
- point = (446, 297) # one of the construction planes
- sketch_create(point, lambda: sketch())
+ sketch_create(points["XY_plane"], lambda: sketch())
radius_create(circle_border, (148, 97), 150)
# check
- circle_border = (392, 179)
+ circle_border = (335, 141)
mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), circle_border[0], circle_border[1], 0, Qt.LeftButton)
waitFor("object.exists(':Circle.CircleRadius_ModuleBase_ParamSpinBox')", 20000)
test.compare(str(findObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox").text), "150")
source(findFile("scripts", "common.py"))
startApplication("GeomApp")
+ set_defaults()
- point = (446, 297) # one of the construction planes
- sketch_create(point, lambda: sketch())
+ sketch_create(points("XY_plane"), lambda: sketch())
sendEvent("QCloseEvent", waitForObject(":OpenParts*_AppElements_MainWindow"))
clickButton(waitForObject(":Save current file.Discard_QPushButton"))