-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Version
1.54
Steps to reproduce
On latest (1.54) version, sometimes, page.locator().check()
throws following error, we have few tests where this started consistently happening:
playwright._impl._errors.Error: Locator.check: Clicking the checkbox did not change its state
Call log:
- waiting for locator(".shared-checkbox.item .input").nth(1)
- locator resolved to
- attempting click action
- waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- performing click action
- click action done
- waiting for scheduled navigations to finish
- navigations have finished
Tests open a webpage, and click few checkboxes with page.locator().check()
, e.g.:
def test_webpage(page, test_eligibility_session):
p = pom.Homepage(page, plan_id=plan.id)
logger.info("check that associated group is linked")
with p.page.expect_response(lambda resp: resp.request.method == "POST" and resp.url.endswith("/group/list")):
p.page.locator(p.ASSOCIATED_GROUP).click()
expect(p.table.rows[0]["Group Name"]).to_have_text(group_version.name)
logger.info("fill Effective date")
p.page.locator(p.EFFECTIVE_DATE_INPUT).fill(arrow.now().shift(days=-1).strftime("%m/%d/%Y"))
logger.info("fill Termination date")
p.page.locator(p.TERMINATION_DATE_INPUT).fill(arrow.now().shift(years=10).strftime("%m/%d/%Y"))
for election in p.page.locator(".shared-checkbox.item .input").all():
election.check()
Expected behavior
Checkbox should be checked without errors.
Actual behavior
Checkbox state gets updated just fine, when watching a recording, I see that checkbox is actually being checked, but subsequent checkbox action verifications fail with above error.
Additional context
We have been using 1.50 successfully with over >900 tests, but with recent attempts to upgrade to 1.54 version and with no other changes to our framework we are consistently getting this error across only a few tests.
I'm wondering if it's something with our UI but given that 1.50 and all previous versions worked fine, suspecting it's something with recent 1.54 version that have changed this behavior.
There is also similar issue here: #13470
Environment
- Operating System: Ubuntu 22.04
- CPU: arm64
- Browser: chromium
- Python Version: 3.12.3