From 1d163f93bb3c664e1afb3e02f6eaf6b956ccb9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 17 Mar 2021 13:30:13 +0100 Subject: [PATCH] Move retry block outside checkbox selector --- modules/bim/spec/features/viewer/show_viewpoint_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/bim/spec/features/viewer/show_viewpoint_spec.rb b/modules/bim/spec/features/viewer/show_viewpoint_spec.rb index 73f7982860..8dc0aa2dff 100644 --- a/modules/bim/spec/features/viewer/show_viewpoint_spec.rb +++ b/modules/bim/spec/features/viewer/show_viewpoint_spec.rb @@ -61,10 +61,11 @@ describe 'Show viewpoint in model viewer', model_tree.select_sidebar_tab 'Objects' model_tree.expand_tree model_tree.expect_checked 'minimal' - model_tree.all_checkboxes.each do |label, checkbox| - retry_block do - if (label.text == 'minimal' || label.text == 'LUB_Segment_new:S_WHG_Ess:7243035') != checkbox.checked? - raise 'Checkbox checked status is wrong' + retry_block do + model_tree.all_checkboxes.each do |label, checkbox| + expect_checked = (label.text == 'minimal' || label.text == 'LUB_Segment_new:S_WHG_Ess:7243035') + if expect_checked != checkbox.checked? + raise "Expected #{label} to be #{expect_checked ? 'checked' : 'unchecked'}, but wasn't." end end end