Files
robotex/tests/test_main.http
T
protokeyandClaude Opus 5.5 4d90dc4a21 fix: reCAPTCHA — окно с картинками определяется по положению (#10)
- Маркер интерактивного челленджа: iframe bframe, контейнер которого не стоит
  за экраном (top: -10000px); click_and_race ждёт видимости, а не появления в DOM.
- Маркер наличия капчи берётся из исходного HTML (api.js / enterprise.js,
  .g-recaptcha, iframe чекбокса), проверка мгновенная, без ожидания iframe.
- SolverReCaptcha ждёт detect_locator в DOM, а не видимости (script невидим).
- test_main.http: секреты вынесены в http-client.private.env.json, запрос
  на стенд zennolab, исправлены XPath с @class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 00:30:29 +04:00

165 lines
4.0 KiB
HTTP

# Test your FastAPI endpoints
# Секреты (api_key, proxy, captcha_key) — в tests/http-client.private.env.json (не в git, шаблон —
# http-client.private.env.example.json); окружение dev выбирается в PyCharm над запросом.
GET http://127.0.0.1:8000/
Accept: application/json
###
GET http://127.0.0.1:8000/hello/User
Accept: application/json
###
POST http://127.0.0.1:8000/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
{
"captcha": "token",
"url": "https://example.com/login",
"actions": [
{"type": "fill", "selector": "#email", "value": "user@example.com"},
{"type": "fill", "selector": "#password", "value": "..."},
{"type": "mouse_move", "selector": "#submit"},
{"type": "click", "selector": "#submit"},
{"type": "wait_for", "selector": ".dashboard", "timeout": 30}
],
"proxy": "socks5://user:pass@host:port",
"screen": "1280x920",
"user_agent": "Firefox",
"timeout": 120
}
###
POST http://127.0.0.1:8000/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
Cookie: session_id=2f2100be-6ce7-40d5-bae5-61424b2504c8; Path=/; SameSite=lax
{
"url": "https://browserleaks.com/canvas",
"proxy": "-",
"actions": [
{"type": "wait_for", "selector": "#canvas-hash", "timeout": 10},
{"type": "inner_html", "selector": "#canvas-hash"}
]
}
###
POST http://127.0.0.1:8000/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
Cookie: session_id=2f2100be-6ce7-40d5-bae5-61424b2504c8; Path=/; SameSite=lax
{
"url": "http://127.0.0.1:8001/",
"proxy": "-",
"actions": [
{"type": "fill", "selector": "#username", "value": "webrobo"},
{"type": "fill", "selector": "#password", "value": "31337"},
{"type": "click", "selector": "body > form:nth-child(1) > button:nth-child(7)"},
{"type": "wait_for", "selector": ".user", "timeout": 30}
]
}
###
POST http://127.0.0.1:8000/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
Cookie: session_id=2f2100be-6ce7-40d5-bae5-61424b2504c8; Path=/; SameSite=lax
{
"url": "http://127.0.0.1:8001/",
"proxy": "-",
"actions": [
{"type": "mouse_move", "selector": ".logout"},
{"type": "delay", "value": "3"},
{"type": "click", "selector": ".logout"},
{"type": "wait_for", "selector": "#username", "timeout": 10}
]
}
###
POST http://127.0.0.1:8000/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
{
"url": "http://127.0.0.1:8001/",
"proxy": "-",
"actions": [
{"type": "mouse_move", "selector": ".menu-trigger"},
{"type": "delay", "value": "2"},
{"type": "click", "selector": "div.menu-item:nth-child(3)"},
{"type": "mouse_move", "selector": ".logout"},
{"type": "delay", "value": "10"}
]
}
### 2f2100be-6ce7-40d5-bae5-61424b2504c8
POST http://localhost:8002/v2/tasks
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
{
"url": "https://freelancehunt.com/",
"proxy": "{{proxy}}",
"actions": [
{
"type": "inner_text",
"selector": "//section[@class='hero']//div[@class='hero__content']/h2/span[2]"
}
],
"captcha_type": "cloudflare",
"browser_idle_timeout": 0
}
###
GET http://localhost:8002/v2/tasks/4d8105f8-93a8-43ee-aa6e-db917451363b
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
###
# @timeout 600
POST http://localhost:8010/v1/solve
Accept: application/json
Content-Type: application/json
X-API-Key: {{api_key}}
{
"url": "https://lessons.zennolab.com/captchas/recaptcha/v2_nosubmit.php?level=low",
"proxy": "{{proxy}}",
"actions": [
{
"type": "pass_challenge",
"value": "recaptcha"
},
{
"type": "inner_text",
"selector": "//button[contains(@class, 'actionItem_151') and @type='submit']"
}
],
"captcha": "{{captcha_key}}",
"captcha_type": "recaptcha",
"captcha_success_locator": "//code[contains(@class, 'hljs _successMessageCode')]"
}
###