Skip to content

Commit

Permalink
wait for value to appear
Browse files Browse the repository at this point in the history
  • Loading branch information
l0uden committed Jan 29, 2025
1 parent 8688014 commit e0f3752
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions vizro-core/tests/e2e/test_component_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
value_column="Actual",
title="KPI with aggregation",
agg_func="median",
icon="folder_check_2",
),
kpi_card(
data_frame=df_kpi,
Expand Down Expand Up @@ -82,8 +83,20 @@ def test_kpi_card_component_library(dash_duo, request):
]
)
dash_duo.start_server(app)
dash_duo.wait_for_page(timeout=20)
dash_duo.wait_for_text_to_equal(".material-symbols-outlined", "shopping_cart")
dash_duo.wait_for_text_to_equal(
"div[class='vstack gap-4'] div:nth-of-type(1) div:nth-of-type(2) p[class='material-symbols-outlined']",
"folder_check_2",
)
dash_duo.wait_for_text_to_equal(
"div[class='vstack gap-4'] div:nth-of-type(1) div:nth-of-type(2) div[class='card-body']", "200.0"
)
dash_duo.wait_for_text_to_equal(
"div[class='vstack gap-4'] div:nth-of-type(2) div:nth-of-type(4) p[class='material-symbols-outlined']",
"shopping_cart",
)
dash_duo.wait_for_text_to_equal(
"div[class='vstack gap-4'] div:nth-of-type(2) div:nth-of-type(4) div[class='card-body']", "1000"
)
result_image_path, expected_image_path = make_screenshot_and_paths(dash_duo.driver, request.node.name)
assert_image_equal(result_image_path, expected_image_path)
assert dash_duo.get_logs() == [], "browser console should contain no error"

0 comments on commit e0f3752

Please sign in to comment.