Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix tests for new output

mertunsall2ec840ed4a5c
diff --git a/tests/ci/mocks.py b/tests/ci/mocks.py
index a2a5cf639..092e9b812 100644
--- a/tests/ci/mocks.py
+++ b/tests/ci/mocks.py
@@ -25,11 +25,10 @@ def create_mock_llm(actions=None):
# Default done action
default_done_action = """
{
- "current_state": {
- "evaluation_previous_goal": "Successfully completed the task",
- "memory": "Task completed",
- "next_goal": "Task completed"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Successfully completed the task",
+ "memory": "Task completed",
+ "next_goal": "Task completed",
"action": [
{
"done": {
diff --git a/tests/ci/test_browser_session_output_paths.py b/tests/ci/test_browser_session_output_paths.py
index c6d87c903..e39660065 100644
--- a/tests/ci/test_browser_session_output_paths.py
+++ b/tests/ci/test_browser_session_output_paths.py
@@ -54,11 +54,10 @@ def interactive_llm(httpserver_url):
# First action: Navigate to the page
f"""
{{
- "current_state": {{
- "evaluation_previous_goal": "Starting the task",
- "memory": "Need to navigate to the test page",
- "next_goal": "Navigate to the URL"
- }},
+ "thinking": null,
+ "evaluation_previous_goal": "Starting the task",
+ "memory": "Need to navigate to the test page",
+ "next_goal": "Navigate to the URL",
"action": [
{{
"go_to_url": {{
@@ -71,11 +70,10 @@ def interactive_llm(httpserver_url):
# Second action: Click in the search box
"""
{
- "current_state": {
- "evaluation_previous_goal": "Successfully navigated to the page",
- "memory": "Page loaded, can see search box and submit button",
- "next_goal": "Click on the search box to focus it"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Successfully navigated to the page",
+ "memory": "Page loaded, can see search box and submit button",
+ "next_goal": "Click on the search box to focus it",
"action": [
{
"click_element_by_index": {
@@ -88,11 +86,10 @@ def interactive_llm(httpserver_url):
# Third action: Type text in the search box
"""
{
- "current_state": {
- "evaluation_previous_goal": "Clicked on search box",
- "memory": "Search box is focused and ready for input",
- "next_goal": "Type 'test' in the search box"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Clicked on search box",
+ "memory": "Search box is focused and ready for input",
+ "next_goal": "Type 'test' in the search box",
"action": [
{
"input_text": {
@@ -106,11 +103,10 @@ def interactive_llm(httpserver_url):
# Fourth action: Click submit button
"""
{
- "current_state": {
- "evaluation_previous_goal": "Typed 'test' in search box",
- "memory": "Text 'test' has been entered successfully",
- "next_goal": "Click the submit button to complete the task"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Typed 'test' in search box",
+ "memory": "Text 'test' has been entered successfully",
+ "next_goal": "Click the submit button to complete the task",
"action": [
{
"click_element_by_index": {
diff --git a/tests/ci/test_browser_session_start.py b/tests/ci/test_browser_session_start.py
index e6d535240..2c83820af 100644
--- a/tests/ci/test_browser_session_start.py
+++ b/tests/ci/test_browser_session_start.py
@@ -580,11 +580,10 @@ class TestBrowserSessionReusePatterns:
# Return a valid JSON response that completes the task
response.content = """
{
- "current_state": {
- "evaluation_previous_goal": "Starting the task",
- "memory": "Task started",
- "next_goal": "Complete the task"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Starting the task",
+ "memory": "Task started",
+ "next_goal": "Complete the task",
"action": [
{
"done": {
@@ -731,11 +730,10 @@ class TestBrowserSessionReusePatterns:
tab_creation_action = (
"""
{
- "current_state": {
- "evaluation_previous_goal": "Starting the task",
- "memory": "Need to create a new tab",
- "next_goal": "Create a new tab to work in"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Starting the task",
+ "memory": "Need to create a new tab",
+ "next_goal": "Create a new tab to work in",
"action": [
{
"open_tab": {
@@ -750,11 +748,10 @@ class TestBrowserSessionReusePatterns:
done_action = """
{
- "current_state": {
- "evaluation_previous_goal": "Tab created",
- "memory": "Task completed in new tab",
- "next_goal": "Complete the task"
- },
+ "thinking": null,
+ "evaluation_previous_goal": "Tab created",
+ "memory": "Task completed in new tab",
+ "next_goal": "Complete the task",
"action": [
{
"done": {
diff --git a/tests/ci/test_registry.py b/tests/ci/test_registry.py
index 591250009..46c9bbd2c 100644
--- a/tests/ci/test_registry.py
+++ b/tests/ci/test_registry.py
@@ -232,7 +232,6 @@ class TestActionRegistryParameterPatterns:
assert 'Text: hello' in result.extracted_content
assert base_url in result.extracted_content
# The mock LLM returns a JSON response
- assert 'LLM: \n\t{\n\t\t"current_state":' in result.extracted_content
assert '"Task completed successfully"' in result.extracted_content
assert 'Files: 2' in result.extracted_content
diff --git a/tests/ci/test_sync_agent_events.py b/tests/ci/test_sync_agent_events.py
index d3f619c7d..2dff3c116 100644
--- a/tests/ci/test_sync_agent_events.py
+++ b/tests/ci/test_sync_agent_events.py
@@ -57,11 +57,10 @@ def mock_llm():
# Create the JSON response that the agent would parse
json_response = {
- 'current_state': {
- 'evaluation_previous_goal': 'Starting task',
- 'memory': 'New task to complete',
- 'next_goal': 'Complete the test task',
- },
+ 'thinking': 'null',
+ 'evaluation_previous_goal': 'Starting task',
+ 'memory': 'New task to complete',
+ 'next_goal': 'Complete the test task',
'action': [{'done': {'success': True, 'text': 'Test completed successfully'}}],
}