From 605c86afc5c63cf162a7f36a339721806afc78a9 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 3 Apr 2025 17:43:49 +0500 Subject: [PATCH] Fix void bim tests after bim.add_potential_opening was removed --- src/bonsai/test/bim/feature/void.feature | 33 +++++++++++++++--------- src/bonsai/test/bim/test_feature.py | 4 +++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/bonsai/test/bim/feature/void.feature b/src/bonsai/test/bim/feature/void.feature index a02699e19b..cc98831e0c 100644 --- a/src/bonsai/test/bim/feature/void.feature +++ b/src/bonsai/test/bim/feature/void.feature @@ -25,7 +25,8 @@ Scenario: Add an opening using the BIM tool And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected When I press "bim.add_opening" @@ -36,10 +37,12 @@ Scenario: Show openings Given an empty IFC project And I add a cube And the object "Cube" is selected - And I set "scene.BIMRootProperties.ifc_product" to "IfcElement" - And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" - And I press "bim.assign_class" - And I press "bim.add_potential_opening" + And I look at the "Class" panel + And I set the "Products" property to "IfcElement" + And I set the "Class" property to "IfcWall" + And I click "Assign IFC Class" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -56,7 +59,8 @@ Scenario: Hide openings And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -73,7 +77,8 @@ Scenario: Edit openings And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -97,7 +102,8 @@ Scenario: Add an opening to Element B with a void that already voids Element A And the object "Cube" is selected And I press "bim.assign_class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -120,7 +126,8 @@ Scenario: Remove opening And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -140,7 +147,8 @@ Scenario: Remove opening - using deletion And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -159,7 +167,8 @@ Scenario: Remove opening - indirectly by deleting its building element And I set the "Products" property to "IfcElement" And I set the "Class" property to "IfcWall" And I click "Assign IFC Class" - And I press "bim.add_potential_opening" + And I add a cube + And I rename the object "Cube" to "Opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" @@ -167,4 +176,4 @@ Scenario: Remove opening - indirectly by deleting its building element And I press "bim.show_openings" When the object "IfcWall/Cube" is selected And I delete the selected objects - Then the object "Opening" is not an IFC element + Then the object "IfcOpeningElement/Opening" does not exist diff --git a/src/bonsai/test/bim/test_feature.py b/src/bonsai/test/bim/test_feature.py index 672a72a0a5..121ce197b0 100644 --- a/src/bonsai/test/bim/test_feature.py +++ b/src/bonsai/test/bim/test_feature.py @@ -351,6 +351,10 @@ def i_see_the_prop_property_is_value(prop, value): @when(parsers.parse('I set the "{prop}" property to "{value}"')) @then(parsers.parse('I set the "{prop}" property to "{value}"')) def i_set_the_prop_property_to_value(prop: str, value: str): + """ + :param prop: Could be either property name, property text, property icon + or property index (e.g. "1st", "2nd", "5th"). + """ value = value.strip() assert panel_spy panel_spy.refresh_spy()