Skip to content

Commit

Permalink
minor breaking: Remove support for PhantomJS (#614)
Browse files Browse the repository at this point in the history
PhantomJS is long obsolete, and we dropped testing for it long ago.
Supporting API, code and docs are clutter at this point.

Closes #612
  • Loading branch information
lread authored Aug 7, 2024
1 parent bb56708 commit 46a5642
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 222 deletions.
2 changes: 0 additions & 2 deletions .cljfmt.edn
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
when-not-edge [[:inner 0]]
when-not-firefox [[:inner 0]]
when-not-headless [[:inner 0]]
when-not-phantom [[:inner 0]]
when-not-predicate [[:inner 0]]
when-not-safari [[:inner 0]]
when-phantom [[:inner 0]]
when-predicate [[:inner 0]]
when-safari [[:inner 0]]
try+ [[:block 0]]}}
33 changes: 19 additions & 14 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,36 @@ A release with an intentional breaking changes is marked with:
// - unreleased section empty
// - optional attribute is not [breaking] or [minor breaking]
// (adjust these in publish.clj as you see fit)
== Unreleased
== Unreleased [minor breaking]

* {pr}552[#552]: Add support for wide characters to input fill functions
* Technically breaking
** {issue}613[#612]: Remove all support for long obsolete and long untested PhantomJS
({lread})

* Other changes
** {pr}552[#552]: Add support for wide characters to input fill functions
({person}tupini07[@tupini07])
* {issue}566[#566]: Recognize `:driver-log-level` for Edge
** {issue}566[#566]: Recognize `:driver-log-level` for Edge
({lread})
* {issue}563[#563]: Support `"debug"` `:driver-log-level` for Safari
** {issue}563[#563]: Support `"debug"` `:driver-log-level` for Safari
({lread})
* {issue}517[#517]: Properly cleanup after failed webdriver launch
** {issue}517[#517]: Properly cleanup after failed webdriver launch
({lread})
* {issue}604[#604]: Add support for shadow DOM
** {issue}604[#604]: Add support for shadow DOM
({person}dgr[@dgr])
* {issue}603[#603]: Add :fn/index as alias for :index in map syntax
** {issue}603[#603]: Add :fn/index as alias for :index in map syntax
({person}dgr[@dgr])
* bump all deps to current versions
** bump all deps to current versions
({lread})
* tests
** {issue}572[#572]: stop using chrome `--no-sandbox` option, it has become problematic on Windows (and we did not need it anyway)
** tests
*** {issue}572[#572]: stop using chrome `--no-sandbox` option, it has become problematic on Windows (and we did not need it anyway)
({lread})
* docs
** {issue}534[#534]: better describe `etaoin.api/select` and its alternatives
** docs
*** {issue}534[#534]: better describe `etaoin.api/select` and its alternatives
({lread})
** {issue}536[#536]: user guide examples are now all os agnostic and CI tested via test-doc-blocks on all supported OSes
*** {issue}536[#536]: user guide examples are now all os agnostic and CI tested via test-doc-blocks on all supported OSes
({lread})
** {issue}602[#602]: Document all `:fn/*` query pseudo-functions in a definitive list
*** {issue}602[#602]: Document all `:fn/*` query pseudo-functions in a definitive list
({person}dgr[@dgr])

== v1.0.40 - 2023-03-08 [[v1.0.40]]
Expand Down
18 changes: 2 additions & 16 deletions doc/01-user-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Etaoin's test suite covers the following OSes and browsers for both Clojure and
|===

1. Our GitHub Actions macOS tests run on silicon (aka arm64, aarch64 or M*) hardware
2. We did once test against PhantomJS, but since work has long ago stopped on this project, we have dropped testing

== Installation

Expand Down Expand Up @@ -130,7 +129,6 @@ For a quieter Etaoin experience when using babashka, set the timbre default log
:url-chromedriver: https://sites.google.com/chromium.org/driver/
:url-chromedriver-dl: https://sites.google.com/chromium.org/driver/downloads
:url-geckodriver-dl: https://github.com/mozilla/geckodriver/releases
:url-phantom-dl: http://phantomjs.org/download.html
:url-webkit: https://webkit.org/blog/6900/webdriver-support-in-safari-10/
:url-edge-dl: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

Expand Down Expand Up @@ -175,12 +173,6 @@ Edge and `msedgedriver` must match so you might need to specify the version:
`scoop install [email protected]`
** Download: link:{url-edge-dl}[Official Microsoft download site]

* Phantom.js browser +
(obsolete, no longer tested)
** macOS: `brew install phantomjs`
** Windows: `scoop install phantomjs`
** Download: link:{url-phantom-dl}[Official PhantomJS download site]

Check your WebDriver installations launching by launching these commands.
Each should start a process that includes its own local HTTP server.
Use Ctrl-C to terminate.
Expand All @@ -191,7 +183,6 @@ chromedriver
geckodriver
safaridriver -p 0
msedgedriver
phantomjs --wd
----

You can optionally run the Etaoin test suite to verify your installation.
Expand Down Expand Up @@ -1070,7 +1061,7 @@ It acts the same but raises an exception when querying the page returns multiple

Although double-clicking is rarely purposefully employed on web sites, some naive users might think it is the correct way to click on a button or link.

A double-click can be simulated with `double-click` function (Chrome, Phantom.js).
A double-click can be simulated with `double-click` function (Chrome).
It can be used, for example, to check your handling of disallowing multiple form submissions.

[source,clojure]
Expand Down Expand Up @@ -1812,10 +1803,9 @@ Each map has the following structure:
;; => []
----

Currently, logs are available in Chrome and Phantom.js only.
Currently, logs are available in Chrome only.
The message text and the source type will vary by browser vendor.
Chrome wipes the logs once they have been read.
Phantom.js wipes the logs when the page location changes.

=== DevTools: Tracking HTTP Requests, XHR (Ajax) [[devtools]]

Expand Down Expand Up @@ -2343,7 +2333,6 @@ values vary by browser driver vendor:
** has only one detailed log level which we enable via its `--diagnose` option and abstract via `"debug"`
** only logs to a log file which Etaion automatically discovers and populates as <<opt-driver-log-file>> in the `driver` map
** see <<opt-post-stop-fns>> for one way to dump this log file
* phantomjs "ERROR"` `"WARN"` `"INFO"` `"DEBUG"`

[id=opt-log-stdout,reftext=`:log-stdout`]
[id=opt-log-stderr,reftext=`:log-sterr`]
Expand Down Expand Up @@ -2498,7 +2487,6 @@ Running without a UI is helpful when:
* running local tests without having them take over your local UI

Ensure your browser supports headless mode by checking if it accepts `--headless` command-line argument when running it from the terminal.
The Phantom.js driver is headless by its nature (it was never been developed for rendering UI).

When starting a driver, pass the `:headless` boolean flag to switch into headless mode.
This flag is ignored for Safari which, as of June 2022, still does not support headless mode.
Expand Down Expand Up @@ -2526,8 +2514,6 @@ or
(e/quit driver)
----

NOTE: PhantomJS will always be in headless mode.

There are several shortcuts to run Chrome or Firefox in headless mode:

//{:test-doc-blocks/test-ns user-guide-headless-test}
Expand Down
1 change: 0 additions & 1 deletion doc/02-developer-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,3 @@ So, when adding any new macros, think also about our Etaoin users and our clj-ko

* https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/[chromedriver]
* https://github.com/mozilla/geckodriver[firefox geckodriver], https://searchfox.org/mozilla-central/source/testing/webdriver[sources]
* https://github.com/detro/ghostdriver/blob/[Phantom.js (obsolete, no longer tested)]
2 changes: 0 additions & 2 deletions resources/clj-kondo.exports/etaoin/etaoin/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
etaoin.api/with-firefox-headless etaoin.api/with-browser
etaoin.api/with-edge etaoin.api/with-browser
etaoin.api/with-edge-headless etaoin.api/with-browser
etaoin.api/with-phantom etaoin.api/with-browser
etaoin.api/with-safari etaoin.api/with-browser

etaoin.api/with-driver etaoin.api/with-driver
Expand All @@ -26,7 +25,6 @@
etaoin.api2/with-edge-headless etaoin.api2/with-browser
etaoin.api2/with-firefox etaoin.api2/with-browser
etaoin.api2/with-firefox-headless etaoin.api2/with-browser
etaoin.api2/with-phantom etaoin.api2/with-browser
etaoin.api2/with-safari etaoin.api2/with-browser}}
:lint-as
{etaoin.api/with-pointer-left-btn-down clojure.core/->}}
3 changes: 1 addition & 2 deletions script/drivers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
[{:name "Chrome" :bin "chromedriver"}
{:name "Firefox":bin "geckodriver"}
{:name "Microsoft Edge" :bin "msedgedriver"}
{:name "Safari" :bin "safaridriver"}
{:name "PhantomJS" :bin "phantomjs"}])
{:name "Safari" :bin "safaridriver"}])

(defn driver-processes []
(->> (ps/all-processes)
Expand Down
Loading

0 comments on commit 46a5642

Please sign in to comment.