Skip to content

Commit cbe7d16

Browse files
committed
drop phantomjs
1 parent 0573c22 commit cbe7d16

5 files changed

Lines changed: 4 additions & 34 deletions

File tree

Dockerfile

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM --platform=linux/amd64 ubuntu:24.04
22

33
ENV FIREFOX_VERSION="138.0.4"
4-
ENV PHANTOMJS_VERSION="2.1.1"
54
ENV GECKODRIVER_VERSION="0.36.0"
65

76
ENV INSTALL="apt-get install -y --no-install-recommends"
@@ -37,21 +36,6 @@ RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.d
3736

3837
RUN google-chrome --version
3938

40-
# phantomjs setup
41-
RUN $INSTALL build-essential chrpath libssl-dev libxft-dev \
42-
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
43-
44-
RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 && \
45-
tar -xf phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 && \
46-
mv phantomjs-${PHANTOMJS_VERSION}-linux-x86_64/bin/phantomjs /usr/local/bin && \
47-
rm -rf phantomjs-${PHANTOMJS_VERSION}-linux-x86_64 && \
48-
rm phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2
49-
50-
# fix weird phantomjs issue
51-
ENV OPENSSL_CONF=/etc/ssl
52-
53-
RUN phantomjs --version
54-
5539
# install python dependencies
5640
COPY . /compare-html
5741
RUN $INSTALL python3 python3-pip && \

src/htmlcmp/compare_output.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,7 @@ def main():
241241
parser = argparse.ArgumentParser()
242242
parser.add_argument("a", type=Path, help="Path to the first directory")
243243
parser.add_argument("b", type=Path, help="Path to the second directory")
244-
parser.add_argument(
245-
"--driver", choices=["chrome", "firefox", "phantomjs"], default="firefox"
246-
)
244+
parser.add_argument("--driver", choices=["chrome", "firefox"], default="firefox")
247245
parser.add_argument(
248246
"--diff-output", type=Path, help="Output directory for diff images"
249247
)

src/htmlcmp/compare_output_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def main():
698698
parser = argparse.ArgumentParser()
699699
parser.add_argument("ref", type=Path, help="Path to the reference directory")
700700
parser.add_argument("mon", type=Path, help="Path to the monitored directory")
701-
parser.add_argument("--driver", choices=["chrome", "firefox", "phantomjs"])
701+
parser.add_argument("--driver", choices=["chrome", "firefox"])
702702
parser.add_argument("--max-workers", type=int, default=1)
703703
parser.add_argument("--compare", action="store_true")
704704
parser.add_argument("--port", type=int, default=5000)

src/htmlcmp/html_render_diff.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ def get_browser(
7070
f"Expected int for max_width and max_height, got {type(max_width)} and {type(max_height)}"
7171
)
7272

73-
if driver == "phantomjs":
74-
if shutil.which("phantomjs") is None:
75-
raise EnvironmentError("PhantomJS is not installed or not found in PATH")
76-
browser = webdriver.PhantomJS()
77-
elif driver == "firefox":
73+
if driver == "firefox":
7874
options = webdriver.FirefoxOptions()
7975
options.add_argument("--headless")
8076
browser = webdriver.Firefox(options=options)
@@ -109,9 +105,7 @@ def main():
109105
parser = argparse.ArgumentParser()
110106
parser.add_argument("a", type=Path, help="Path to the first HTML file")
111107
parser.add_argument("b", type=Path, help="Path to the second HTML file")
112-
parser.add_argument(
113-
"--driver", choices=["chrome", "firefox", "phantomjs"], default="firefox"
114-
)
108+
parser.add_argument("--driver", choices=["chrome", "firefox"], default="firefox")
115109
parser.add_argument("--max-width", default=1000)
116110
parser.add_argument("--max-height", default=10000)
117111
args = parser.parse_args()

tests/test_html_render_diff.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ def test_get_browser():
3131
assert browser.name == "firefox"
3232
browser.quit()
3333

34-
# Test with PhantomJS
35-
if shutil.which("phantomjs") is not None:
36-
browser = get_browser("phantomjs")
37-
assert browser.name == "phantomjs"
38-
browser.quit()
39-
4034

4135
def test_html_render_diff():
4236
test1 = Path(__file__).parent / "test1.html"

0 commit comments

Comments
 (0)