Skip to content

Commit

Permalink
Remove xvfb dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-kelp authored and AetherUnbound committed Mar 3, 2024
1 parent 8e5bc8d commit 41526c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKDIR /usr/src/app

# Install packages depending on ENV arg from docker-compose
ARG BASE_PACKAGES="gcc libpq-dev libjpeg62-turbo-dev libsqlite3-0 zlib1g-dev"
ARG DEV_PACKAGES="firefox-esr xvfb"
ARG DEV_PACKAGES="firefox-esr"
RUN if [ "$IS_PROD" = "true" ]; then \
PACKAGES_TO_INSTALL="$BASE_PACKAGES"; \
else \
Expand Down
10 changes: 3 additions & 7 deletions OpenOversight/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from selenium.webdriver.firefox.webdriver import WebDriver as Firefox
from sqlalchemy.orm import scoped_session, sessionmaker
from webdriver_manager.firefox import GeckoDriverManager
from xvfbwrapper import Xvfb

from OpenOversight.app import create_app
from OpenOversight.app.models.database import (
Expand Down Expand Up @@ -901,12 +900,10 @@ def server(app, server_port):

@pytest.fixture(scope="session")
def browser(app, server):
# start headless webdriver
vdisplay = Xvfb()
vdisplay.start()

options = FirefoxOptions()
options.headless = True
options.add_argument("--headless")
options.add_argument("--width=1024")
options.add_argument("--height=768")

service = FirefoxService(
executable_path=GeckoDriverManager().install(), log_path="/tmp/geckodriver.log"
Expand All @@ -917,4 +914,3 @@ def browser(app, server):

# shutdown headless webdriver
driver.quit()
vdisplay.stop()
12 changes: 1 addition & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ selenium = "4.17.2"
sphinx = "7.0.1"
sphinx-autobuild = "2021.3.14"
webdriver-manager = "3.8.6"
xvfbwrapper = "0.2.9"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 41526c2

Please sign in to comment.