test: correcting tests with the new arguments
This commit is contained in:
@@ -53,10 +53,7 @@ class TestDynamicFetcherAsync:
|
||||
@pytest.mark.parametrize(
|
||||
"kwargs",
|
||||
[
|
||||
{"disable_webgl": True, "hide_canvas": False},
|
||||
{"disable_webgl": False, "hide_canvas": True, "disable_resources": True},
|
||||
{"stealth": True}, # causes issues with GitHub Actions
|
||||
{"stealth": True, "real_chrome": True}, # causes issues with GitHub Actions
|
||||
{"real_chrome": True, "disable_resources": True},
|
||||
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
||||
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
||||
{
|
||||
|
||||
@@ -71,7 +71,6 @@ class TestAsyncDynamicSession:
|
||||
"""Test AsyncDynamicSession with various options"""
|
||||
async with AsyncDynamicSession(
|
||||
headless=False,
|
||||
stealth=True,
|
||||
disable_resources=True,
|
||||
extra_headers={"X-Test": "value"}
|
||||
) as session:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
|
||||
|
||||
from scrapling.engines.static import AsyncFetcherClient
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from playwright._impl._errors import TimeoutError
|
||||
import pytest
|
||||
import pytest_httpbin
|
||||
|
||||
@@ -55,10 +54,9 @@ class TestStealthyFetcher:
|
||||
@pytest.mark.parametrize(
|
||||
"kwargs",
|
||||
[
|
||||
{"block_webrtc": True, "allow_webgl": True, "disable_ads": False},
|
||||
{"block_webrtc": False, "allow_webgl": True, "block_images": True},
|
||||
{"block_webrtc": True, "allow_webgl": True},
|
||||
{"block_webrtc": False, "allow_webgl": True},
|
||||
{"block_webrtc": True, "allow_webgl": False, "disable_resources": True},
|
||||
{"block_images": True, "disable_resources": True, },
|
||||
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
||||
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
||||
{
|
||||
@@ -67,9 +65,6 @@ class TestStealthyFetcher:
|
||||
"cookies": [{"name": "test", "value": "123", "domain": "example.com", "path": "/"}],
|
||||
"google_search": True,
|
||||
"extra_headers": {"ayo": ""},
|
||||
"os_randomize": True,
|
||||
"disable_ads": True,
|
||||
# "geoip": True,
|
||||
"selector_config": {"keep_comments": False, "keep_cdata": False},
|
||||
"additional_args": {},
|
||||
},
|
||||
|
||||
@@ -72,9 +72,8 @@ class TestAsyncStealthySession:
|
||||
"""Test AsyncStealthySession with various options"""
|
||||
async with AsyncStealthySession(
|
||||
max_pages=1,
|
||||
block_images=True,
|
||||
disable_ads=True,
|
||||
humanize=True
|
||||
block_webrtc=True,
|
||||
allow_webgl=True
|
||||
) as session:
|
||||
response = await session.fetch(urls["html"])
|
||||
assert response.status == 200
|
||||
|
||||
Reference in New Issue
Block a user