Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix :fn/enabled #662

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ A release with an intentional breaking changes is marked with:
** {issue}647[#647]: Fix logic bug in `intersects?`. Added tests to test suite. ({person}dgr[@dgr])
** {issue}649[#649]: When supplied a vector argument for `q-text`, `fill-multi` and `fill-human-multi` now fill fields in the order that fields appear in the vector. Previously, the order was not guaranteed. ({person}dgr[@dgr])
** {issue}657[#657]: Make `set-<xyz>-timeout` functions resilient to reasonable non-integer timeouts (e.g., rationals, doubles, etc.). ({person}dgr[@dgr])
** {issue}661[#661]: Fix `:fn/enabled`. ({person}dgr[@dgr])
* Docs
** {issue}656[#656]: Correctly describe behavior when query's parameter is a string. The User Guide and `query` doc strings say that a string passed to `query` is interpreted as an XPath expression. In fact, `query` interprets this as either XPath or CSS depending on the setting of the driver's `:locator` parameter, which can be changed. ({person}dgr[@dgr])

Expand Down
2 changes: 1 addition & 1 deletion src/etaoin/impl/xpath.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

(defmethod clause :fn/enabled
[[_ bool]]
(node-boolean "@enabled" bool))
(node-boolean "@disabled" (not bool)))

(defmethod clause :fn/index
[[_ idx]]
Expand Down
9 changes: 6 additions & 3 deletions test/etaoin/unit/xpath_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@

[{:tag :input :fn/disabled true} ".//input[@disabled=true()]"]

[{:tag :input :fn/enabled false} ".//input[@enabled=false()]"]
[{:tag :input :fn/enabled false} ".//input[@disabled=true()]"]

[{:tag :a :fn/link "yandex"} ".//a[contains(@href, \"yandex\")]"]
])
[{:tag :input :fn/disabled false} ".//input[@disabled=false()]"]

[{:tag :input :fn/enabled true} ".//input[@disabled=false()]"]

[{:tag :a :fn/link "yandex"} ".//a[contains(@href, \"yandex\")]"]])

(deftest test-xpath-expand
(doseq [[q xpath] xpath-samples]
Expand Down
Loading