test: correcting tests with the new arguments

This commit is contained in:
Karim shoair
2025-12-30 22:06:37 +02:00
parent 0c7e26ae5c
commit 33c5633c58
6 changed files with 6 additions and 20 deletions
+1 -4
View File
@@ -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
+2 -7
View File
@@ -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": {},
},
+2 -3
View File
@@ -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
+1 -4
View File
@@ -51,10 +51,7 @@ class TestDynamicFetcher:
@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
{"disable_resources": True, "real_chrome": True},
{"wait_selector": "h1", "wait_selector_state": "attached"},
{"wait_selector": "h1", "wait_selector_state": "visible"},
{