Skip to content

Commit 86dea27

Browse files
committed
Fix flickering split screen spec by waiting for the relation tab to be loaded before checking for missing elements.
1 parent 3b9e155 commit 86dea27

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: spec/support/components/work_packages/relations.rb

+9
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,18 @@ def find_relatable(relatable)
5656
end
5757
end
5858

59+
def expect_tab_is_loaded
60+
within("wp-relations-tab") do
61+
expect(page).to have_no_css("op-content-loader")
62+
end
63+
end
64+
5965
def expect_add_relation_button
6066
expect(page).to have_test_selector("new-relation-action-menu")
6167
end
6268

6369
def expect_no_add_relation_button
70+
expect_tab_is_loaded # Make sure the tab is loaded before checking non existing elements
6471
expect(page).not_to have_test_selector("new-relation-action-menu")
6572
end
6673

@@ -83,6 +90,7 @@ def expect_row(work_package)
8390
end
8491

8592
def expect_no_row(relatable)
93+
expect_tab_is_loaded # Make sure the tab is loaded before checking non existing elements
8694
actual_relatable = find_relatable(relatable)
8795
expect(page).not_to have_test_selector("op-relation-row-visible-#{actual_relatable.id}"),
8896
"expected no relation row for work package " \
@@ -303,6 +311,7 @@ def expect_parent(work_package)
303311
end
304312

305313
def expect_no_parent
314+
expect_tab_is_loaded # Make sure the tab is loaded before checking non existing elements
306315
expect(page).not_to have_test_selector "op-wp-breadcrumb-parent", wait: 10
307316
end
308317

0 commit comments

Comments
 (0)