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

:no-doc to :private #651

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ A release with an intentional breaking changes is marked with:
** {issue}642[#642]: Add `driver-type` to retrieve driver type keyword. ({person}dgr[@dgr])
** {issue}644[#644]: Deprecate `when-predicate` and `when-not-predicate` macros. See docstrings for guidance on alternatives. These will may be removed from the API at the next release that contains breaking changes. ({person}dgr[@dgr])
** {issue}647[#647]: Fix logic bug in `intersects?`. Added tests to test suite. ({person}dgr[@dgr])
** {issue}633[#633]: The `dispatch-driver` function is an implementation function and has been marked `:private`.
** {issue}633[#633]: Duplicate definitions of `locator-xpath` and `locator-css` have been removed from the `etaoin.api` namespace. If you need these definitions, use the ones in `etaoin.query`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reword this? This sounds like a breaking change, but is not.
These vars were not part of the public API in the api ns, so folks should not have been using them anyway.
Actually... since it is non-breaking, you can just not mention it in the changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you just want me to strip it out entirely? If so, can do. Easy peasy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.


== v1.1.41 [minor breaking] - 2024-08-14 [[v1.1.41]]

Expand Down
14 changes: 6 additions & 8 deletions src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@
;;
;; WebDriver defaults
;;
(def ^:no-doc default-locator "xpath")
(def ^:no-doc locator-xpath "xpath")
(def ^:no-doc locator-css "css selector")
(def ^:private default-locator query/locator-xpath)

(def ^{:doc "WebDriver global option defaults"} defaults-global
{:locator default-locator
Expand Down Expand Up @@ -208,7 +206,7 @@
;; utils
;;

(defn ^:no-doc dispatch-driver
(defn- dispatch-driver
"Returns the current driver's type. Used as dispatcher in
multimethods."
[driver & _]
Expand Down Expand Up @@ -2099,12 +2097,12 @@
(defn use-xpath
"Return new `driver` with default locator set to XPath."
[driver]
(use-locator driver locator-xpath))
(use-locator driver query/locator-xpath))

(defn use-css
"Return new `driver` with default locator set to CSS."
[driver]
(use-locator driver locator-css))
(use-locator driver query/locator-css))

(defmacro ^:no-doc with-locator [driver locator & body]
`(binding [~driver (assoc ~driver :locator ~locator)]
Expand All @@ -2113,13 +2111,13 @@
(defmacro with-xpath
"Execute `body` with default locator set to XPath."
[driver & body]
`(with-locator ~driver locator-xpath
`(with-locator ~driver query/locator-xpath
~@body))

(defmacro with-css
"Execute `body` with default locator set to CSS."
[driver & body]
`(with-locator ~driver locator-css
`(with-locator ~driver query/locator-css
~@body))

;;
Expand Down
3 changes: 2 additions & 1 deletion src/etaoin/ide/impl/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[clojure.test :refer [is]]
[clojure.tools.logging :as log]
[etaoin.api :as e]
[etaoin.query :as query]
[etaoin.impl.util :refer [defmethods]]
[etaoin.keys :as k]))

Expand Down Expand Up @@ -433,7 +434,7 @@
(defmethod run-command
:storeXpathCount
[driver {:keys [target value]} & [{vars :vars}]]
(let [cnt (count (e/find-elements* driver e/locator-xpath target))]
(let [cnt (count (e/find-elements* driver query/locator-xpath target))]
(swap! vars assoc (str->var value) cnt)))

(defmethod run-command
Expand Down
1 change: 0 additions & 1 deletion src/etaoin/query.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

(set! *warn-on-reflection* true)

;; todo duplicates with api.clj
(def locator-xpath "xpath")
(def locator-css "css selector")

Expand Down
30 changes: 15 additions & 15 deletions test/etaoin/api_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,21 @@
(is (= (f data) (e/get-element-value *driver* f)))))))

(deftest test-unicode-above-bmp-input
;; as of 2023-04-29 not supported on chrome and edge
;; https://bugs.chromium.org/p/chromedriver/issues/detail?id=2269
(when-not (#{:chrome :edge} (e/dispatch-driver *driver*))
(let [data {:simple-input "😊🍂input🍃"
:simple-password "🔆password☠️ "
:simple-textarea "🎉🚀textarea👀☀️"}]
(testing "fill-multi"
(e/fill-multi *driver* data)
(doseq [f [:simple-input :simple-password :simple-textarea]]
(is (= (f data) (e/get-element-value *driver* f)))))
(testing "fill-human-multi"
(e/refresh *driver*)
(e/fill-human-multi *driver* data)
(doseq [f [:simple-input :simple-password :simple-textarea]]
(is (= (f data) (e/get-element-value *driver* f))))))))
;; as of 2023-04-29 not supported on chrome and edge
;; https://bugs.chromium.org/p/chromedriver/issues/detail?id=2269
(e/when-not-drivers #{:chrome :edge} *driver*
(let [data {:simple-input "😊🍂input🍃"
:simple-password "🔆password☠️ "
:simple-textarea "🎉🚀textarea👀☀️"}]
(testing "fill-multi"
(e/fill-multi *driver* data)
(doseq [f [:simple-input :simple-password :simple-textarea]]
(is (= (f data) (e/get-element-value *driver* f)))))
(testing "fill-human-multi"
(e/refresh *driver*)
(e/fill-human-multi *driver* data)
(doseq [f [:simple-input :simple-password :simple-textarea]]
(is (= (f data) (e/get-element-value *driver* f))))))))

(deftest test-clear
(testing "simple clear"
Expand Down
Loading