Selenium proxy fixes

pull/3169/head
dgtlmoon 2025-05-02 10:54:01 +02:00
rodzic b2923b8c3a
commit 535ee97ef7
4 zmienionych plików z 10 dodań i 7 usunięć

Wyświetl plik

@ -76,8 +76,7 @@ class fetcher(Fetcher):
for opt in CHROME_OPTIONS:
options.add_argument(opt)
if self.proxy:
options.proxy = self.proxy
options.add_argument(f"--proxy-server={self.proxy}")
self.driver = webdriver.Remote(
command_executor=self.browser_connection_url,

Wyświetl plik

@ -101,6 +101,7 @@ docker run --network changedet-network \
bash -c 'cd changedetectionio && FAST_PUPPETEER_CHROME_FETCHER=1 PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000 pytest tests/proxy_list/test_proxy_noconnect.py'
# Selenium - todo - fix proxies
#docker run --network changedet-network \
# test-changedetectionio \
# bash -c 'cd changedetectionio && FAST_PUPPETEER_CHROME_FETCHER=1 PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000 pytest tests/proxy_list/test_proxy_noconnect.py'
docker run --network changedet-network \
-e "WEBDRIVER_URL=http://selenium:4444/wd/hub" \
test-changedetectionio \
bash -c 'cd changedetectionio && pytest tests/proxy_list/test_proxy_noconnect.py'

Wyświetl plik

@ -44,7 +44,10 @@ def test_proxy_noconnect_custom(client, live_server, measure_memory_usage):
check_string = b'Proxy connection failed?'
if os.getenv('PLAYWRIGHT_DRIVER_URL') or strtobool(os.getenv('FAST_PUPPETEER_CHROME_FETCHER', 'False')):
check_string = b'ERR_PROXY_CONNECTION_FAILED '
check_string = b'ERR_PROXY_CONNECTION_FAILED'
if os.getenv("WEBDRIVER_URL"):
check_string = b'ERR_PROXY_CONNECTION_FAILED'
assert check_string in res.data

Wyświetl plik

@ -53,7 +53,7 @@ lxml >=4.8.0,<6,!=5.2.0,!=5.2.1
# XPath 2.0-3.1 support - 4.2.0 broke something?
elementpath==4.1.5
selenium~=4.14.0
selenium==4.31.0
# https://github.com/pallets/werkzeug/issues/2985
# Maybe related to pytest?