test_case_id: convert_html_success
description: "Tests successful conversion of an HTML file to Markdown."
tags: ["all","agent","tools","general_agent_tools"]
skip_intermediate_events: true

setup_artifacts:
  - filename: "test.html"
    content: "<h1>Test Header</h1><p>This is a test paragraph.</p>"
    mime_type: "text/html"

gateway_input:
  user_prompt: "Please convert the file test.html to markdown."
  target_agent_name: "TestAgent"
  user_identity: "test_user@example.com"
  external_context:
    a2a_session_id: "session_convert_html_success"

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_convert_html"
                type: "function"
                function:
                  name: "convert_file_to_markdown"
                  arguments: '{"input_filename": "test.html"}'
    expected_request:
      tools_present:
        - "convert_file_to_markdown"

  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I have converted the file `test.html` to `test.html.md`."
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_call_id_matches_prior_request_index: 0
          response_json_matches:
            status: "success"

expected_gateway_output:
  - type: final_response
    task_state: "completed"
    content_parts:
      - type: text
        text_contains: "I have converted the file `test.html` to `test.html.md`."

expected_artifacts:
  - filename: "test_converted.md"
    mime_type: "text/markdown"
    content_contains: "# Test Header"
