diff --git a/docs/en/tools/tool-integrations/overview.mdx b/docs/en/tools/tool-integrations/overview.mdx index 6f59ca471..a40afecc8 100644 --- a/docs/en/tools/tool-integrations/overview.mdx +++ b/docs/en/tools/tool-integrations/overview.mdx @@ -11,7 +11,7 @@ mode: "wide" Invoke Amazon Bedrock Agents from CrewAI to orchestrate actions across AWS services. @@ -20,7 +20,7 @@ mode: "wide" Automate deployment and operations by integrating CrewAI with external platforms and workflows. diff --git a/tests/test_documentation_links.py b/tests/test_documentation_links.py new file mode 100644 index 000000000..ddc5d6794 --- /dev/null +++ b/tests/test_documentation_links.py @@ -0,0 +1,43 @@ +"""Test documentation link integrity to prevent broken links.""" + +import os +from pathlib import Path +import re +import pytest + + +def test_integration_overview_links(): + """Test that integration overview page links point to existing documentation files.""" + overview_file = Path(__file__).parent.parent / "docs" / "en" / "tools" / "tool-integrations" / "overview.mdx" + + with open(overview_file, 'r', encoding='utf-8') as f: + content = f.read() + + href_pattern = r'href="(/en/tools/[^"]+)"' + hrefs = re.findall(href_pattern, content) + + docs_root = Path(__file__).parent.parent / "docs" + for href in hrefs: + file_path = docs_root / href.lstrip('/') + '.mdx' + assert file_path.exists(), f"Documentation file not found for href: {href}" + + +def test_specific_integration_links(): + """Test the specific links mentioned in issue #3516.""" + docs_root = Path(__file__).parent.parent / "docs" + + bedrock_file = docs_root / "en" / "tools" / "integration" / "bedrockinvokeagenttool.mdx" + crewai_automation_file = docs_root / "en" / "tools" / "integration" / "crewaiautomationtool.mdx" + + assert bedrock_file.exists(), "Bedrock Invoke Agent Tool documentation file should exist" + assert crewai_automation_file.exists(), "CrewAI Automation Tool documentation file should exist" + + overview_file = docs_root / "en" / "tools" / "tool-integrations" / "overview.mdx" + with open(overview_file, 'r', encoding='utf-8') as f: + content = f.read() + + assert '/en/tools/integration/bedrockinvokeagenttool' in content, "Overview should link to correct Bedrock tool path" + assert '/en/tools/integration/crewaiautomationtool' in content, "Overview should link to correct CrewAI automation tool path" + + assert '/en/tools/tool-integrations/bedrockinvokeagenttool' not in content, "Overview should not use incorrect Bedrock tool path" + assert '/en/tools/tool-integrations/crewaiautomationtool' not in content, "Overview should not use incorrect CrewAI automation tool path"