Skip to content

Commit

Permalink
fix: add chrome to dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed Apr 2, 2024
1 parent 84a5001 commit 3eaaecb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"ghcr.io/devcontainers/features/python:1": {
"installTools": false,
"version": "3.8"
}
},
"ghcr.io/kreemer/features/chrometesting:1": {}
},
"name": "portal",
"postCreateCommand": "pipenv install --dev",
Expand Down
10 changes: 8 additions & 2 deletions example_project/portal_test_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Django settings for example_project project."""

import os
from selenium import webdriver

Expand All @@ -12,11 +13,16 @@
headless_chrome_options.add_argument("--no-sandbox")
headless_chrome_options.add_argument("--disable-extensions")
headless_chrome_options.add_argument("--disable-dev-shm-usage")
headless_chrome_options.binary_location = "/usr/local/bin/chrome"

SELENIUM_WEBDRIVERS = {
"default": {"callable": webdriver.Chrome, "args": (), "kwargs": {}},
"firefox": {"callable": webdriver.Firefox, "args": (), "kwargs": {}},
"chrome-headless": {"callable": webdriver.Chrome, "args": (), "kwargs": {"options": headless_chrome_options}},
"chrome-headless": {
"callable": webdriver.Chrome,
"args": (),
"kwargs": {"options": headless_chrome_options, "executable_path": "/usr/local/bin/chromedriver"},
},
}

SELENIUM_WIDTHS = [1624]
Expand Down Expand Up @@ -169,7 +175,7 @@
"common.context_processors.cookie_management_enabled",
"portal.context_processors.process_newsletter_form",
]
}
},
}
]

Expand Down

0 comments on commit 3eaaecb

Please sign in to comment.