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