Skip to content

[Bug]: PlaywrightAssertions.assertThat(locator).isEnabled(new IsEnabledOptions().setEnabled(false)) started failing in version 1.52.0 #1837

@RichMacDonald

Description

@RichMacDonald

Version

Works in 1.51.0. Broken 1.52.0 and later

Steps to reproduce

Between version 1.51.0 and 1.52.0, the LocatorAssertions.isEnabled (and isDisabled) methods broke when the element is disabled.

IsEnabledOptions options = new IsEnabledOptions().setEnabled(false);
PlaywrightAssertions.assertThat(locator).isEnabled(options);

Or:

IsDisabledOptions options = new IsDisabledOptions();
PlaywrightAssertions.assertThat(locator).isDisabled(options);

The code loops until timeout with the following log messages:

pw:api unexpected value "enabled"
pw:api locator resolved to <vaadin-menu-bar-item disabled id="saveMenu" aria-disabled="true" aria-selected="false">Save</vaadin-menu-bar-item>

The problem exists in the latest version as well. It used to work in version 1.51.0 and earlier.

Expected behavior

I expect it to return success.

Actual behavior

Caused by: org.opentest4j.AssertionFailedError: Locator expected to be disabled
Call log:

  • Locator.expect with timeout 30000ms
  • waiting for locator("internal:attr=[id="saveMenu"]")
    32 × locator resolved to Save
    • unexpected value "enabled"
      at com.microsoft.playwright.impl.AssertionsBase.expectImpl(AssertionsBase.java:69)
      at com.microsoft.playwright.impl.AssertionsBase.expectImpl(AssertionsBase.java:50)
      at com.microsoft.playwright.impl.LocatorAssertionsImpl.expectTrue(LocatorAssertionsImpl.java:464)
      at com.microsoft.playwright.impl.LocatorAssertionsImpl.isDisabled(LocatorAssertionsImpl.java:411)
      at com.mri.test.playwright.util.LocatorAssert.assertEnabled(LocatorAssert.java:50)

Additional context

No response

Environment

Operating System: Windows 11
Browser: Firefox
Java version: 23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions