diff --git a/tests/testflows/steps/panel/view.py b/tests/testflows/steps/panel/view.py index 6fba00595..0a50c76e7 100644 --- a/tests/testflows/steps/panel/view.py +++ b/tests/testflows/steps/panel/view.py @@ -688,7 +688,7 @@ def save_dashboard(self): click_save_confirmation_button() @TestStep(When) -def check_no_labels(self, labels): +def check_no_labels_on_visualization(self, labels): """Check there is no labels in the panel.""" for label in labels: @@ -696,7 +696,7 @@ def check_no_labels(self, labels): try: ui.wait_for_element_to_be_visible( select_type=SelectBy.XPATH, - element=f'//*[contains(text(), "{label}")]' + element=f'//*[@data-viz-panel-key]//*[contains(text(), "{label}")]' ) return False except: diff --git a/tests/testflows/tests/automated/e2e.py b/tests/testflows/tests/automated/e2e.py index 4bba0f47b..c0f01d988 100644 --- a/tests/testflows/tests/automated/e2e.py +++ b/tests/testflows/tests/automated/e2e.py @@ -229,7 +229,7 @@ def many_categories(self): with Then("I check there is no errors on the visualization"): with delay(): - assert panel.check_no_labels(labels=["normalized_query_hash", "Too many points"]), error() + assert panel.check_no_labels_on_visualization(labels=["normalized_query_hash", "Too many points"]), error() finally: with Finally("I discard changes for panel"): with delay():