-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_modal.py
More file actions
45 lines (39 loc) · 1.02 KB
/
Copy pathdebug_modal.py
File metadata and controls
45 lines (39 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Debug: test apply_one_ui on one vacancy to verify button/modal detection."""
import sys
import time
from pathlib import Path
ROOT = Path(__file__).resolve().parent
SCRIPTS = ROOT / ".claude" / "skills" / "hh-job-hunter" / "scripts"
sys.path.insert(0, str(SCRIPTS))
from auth import get_session
from apply import (
open_apply_browser,
_apply_one_ui,
_page_shows_already_applied,
_find_respond_button,
ApplyStatus,
)
def test_one(ctx, url: str):
print(f"\n{'='*60}")
print(f"Testing: {url}")
status, err = _apply_one_ui(
ctx, url, "",
default_cover_letter="",
forced_cover_letter=None,
mandatory_cover_letter="",
)
print(f" Status: {status.value}")
if err:
print(f" Error: {err}")
return status
if __name__ == "__main__":
urls = sys.argv[1:] or [
"https://hh.ru/vacancy/132042035",
]
pw, ctx = open_apply_browser()
try:
for u in urls:
test_one(ctx, u)
finally:
ctx.close()
pw.stop()