Skip to content

🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev

test: Enable Dynamic stealth tests again

Karim shoair228d294afcd9
diff --git a/tests/fetchers/async/test_dynamic.py b/tests/fetchers/async/test_dynamic.py
index 9874858..205595c 100644
--- a/tests/fetchers/async/test_dynamic.py
+++ b/tests/fetchers/async/test_dynamic.py
@@ -26,7 +26,7 @@ class TestDynamicFetcherAsync:
@pytest.mark.asyncio
async def test_basic_fetch(self, fetcher, urls):
- """Test doing basic fetch request with multiple statuses"""
+ """Test doing a basic fetch request with multiple statuses"""
response = await fetcher.async_fetch(urls["status_200"])
assert response.status == 200
@@ -38,7 +38,7 @@ class TestDynamicFetcherAsync:
@pytest.mark.asyncio
async def test_blocking_resources(self, fetcher, urls):
- """Test if blocking resources make page does not finish loading or not"""
+ """Test if blocking resources make the page does not finish loading or not"""
response = await fetcher.async_fetch(urls["basic_url"], disable_resources=True)
assert response.status == 200
@@ -62,7 +62,7 @@ class TestDynamicFetcherAsync:
@pytest.mark.asyncio
async def test_automation(self, fetcher, urls):
- """Test if automation break the code or not"""
+ """Test if automation breaks the code or not"""
async def scroll_page(page):
await page.mouse.wheel(10, 0)
@@ -78,7 +78,7 @@ class TestDynamicFetcherAsync:
[
{"disable_webgl": True, "hide_canvas": False},
{"disable_webgl": False, "hide_canvas": True},
- # {"stealth": True}, # causes issues with Github Actions
+ {"stealth": True}, # causes issues with GitHub Actions
{
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0"
},
@@ -87,7 +87,7 @@ class TestDynamicFetcherAsync:
)
@pytest.mark.asyncio
async def test_properties(self, fetcher, urls, kwargs):
- """Test if different arguments breaks the code or not"""
+ """Test if different arguments break the code or not"""
response = await fetcher.async_fetch(urls["html_url"], **kwargs)
assert response.status == 200
diff --git a/tests/fetchers/sync/test_dynamic.py b/tests/fetchers/sync/test_dynamic.py
index fdefdf1..8f7e60a 100644
--- a/tests/fetchers/sync/test_dynamic.py
+++ b/tests/fetchers/sync/test_dynamic.py
@@ -25,7 +25,7 @@ class TestDynamicFetcher:
self.cookies_url = f"{httpbin.url}/cookies/set/test/value"
def test_basic_fetch(self, fetcher):
- """Test doing basic fetch request with multiple statuses"""
+ """Test doing a basic fetch request with multiple statuses"""
assert fetcher.fetch(self.status_200).status == 200
# There's a bug with playwright makes it crashes if a URL returns status code 4xx/5xx without body, let's disable this till they reply to my issue report
# assert fetcher.fetch(self.status_404).status == 404
@@ -36,7 +36,7 @@ class TestDynamicFetcher:
assert fetcher.fetch(self.basic_url, network_idle=True).status == 200
def test_blocking_resources(self, fetcher):
- """Test if blocking resources make page does not finish loading or not"""
+ """Test if blocking resources make the page does not finish loading or not"""
assert fetcher.fetch(self.basic_url, disable_resources=True).status == 200
def test_waiting_selector(self, fetcher):
@@ -56,7 +56,7 @@ class TestDynamicFetcher:
assert cookies == {"test": "value"}
def test_automation(self, fetcher):
- """Test if automation break the code or not"""
+ """Test if automation breaks the code or not"""
def scroll_page(page):
page.mouse.wheel(10, 0)
@@ -71,7 +71,7 @@ class TestDynamicFetcher:
[
{"disable_webgl": True, "hide_canvas": False},
{"disable_webgl": False, "hide_canvas": True},
- # {"stealth": True}, # causes issues with Github Actions
+ {"stealth": True}, # causes issues with GitHub Actions
{
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0"
},
@@ -79,7 +79,7 @@ class TestDynamicFetcher:
],
)
def test_properties(self, fetcher, kwargs):
- """Test if different arguments breaks the code or not"""
+ """Test if different arguments break the code or not"""
response = fetcher.fetch(self.html_url, **kwargs)
assert response.status == 200