Karim shoair commited on
Commit ·
bbcca8c
1
Parent(s): b354df4
test: correcting tests with the new arguments
Browse files
tests/fetchers/async/test_dynamic.py
CHANGED
|
@@ -53,10 +53,7 @@ class TestDynamicFetcherAsync:
|
|
| 53 |
@pytest.mark.parametrize(
|
| 54 |
"kwargs",
|
| 55 |
[
|
| 56 |
-
{"
|
| 57 |
-
{"disable_webgl": False, "hide_canvas": True, "disable_resources": True},
|
| 58 |
-
{"stealth": True}, # causes issues with GitHub Actions
|
| 59 |
-
{"stealth": True, "real_chrome": True}, # causes issues with GitHub Actions
|
| 60 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 61 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 62 |
{
|
|
|
|
| 53 |
@pytest.mark.parametrize(
|
| 54 |
"kwargs",
|
| 55 |
[
|
| 56 |
+
{"real_chrome": True, "disable_resources": True},
|
|
|
|
|
|
|
|
|
|
| 57 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 58 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 59 |
{
|
tests/fetchers/async/test_dynamic_session.py
CHANGED
|
@@ -71,7 +71,6 @@ class TestAsyncDynamicSession:
|
|
| 71 |
"""Test AsyncDynamicSession with various options"""
|
| 72 |
async with AsyncDynamicSession(
|
| 73 |
headless=False,
|
| 74 |
-
stealth=True,
|
| 75 |
disable_resources=True,
|
| 76 |
extra_headers={"X-Test": "value"}
|
| 77 |
) as session:
|
|
|
|
| 71 |
"""Test AsyncDynamicSession with various options"""
|
| 72 |
async with AsyncDynamicSession(
|
| 73 |
headless=False,
|
|
|
|
| 74 |
disable_resources=True,
|
| 75 |
extra_headers={"X-Test": "value"}
|
| 76 |
) as session:
|
tests/fetchers/async/test_requests_session.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import pytest
|
| 2 |
|
| 3 |
|
| 4 |
from scrapling.engines.static import AsyncFetcherClient
|
|
|
|
|
|
|
| 1 |
|
| 2 |
|
| 3 |
from scrapling.engines.static import AsyncFetcherClient
|
tests/fetchers/async/test_stealth.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
from playwright._impl._errors import TimeoutError
|
| 2 |
import pytest
|
| 3 |
import pytest_httpbin
|
| 4 |
|
|
@@ -55,10 +54,9 @@ class TestStealthyFetcher:
|
|
| 55 |
@pytest.mark.parametrize(
|
| 56 |
"kwargs",
|
| 57 |
[
|
| 58 |
-
{"block_webrtc": True, "allow_webgl": True
|
| 59 |
-
{"block_webrtc": False, "allow_webgl": True
|
| 60 |
{"block_webrtc": True, "allow_webgl": False, "disable_resources": True},
|
| 61 |
-
{"block_images": True, "disable_resources": True, },
|
| 62 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 63 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 64 |
{
|
|
@@ -67,9 +65,6 @@ class TestStealthyFetcher:
|
|
| 67 |
"cookies": [{"name": "test", "value": "123", "domain": "example.com", "path": "/"}],
|
| 68 |
"google_search": True,
|
| 69 |
"extra_headers": {"ayo": ""},
|
| 70 |
-
"os_randomize": True,
|
| 71 |
-
"disable_ads": True,
|
| 72 |
-
# "geoip": True,
|
| 73 |
"selector_config": {"keep_comments": False, "keep_cdata": False},
|
| 74 |
"additional_args": {},
|
| 75 |
},
|
|
|
|
|
|
|
| 1 |
import pytest
|
| 2 |
import pytest_httpbin
|
| 3 |
|
|
|
|
| 54 |
@pytest.mark.parametrize(
|
| 55 |
"kwargs",
|
| 56 |
[
|
| 57 |
+
{"block_webrtc": True, "allow_webgl": True},
|
| 58 |
+
{"block_webrtc": False, "allow_webgl": True},
|
| 59 |
{"block_webrtc": True, "allow_webgl": False, "disable_resources": True},
|
|
|
|
| 60 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 61 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 62 |
{
|
|
|
|
| 65 |
"cookies": [{"name": "test", "value": "123", "domain": "example.com", "path": "/"}],
|
| 66 |
"google_search": True,
|
| 67 |
"extra_headers": {"ayo": ""},
|
|
|
|
|
|
|
|
|
|
| 68 |
"selector_config": {"keep_comments": False, "keep_cdata": False},
|
| 69 |
"additional_args": {},
|
| 70 |
},
|
tests/fetchers/async/test_stealth_session.py
CHANGED
|
@@ -72,9 +72,8 @@ class TestAsyncStealthySession:
|
|
| 72 |
"""Test AsyncStealthySession with various options"""
|
| 73 |
async with AsyncStealthySession(
|
| 74 |
max_pages=1,
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
humanize=True
|
| 78 |
) as session:
|
| 79 |
response = await session.fetch(urls["html"])
|
| 80 |
assert response.status == 200
|
|
|
|
| 72 |
"""Test AsyncStealthySession with various options"""
|
| 73 |
async with AsyncStealthySession(
|
| 74 |
max_pages=1,
|
| 75 |
+
block_webrtc=True,
|
| 76 |
+
allow_webgl=True
|
|
|
|
| 77 |
) as session:
|
| 78 |
response = await session.fetch(urls["html"])
|
| 79 |
assert response.status == 200
|
tests/fetchers/sync/test_dynamic.py
CHANGED
|
@@ -51,10 +51,7 @@ class TestDynamicFetcher:
|
|
| 51 |
@pytest.mark.parametrize(
|
| 52 |
"kwargs",
|
| 53 |
[
|
| 54 |
-
{"
|
| 55 |
-
{"disable_webgl": False, "hide_canvas": True, "disable_resources": True},
|
| 56 |
-
{"stealth": True}, # causes issues with GitHub Actions
|
| 57 |
-
{"stealth": True, "real_chrome": True}, # causes issues with GitHub Actions
|
| 58 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 59 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 60 |
{
|
|
|
|
| 51 |
@pytest.mark.parametrize(
|
| 52 |
"kwargs",
|
| 53 |
[
|
| 54 |
+
{"disable_resources": True, "real_chrome": True},
|
|
|
|
|
|
|
|
|
|
| 55 |
{"wait_selector": "h1", "wait_selector_state": "attached"},
|
| 56 |
{"wait_selector": "h1", "wait_selector_state": "visible"},
|
| 57 |
{
|