mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Undo tests - proof of concept
Created some simple undo tests. This "flip wall and ctrl-z" test actually is crashing blender if I do it manually - so I guess undo in background mode is still kind of different.
This commit is contained in:
@@ -467,3 +467,30 @@ Scenario: Regenerate a beam - after doing nothing interesting
|
|||||||
Then the object "IfcBeam/Beam" dimensions are "0.1,0.2,3"
|
Then the object "IfcBeam/Beam" dimensions are "0.1,0.2,3"
|
||||||
And the object "IfcBeam/Beam" bottom left corner is at "0,-0.05,-0.1"
|
And the object "IfcBeam/Beam" bottom left corner is at "0,-0.05,-0.1"
|
||||||
And the object "IfcBeam/Beam" top right corner is at "3,0.05,0.1"
|
And the object "IfcBeam/Beam" top right corner is at "3,0.05,0.1"
|
||||||
|
|
||||||
|
Scenario: Undo test - create a wall and couple windows and undo the last window
|
||||||
|
Given an empty IFC project
|
||||||
|
And I load the demo construction library
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
|
||||||
|
And I press "bim.hotkey(hotkey='S_A')"
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWindowType"
|
||||||
|
And I press "bim.hotkey(hotkey='S_A')"
|
||||||
|
And I prepare to undo
|
||||||
|
And the object "IfcWall/Wall" is selected
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWindowType"
|
||||||
|
And I press "bim.hotkey(hotkey='S_A')"
|
||||||
|
And I undo
|
||||||
|
Then nothing happens
|
||||||
|
|
||||||
|
Scenario: Undo test - create a wall with window opening, flip it and undo
|
||||||
|
Given an empty IFC project
|
||||||
|
And I load the demo construction library
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWallType"
|
||||||
|
And I press "bim.hotkey(hotkey='S_A')"
|
||||||
|
And I set "scene.BIMModelProperties.ifc_class" to "IfcWindowType"
|
||||||
|
And I press "bim.hotkey(hotkey='S_A')"
|
||||||
|
And the object "IfcWall/Wall" is selected
|
||||||
|
And I prepare to undo
|
||||||
|
And I press "bim.hotkey(hotkey='S_F')"
|
||||||
|
And I undo
|
||||||
|
Then nothing happens
|
||||||
@@ -693,6 +693,20 @@ def move_cursor_bottom_left():
|
|||||||
bpy.context.window.cursor_warp(10, 10)
|
bpy.context.window.cursor_warp(10, 10)
|
||||||
|
|
||||||
|
|
||||||
|
@given(parsers.parse("I prepare to undo"))
|
||||||
|
@when(parsers.parse("I prepare to undo"))
|
||||||
|
@then(parsers.parse("I prepare to undo"))
|
||||||
|
def hit_undo():
|
||||||
|
bpy.ops.ed.undo_push(message="UNDO STEP")
|
||||||
|
|
||||||
|
|
||||||
|
@given(parsers.parse("I undo"))
|
||||||
|
@when(parsers.parse("I undo"))
|
||||||
|
@then(parsers.parse("I undo"))
|
||||||
|
def hit_undo():
|
||||||
|
bpy.ops.ed.undo_push(message="UNDO STEP")
|
||||||
|
bpy.ops.ed.undo()
|
||||||
|
|
||||||
# These definitions are not to be used in tests but simply in debugging failing tests
|
# These definitions are not to be used in tests but simply in debugging failing tests
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user