mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 13:02:50 -05:00
Check native undo after drawing through the canvas
This commit is contained in:
1 parent
23fd670d88
commit
db6ecce881
1 file changed
+6
-1
@@ -60,7 +60,12 @@ try:
|
||||
print("Control key M selected:",tool,flush=True)
|
||||
if tool != "rectangle":
|
||||
raise RuntimeError("OS key input did not reach the app; no Undo result can be inferred")
|
||||
made=engine("shape.rectangle",x=20,y=20,width=60,height=50)["id"]
|
||||
call("ui.drag", dict(x=x+w*.35,y=y+h*.36,toX=x+w*.55,toY=y+h*.59,steps=9))
|
||||
time.sleep(.5)
|
||||
doc=engine("document.inspect")
|
||||
children=[child for layer in doc["layers"] for child in layer.get("children",[])]
|
||||
assert len(children)==1, ("GUI gesture did not draw exactly one rectangle",doc)
|
||||
made=children[0]["id"]
|
||||
def exists():
|
||||
doc=engine("document.inspect")
|
||||
return any(child["id"]==made for layer in doc["layers"] for child in layer.get("children",[]))
|
||||
|
||||
Reference in new issue
Block a user