Capybara: The .disabled? method does not work correctly on fieldsets

Created on 27 Jun 2018  路  5Comments  路  Source: teamcapybara/capybara

Meta

Capybara Version: 3.3.0

Driver Information (and browser if relevant): selenium-webdriver 3.10.0 and Chrome Headless 67.0.3396.87

Expected Behavior

find('fieldset')[:disabled]
# => true
find('fieldset').disabled?
# => true

Actual Behavior

find('fieldset')[:disabled]
# => true
find('fieldset').disabled?
# => false

Additional information

https://github.com/teamcapybara/capybara/issues/1925#issuecomment-336933569
https://www.w3.org/TR/html51/disabled-elements.html#disabled-elements

Most helpful comment

Released

All 5 comments

This is because the WebDriver spec only defines disabled for form controls, but when reading the HTML spec it doesn't make any sense not to define it for fieldset elements as well. Please try the disable_fieldset branch and let me know if it fixes your issue.

Solves the issue perfectly. Thanks mate! And thank you for the quick fix! :)

Could you make a patch release for this? This would be really awesome.

Will probably go out in a 3.3.1 release later today, waiting for tests to complete on this and another issue.

Released

Was this page helpful?
0 / 5 - 0 ratings