clj-commons / etaoin

Pure Clojure Webdriver protocol implementation
https://cljdoc.org/d/etaoin
Eclipse Public License 1.0
915 stars 95 forks source link

`:fn/enabled` doen't work #661

Closed dgr closed 1 month ago

dgr commented 1 month ago

Version 1.1.41

Platform All

Symptom Using :fn/enabled in a query doesn't correctly return enabled and disabled elements.

Expected behavior Should act as the opposite of :fn/disabled.

Diagnosis The code creates an XPath expression of [@enabled=true()] or [@enabled=false()]. Neither of these is effective because the DOM only includes an attribute named disabled; it does not have an attribute named enabled. Thus, we have to search for disabled with the opposite boolean flag (e.g., [@enabled=true()] must be turned into [@disabled=false()]).

Action I'll submit a PR.