From a452d1d361624a0f48649b597bab67629d0d8a58 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 3 Apr 2025 16:47:11 +0500 Subject: [PATCH] Fix failing bim tests after 5b33c60 --- src/bonsai/test/bim/feature/misc.feature | 18 ++++--- src/bonsai/test/bim/feature/spatial.feature | 57 ++++++++++++--------- src/bonsai/test/bim/test_feature.py | 3 ++ 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/src/bonsai/test/bim/feature/misc.feature b/src/bonsai/test/bim/feature/misc.feature index 153b4ff48c..21b05b8fb0 100644 --- a/src/bonsai/test/bim/feature/misc.feature +++ b/src/bonsai/test/bim/feature/misc.feature @@ -21,14 +21,18 @@ Scenario: Resize to storey 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 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 the object "IfcWall/Cube" is selected - And the variable "storey" is "tool.Ifc.get().by_type('IfcBuildingStorey')[0].id()" - And I press "bim.set_default_container(container={storey})" - And I press "bim.assign_container(container={storey})" - When I press "bim.resize_to_storey(total_storeys=1)" + And I look at the "Spatial Decomposition" panel + And I select the "My Storey" item in the "BIM_UL_containers_manager" list + And I click "Set Default" + # Assign Container. + And I click "FOLDER_REDIRECT" + And I look at the "Miscellaneous" panel + When I click "Resize To Storey" Then nothing happens Scenario: Split along edge - boolean mode diff --git a/src/bonsai/test/bim/feature/spatial.feature b/src/bonsai/test/bim/feature/spatial.feature index 64dbbd2f12..ce64867610 100644 --- a/src/bonsai/test/bim/feature/spatial.feature +++ b/src/bonsai/test/bim/feature/spatial.feature @@ -21,14 +21,17 @@ Scenario: Assign container 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 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 the object "IfcWall/Cube" is selected - And the variable "site" is "tool.Ifc.get().by_type('IfcSite')[0].id()" - And I press "bim.set_default_container(container={site})" - And I press "bim.enable_editing_container" - When I press "bim.assign_container()" + And I look at the "Spatial Decomposition" panel + And I select the "My Site" item in the "BIM_UL_containers_manager" list + And I click "Set Default" + And I look at the "Spatial Container" panel + And I click "GREASEPENCIL" + When I click "CHECKMARK" Then the object "IfcWall/Cube" is in the collection "IfcSite/My Site" Scenario: Copy to container @@ -75,30 +78,38 @@ Scenario: Select container 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 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 the object "IfcWall/Cube" is selected - And I press "bim.enable_editing_container" - And the variable "site" is "tool.Ifc.get().by_type('IfcSite')[0].id()" - And I press "bim.set_default_container(container={site})" - And I press "bim.assign_container()" - When I press "bim.select_container" + And I look at the "Spatial Decomposition" panel + And I select the "My Site" item in the "BIM_UL_containers_manager" list + And I click "Set Default" + # Assign container. + And I look at the "Spatial Container" panel + And I click "GREASEPENCIL" + And I click "CHECKMARK" + When I click "OBJECT_DATA" Then nothing happens Scenario: Select similar container 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 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 the object "IfcWall/Cube" is selected - And I press "bim.enable_editing_container" - And the variable "site" is "tool.Ifc.get().by_type('IfcSite')[0].id()" - And I press "bim.set_default_container(container={site})" - And I press "bim.assign_container()" - When I press "bim.select_similar_container" + And I look at the "Spatial Decomposition" panel + And I select the "My Site" item in the "BIM_UL_containers_manager" list + And I click "Set Default" + # Assign container. + And I look at the "Spatial Container" panel + And I click "GREASEPENCIL" + And I click "CHECKMARK" + When I click "RESTRICT_SELECT_OFF" Then nothing happens Scenario: Execute generate space from cursor position diff --git a/src/bonsai/test/bim/test_feature.py b/src/bonsai/test/bim/test_feature.py index 2b1dc9ca63..672a72a0a5 100644 --- a/src/bonsai/test/bim/test_feature.py +++ b/src/bonsai/test/bim/test_feature.py @@ -562,6 +562,9 @@ def i_press_operator(operator): @when(parsers.parse('I click "{button}"')) @then(parsers.parse('I click "{button}"')) def i_click_button(button): + """ + :param button: The text or icon of the button to click. + """ assert panel_spy panel_spy.refresh_spy() for spied_operator in panel_spy.spied_operators: