Add basic parametric objects tests #7355

This commit is contained in:
Andrej730
2025-11-13 19:11:19 +05:00
parent 166ddb4799
commit fe80620a5d
5 changed files with 60 additions and 9 deletions
+45
View File
@@ -755,3 +755,48 @@ Scenario: Generate a space from cursor location
And I press "bim.generate_space"
Then the object "IfcSpace/Space" exists
And the object "IfcSpace/Space" dimensions are "1,0.8,3"
Scenario: Add and edit parametric stair
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I look at the "Class" panel
And I set the "Products" property to "IfcElement"
And I set the "Class" property to "IfcStairFlight"
And I click "Assign IFC Class"
And I look at the "Stair" panel
And I click "ADD"
And I look at the "Stair" panel
And I click "GREASEPENCIL"
And I look at the "Stair" panel
And I click "CHECKMARK"
Scenario: Add and edit parametric window
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I look at the "Class" panel
And I set the "Products" property to "IfcElement"
And I set the "Class" property to "IfcWindow"
And I click "Assign IFC Class"
And I look at the "BIM_PT_window" panel
And I click "ADD"
And I look at the "BIM_PT_window" panel
And I click "GREASEPENCIL"
And I look at the "BIM_PT_window" panel
And I click "CHECKMARK"
Scenario: Add and edit parametric door
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I look at the "Class" panel
And I set the "Products" property to "IfcElement"
And I set the "Class" property to "IfcDoor"
And I click "Assign IFC Class"
And I look at the "Door" panel
And I click "ADD"
And I look at the "Door" panel
And I click "GREASEPENCIL"
And I look at the "Door" panel
And I click "CHECKMARK"
+12 -6
View File
@@ -351,13 +351,19 @@ def the_brickschema_is_stubbed():
@given(parsers.parse('I look at the "{panel}" panel'))
@when(parsers.parse('I look at the "{panel}" panel'))
@then(parsers.parse('I look at the "{panel}" panel'))
def i_look_at_the_panel_panel(panel):
global ui_name_cache
def i_look_at_the_panel_panel(panel: str) -> None:
# Option to provide explicit panel name if panel names overlap.
panel_class = getattr(bpy.types, panel, None)
if panel_class is None:
global ui_name_cache
create_ui_name_cache()
if panel not in ui_name_cache:
assert False, f"Panel '{panel}' not found in `bpy.types` and in {ui_name_cache}"
panel_class = getattr(bpy.types, ui_name_cache[panel])
global panel_spy
create_ui_name_cache()
if panel not in ui_name_cache:
assert False, f"Panel {panel} not found in {ui_name_cache}"
panel_spy = PanelSpy(getattr(bpy.types, ui_name_cache[panel]))
panel_spy = PanelSpy(panel_class)
panel_spy.refresh_spy()