Skip to content

Commit

Permalink
Fixed reCAPTCHA v3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Xewdy444 committed Sep 16, 2024
1 parent 0931ef6 commit f4ed9b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_async_recaptchav3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ async def test_solver_with_normal_browser() -> None:
async with async_playwright() as playwright:
browser = await playwright.firefox.launch()
page = await browser.new_page()
await page.goto("https://antcpt.com/score_detector/")

async with recaptchav3.AsyncSolver(page) as solver:
await page.goto("https://antcpt.com/score_detector/")
await solver.solve_recaptcha()


Expand All @@ -22,9 +22,9 @@ async def test_solver_with_slow_browser() -> None:
async with async_playwright() as playwright:
browser = await playwright.firefox.launch(slow_mo=1000)
page = await browser.new_page()
await page.goto("https://antcpt.com/score_detector/")

async with recaptchav3.AsyncSolver(page) as solver:
await page.goto("https://antcpt.com/score_detector/")
await solver.solve_recaptcha()


Expand All @@ -34,8 +34,8 @@ async def test_recaptcha_not_found_error() -> None:
async with async_playwright() as playwright:
browser = await playwright.firefox.launch()
page = await browser.new_page()
await page.goto("https://www.google.com/")

with pytest.raises(RecaptchaTimeoutError):
async with recaptchav3.AsyncSolver(page, timeout=10) as solver:
await page.goto("https://www.google.com/")
await solver.solve_recaptcha()
6 changes: 3 additions & 3 deletions tests/test_sync_recaptchav3.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def test_solver_with_normal_browser() -> None:
with sync_playwright() as playwright:
browser = playwright.firefox.launch()
page = browser.new_page()
page.goto("https://antcpt.com/score_detector/")

with recaptchav3.SyncSolver(page) as solver:
page.goto("https://antcpt.com/score_detector/")
solver.solve_recaptcha()


Expand All @@ -20,9 +20,9 @@ def test_solver_with_slow_browser() -> None:
with sync_playwright() as playwright:
browser = playwright.firefox.launch(slow_mo=1000)
page = browser.new_page()
page.goto("https://antcpt.com/score_detector/")

with recaptchav3.SyncSolver(page) as solver:
page.goto("https://antcpt.com/score_detector/")
solver.solve_recaptcha()


Expand All @@ -31,9 +31,9 @@ def test_recaptcha_not_found_error() -> None:
with sync_playwright() as playwright:
browser = playwright.firefox.launch()
page = browser.new_page()
page.goto("https://www.google.com/")

with pytest.raises(RecaptchaTimeoutError), recaptchav3.SyncSolver(
page, timeout=10
) as solver:
page.goto("https://www.google.com/")
solver.solve_recaptcha()

0 comments on commit f4ed9b2

Please sign in to comment.