Skip to content

Commit 0b593a5

Browse files
committed
Fix one instance of test flakiness
1 parent 90a6308 commit 0b593a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_app/tests/test_components.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ def test_model_form(self):
791791
self.page.wait_for_selector(".errorlist")
792792

793793
# Submitting an empty form should result in 1 error element.
794-
assert len(self.page.query_selector_all(".errorlist")) == 1
794+
error_list = self.page.locator(".errorlist").all()
795+
assert len(error_list) == 1
795796

796797
# Fill out the form
797798
self.page.locator("#id_text").type(uuid, delay=CLICK_DELAY)
@@ -800,7 +801,7 @@ def test_model_form(self):
800801
self.page.wait_for_selector("input[type=submit]").click(delay=CLICK_DELAY)
801802

802803
# Wait for the error message to disappear (indicating that the form has been re-rendered)
803-
expect(self.page.locator(".errorlist").all()[0]).not_to_be_attached()
804+
expect(error_list[0]).not_to_be_attached()
804805

805806
# Make sure no errors remain
806807
assert len(self.page.query_selector_all(".errorlist")) == 0

0 commit comments

Comments
 (0)