-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_bot_init.py
More file actions
32 lines (26 loc) · 902 Bytes
/
test_bot_init.py
File metadata and controls
32 lines (26 loc) · 902 Bytes
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
#!/usr/bin/env python3
import sys
import os
# Test bot initialization
try:
print("[TEST] Testing bot initialization...")
from src.bot import LinkedIn
# Set headless mode for testing
os.environ['HEADLESS'] = 'true'
print("[TEST] Creating LinkedIn bot instance...")
bot = LinkedIn()
print("[TEST] ✅ Bot initialized successfully!")
print("[TEST] Testing Chrome driver...")
if bot.driver:
print("[TEST] ✅ Chrome driver is active")
bot.driver.get("https://www.example.com")
print(f"[TEST] ✅ Successfully navigated to: {bot.driver.title}")
bot.driver.quit()
print("[TEST] ✅ Bot test completed successfully!")
else:
print("[TEST] ❌ Chrome driver not initialized")
except Exception as e:
print(f"[TEST] ❌ Error: {e}")
import traceback
traceback.print_exc()
sys.exit(1)