Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents/deep_research.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pathlib import Path
from connectonion import Agent
from connectonion.useful_plugins import image_result_formatter
from tools.web_automation import web
from tools.browser import web
from tools.file_tools import FileTools
from tools.deep_research import perform_deep_research

Expand Down
4 changes: 2 additions & 2 deletions examples/demo_image_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

from connectonion import Agent
from connectonion.useful_plugins import image_result_formatter
from browser_agent.web_automation import WebAutomation
from browser_agent.browser import Browser

# Create web automation instance
web = WebAutomation(use_chrome_profile=False)
web = Browser(use_chrome_profile=False)

# Create agent with plugins
agent = Agent(
Expand Down
4 changes: 2 additions & 2 deletions examples/demo_trace_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

from connectonion import Agent, xray
from connectonion.useful_plugins import image_result_formatter
from browser_agent.web_automation import WebAutomation
from browser_agent.browser import Browser

# Create web automation instance
web = WebAutomation(use_chrome_profile=False)
web = Browser(use_chrome_profile=False)

# Create agent with image_result_formatter plugin
agent = Agent(
Expand Down
4 changes: 2 additions & 2 deletions examples/get_all_emails_and_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
4. Creates a comprehensive summary
"""

from browser_agent.web_automation import WebAutomation
from browser_agent.browser import Browser
import time
import json

def get_all_emails_and_analyze():
print("=== Getting ALL Gmail Emails and Analyzing ===\n")

web = WebAutomation(use_chrome_profile=True)
web = Browser(use_chrome_profile=True)
web.open_browser(headless=False)
web.go_to("https://gmail.com")
time.sleep(3)
Expand Down
21 changes: 21 additions & 0 deletions test_deep_research_direct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from agents.deep_research import DeepResearch
from tools.browser import Browser
import os

def test_standalone_deep_research():
print("Testing DeepResearch standalone...")
web = Browser(headless=True)
researcher = DeepResearch(web)

# Simple topic
topic = "What is the capital of France and its population?"
result = researcher.perform_deep_research(topic)

print("\nRESEARCH RESULT:")
print(result)

web.close()

if __name__ == "__main__":
test_standalone_deep_research()

12 changes: 6 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def cleanup_asyncio():

@pytest.fixture(scope="function")
def web(tmp_path):
"""Create WebAutomation instance for each test using temp dir for screenshots and profile"""
from tools.web_automation import WebAutomation
"""Create Browser instance for each test using temp dir for screenshots and profile"""
from tools.browser import Browser

# Use a unique temporary directory for the Chrome profile to avoid locking issues in parallel tests
profile_path = tmp_path / "chrome_profile"
web_instance = WebAutomation(profile_path=str(profile_path))

web_instance = Browser(profile_path=str(profile_path))
# Redirect screenshots to temp directory
web_instance.screenshots_dir = str(tmp_path / "screenshots")
yield web_instance
Expand All @@ -88,7 +88,7 @@ def web(tmp_path):

@pytest.fixture(scope="function")
def agent(web):
"""Create Agent with WebAutomation tools"""
"""Create Agent with Browser tools"""
from connectonion import Agent
agent_instance = Agent(
name="test_agent",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_auto_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
# Ensure tools can be imported
sys.path.insert(0, str(Path(__file__).parent.parent))

from tools.web_automation import WebAutomation
from tools.browser import Browser


@pytest.mark.manual
@pytest.mark.integration
def test_auto_debug_hacker_news():
"""Test auto_debug feature with browser automation - requires user interaction."""
# Create the web automation instance
web = WebAutomation()
web = Browser()

# Get correct path to prompt.md
prompt_path = Path(__file__).parent.parent / "prompts" / "agent.md"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_chromium_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Ensure tools can be imported
sys.path.insert(0, str(Path(__file__).parent.parent))

from tools.web_automation import WebAutomation
from tools.browser import Browser

@pytest.mark.manual
@pytest.mark.chrome_profile
Expand All @@ -21,7 +21,7 @@ def test_chromium_profile_persistence():
Step 2: Reopen browser -> Check if logged in automatically
"""
print("\n=== Step 1: Initial Login ===")
web1 = WebAutomation(headless=False)
web1 = Browser(headless=False)
web1.open_browser()

print("Navigating to Gmail...")
Expand All @@ -38,7 +38,7 @@ def test_chromium_profile_persistence():

print("\n=== Step 2: Verification (New Session) ===")
# Open a FRESH instance pointing to the SAME profile
web2 = WebAutomation(headless=False)
web2 = Browser(headless=False)
web2.open_browser()

print("Navigating to Gmail again (should be logged in)...")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time
from pathlib import Path
import pytest
from tools.web_automation import WebAutomation
from tools.browser import Browser
import os

@pytest.mark.manual
Expand All @@ -22,7 +22,7 @@ def test_google_search_direct(search_term):
2. Parametrized tests with Playwright can have async loop conflicts
3. It's more of an end-to-end test than a unit test
"""
web = WebAutomation()
web = Browser()

# Step 1: Open browser
result = web.open_browser(headless=True)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_final_scroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import time
import pytest
from tools.web_automation import WebAutomation
from tools.browser import Browser


@pytest.mark.manual
Expand All @@ -18,7 +18,7 @@ def test_unified_scroll_gmail():
- AI strategy generation → fallback chain → screenshot comparison
- Clean separation of concerns (automation vs scroll logic)
"""
web = WebAutomation()
web = Browser()

# Open visible browser for manual login
web.open_browser(headless=False)
Expand Down Expand Up @@ -50,10 +50,10 @@ def test_scroll_architecture_demo():
- One simple method: web.scroll()
"""
# Just verify the architecture is in place
web = WebAutomation()
web = Browser()

# Verify scroll method exists
assert hasattr(web, 'scroll'), "WebAutomation should have scroll() method"
assert hasattr(web, 'scroll'), "Browser should have scroll() method"
assert callable(web.scroll), "scroll should be callable"

# Verify scroll_strategies module exists
Expand Down
2 changes: 1 addition & 1 deletion tests/test_image_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from connectonion import Agent
from connectonion.useful_plugins import image_result_formatter
from tools.web_automation import WebAutomation
from tools.browser import Browser
from pathlib import Path


Expand Down
Loading
Loading