Code - Split content fetcher code up (playwright, puppeteer and requests), fix puppeteer direct chrome support (#2169)

This commit is contained in:
dgtlmoon
2024-02-11 00:09:12 +01:00
committed by GitHub
parent 1f57d9d0b6
commit 823a0c99f4
32 changed files with 1171 additions and 832 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python3
import time
import os
from flask import url_for
from ..util import live_server_setup, wait_for_all_checks
@@ -9,22 +9,20 @@ def test_preferred_proxy(client, live_server):
live_server_setup(live_server)
url = "http://chosen.changedetection.io"
res = client.post(
url_for("import_page"),
# Because a URL wont show in squid/proxy logs due it being SSLed
# Use plain HTTP or a specific domain-name here
data={"urls": url},
url_for("form_quick_watch_add"),
data={"url": url, "tags": '', 'edit_and_watch_submit_button': 'Edit > Watch'},
follow_redirects=True
)
assert b"1 Imported" in res.data
assert b"Watch added in Paused state, saving will unpause" in res.data
wait_for_all_checks(client)
res = client.post(
url_for("edit_page", uuid="first"),
url_for("edit_page", uuid="first", unpause_on_save=1),
data={
"include_filters": "",
"fetch_backend": "html_requests",
"fetch_backend": 'html_webdriver' if os.getenv('PLAYWRIGHT_DRIVER_URL') else 'html_requests',
"headers": "",
"proxy": "proxy-two",
"tags": "",
@@ -32,6 +30,6 @@ def test_preferred_proxy(client, live_server):
},
follow_redirects=True
)
assert b"Updated watch." in res.data
assert b"unpaused" in res.data
wait_for_all_checks(client)
# Now the request should appear in the second-squid logs