From 8535587a2c2883167a6d2ae16ddccf271dd8675f Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 7 Oct 2024 17:37:37 -0700 Subject: [PATCH] Use `.to_have_count()` to avoid test flakiness (#262) --- form-designer/tests/test_create_form.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/form-designer/tests/test_create_form.py b/form-designer/tests/test_create_form.py index 06aa6962..22679a38 100644 --- a/form-designer/tests/test_create_form.py +++ b/form-designer/tests/test_create_form.py @@ -132,9 +132,9 @@ def _url(url): # There should be two responses triggers = page.locator(".AccordionTrigger") - assert triggers.count() == 2 + expect(triggers).to_have_count(2) contents = page.locator(".AccordionContent") - assert contents.count() == 2 + expect(contents).to_have_count(2) # Open the second response triggers.nth(1).click() @@ -152,4 +152,4 @@ def _url(url): triggers.nth(0).click() # There should be one response now - assert triggers.count() == 1 + expect(triggers).to_have_count(1)