From 4c10a3c35c507d3a0b73b0d5631d523a10c2dd02 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 13 Jan 2024 10:15:38 -0800 Subject: [PATCH] Use expect(page.locator) for count --- tests/test_playwright.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_playwright.py b/tests/test_playwright.py index 0f090dd..e8e1705 100644 --- a/tests/test_playwright.py +++ b/tests/test_playwright.py @@ -25,5 +25,4 @@ def test_markers_are_displayed(ds_server, table, page): page.goto(ds_server + "/data/" + table) # There should be two leaflet-marker-icons - page.wait_for_selector(".leaflet-marker-icon", timeout=3000) - assert len(page.query_selector_all(".leaflet-marker-icon")) == 2 + sync_api.expect(page.locator(".leaflet-marker-icon")).to_have_count(2)