Skip to content

Commit e9054ad

Browse files
Fix flaky viz test in test_examples_viz.py (mesa#3039)
1 parent 1383785 commit e9054ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/examples/test_examples_viz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def run_model_test(
7272
# Display and capture the updated visualizations
7373
display(space_viz)
7474
page_session.wait_for_selector("img")
75-
changed_space = page_session.locator("img").screenshot()
75+
changed_space = page_session.locator("img").first.screenshot()
7676

7777
if measure_config:
7878
display(graph_viz)
7979
page_session.wait_for_selector("img")
80-
changed_graph = page_session.locator("img").screenshot()
80+
changed_graph = page_session.locator("img").last.screenshot()
8181

8282
# Convert screenshots to base64 for comparison
8383
initial_space_encoding = base64.b64encode(initial_space).decode()

0 commit comments

Comments
 (0)