diff --git a/company_site/docs/agentic-browsing.md b/company_site/docs/agentic-browsing.md index 0aac6c3..cde1dc1 100644 --- a/company_site/docs/agentic-browsing.md +++ b/company_site/docs/agentic-browsing.md @@ -32,7 +32,7 @@ Test at minimum: When `WEBMCP_ENABLED=True`: - Navigation tools (`list_services`, `get_page_content`, `navigate_to_service`, `open_contact_with_subject`) load on all public pages -- Contact page registers `submit_contact_inquiry` and annotates the HTML form with `toolname` / `tooldescription` +- Contact page registers `submit_contact_inquiry` via declarative form annotations (`toolname`, `tooldescription`, `toolparamdescription`); reCAPTCHA renders outside the annotated form - Default is **disabled** (`WEBMCP_ENABLED=False`) until deliberately enabled per environment Full tool catalog, Chrome flag setup, and reCAPTCHA notes: **[docs/webmcp.md](webmcp.md)** @@ -45,7 +45,7 @@ Before merging public-facing template or CSS changes: 2. Nav dropdowns use ` + {% endif %} + + {% if capchaForm %} +
+ {{ capchaForm }} +
+ + {% endif %} diff --git a/company_site/public/tests.py b/company_site/public/tests.py index 7e52a2d..0f8577a 100644 --- a/company_site/public/tests.py +++ b/company_site/public/tests.py @@ -196,10 +196,22 @@ class WebMcpTests(TestCase): response = self.client.get(reverse("contact")) self.assertEqual(response.status_code, 200) + self.assertContains(response, 'id="contact-form"') self.assertContains(response, 'toolname="submit_contact_inquiry"') self.assertContains(response, "tooldescription=") + self.assertContains(response, "toolparamdescription=") self.assertContains(response, "submit_contact_inquiry") + @override_settings(DEBUG=False) + def test_contact_page_renders_captcha_outside_annotated_form(self): + response = self.client.get(reverse("contact")) + + self.assertEqual(response.status_code, 200) + form_end = response.content.index(b"") + captcha_index = response.content.index(b"g-recaptcha") + self.assertGreater(captcha_index, form_end) + self.assertContains(response, b'form="contact-form"') + def test_webmcp_services_json_includes_all_service_pages(self): response = self.client.get(reverse("public_index"))