From ce31a4ac3f69eebd0661790c15b50595075ecdc9 Mon Sep 17 00:00:00 2001 From: Ragini-Microsoft Date: Fri, 13 Mar 2026 15:22:35 +0530 Subject: [PATCH 1/3] fix: update analyzing brief text to reflect accurate status message --- content-gen/tests/e2e-test/pages/HomePage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content-gen/tests/e2e-test/pages/HomePage.py b/content-gen/tests/e2e-test/pages/HomePage.py index 0d81feaf4..9ded49a08 100644 --- a/content-gen/tests/e2e-test/pages/HomePage.py +++ b/content-gen/tests/e2e-test/pages/HomePage.py @@ -34,7 +34,7 @@ class HomePage(BasePage): OLIVE_STONE_TEXT = "(//span[normalize-space()='Olive Stone'])[last()]" OBSIDIAN_TEXT = "(//span[normalize-space()='Obsidian Pearl'])[last()]" GENERATE_CONTENT_BUTTON = "//button[normalize-space()='Generate Content']" - ANALYZING_BRIEF_TEXT = "//span[contains(text(),'Analyzing creative brief..')]" + ANALYZING_BRIEF_TEXT = "//span[contains(text(),'Processing your request')]" GENERATED_CONTENT_TEXT_OLIVE = "//span[contains(.,'✨ Discover the serene elegance of Olive Stone.')]" GENERATED_CONTENT_TEXT_OBSIDIAN = "//span[contains(.,'✨ Discover the serene elegance of Obsidian Pearl.')]" PAINT_LIST = "//span[.='Here is the list of available paints:']" From b8e673ab97ae75ddb3314e641f7846b4e4f86f9e Mon Sep 17 00:00:00 2001 From: Ragini-Microsoft Date: Fri, 13 Mar 2026 16:02:35 +0530 Subject: [PATCH 2/3] updated the locator --- content-gen/tests/e2e-test/pages/HomePage.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/content-gen/tests/e2e-test/pages/HomePage.py b/content-gen/tests/e2e-test/pages/HomePage.py index 9ded49a08..fc0209ee1 100644 --- a/content-gen/tests/e2e-test/pages/HomePage.py +++ b/content-gen/tests/e2e-test/pages/HomePage.py @@ -28,7 +28,7 @@ class HomePage(BasePage): # Response and status locators TYPING_INDICATOR = "//div[@class='typing-indicator']" - AGENT = "//div[.='PlanningAgent']" + AGENT = "//*[contains(text(),'PlanningAgent')]" CONFIRM_BRIEF_BUTTON = "//button[normalize-space()='Confirm brief']" BRIEF_CONFIRMED_TEXT = "//div[contains(text(),'Brief Confirmed')]" OLIVE_STONE_TEXT = "(//span[normalize-space()='Olive Stone'])[last()]" @@ -1039,8 +1039,8 @@ def assert_no_error_in_response(self, context=""): def validate_planning_agent_response_quality(self, extra_keywords=None): """ - Validate that the PlanningAgent response is present and contains meaningful - brief-related content (mentions objectives, key message, tone, etc.). + Validate that the response contains meaningful brief-related content + (mentions objectives, key message, tone, etc.). Hard assertion: At least 2 baseline brief keywords must be present. Soft assertion: If extra_keywords are provided, logs warnings for missing ones. @@ -1050,15 +1050,11 @@ def validate_planning_agent_response_quality(self, extra_keywords=None): (e.g., ["social media", "back to school"] for Obsidian Pearl). Raises: - AssertionError: If PlanningAgent response is missing or lacks baseline content. + AssertionError: If response lacks baseline brief content. """ logger.info("🔍 Validating PlanningAgent response quality...") try: - agent_label = self.page.locator(self.AGENT) - expect(agent_label).to_be_visible(timeout=15000) - logger.info("✓ PlanningAgent label is visible") - page_text = self.page.inner_text("body") page_text_lower = page_text.lower() From dd77555bda9bb5df0e145bfbdbcf486ef2f334da Mon Sep 17 00:00:00 2001 From: Ragini-Microsoft Date: Fri, 13 Mar 2026 17:35:06 +0530 Subject: [PATCH 3/3] simplify success message for admin API health check - codeQL fix --- scripts/post_deploy.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/scripts/post_deploy.py b/scripts/post_deploy.py index 12b0d3a75..846cb54be 100644 --- a/scripts/post_deploy.py +++ b/scripts/post_deploy.py @@ -146,8 +146,7 @@ async def check_admin_api_health(config: ResourceConfig) -> bool: try: response = await client.get(f"{config.app_url}/api/admin/health") if response.status_code == 200: - data = response.json() - print_success(f"Admin API healthy (API key required: {data.get('api_key_required', False)})") + print_success("Admin API is healthy") return True else: print_error(f"Admin API returned {response.status_code}") @@ -391,28 +390,23 @@ async def run_application_tests(config: ResourceConfig, dry_run: bool = False) - print_warning(f"Health check failed: {e}") results["health"] = False - # Test 3: Brief Parsing (POST /api/brief/parse) - print_step("Testing Brief Parsing (POST /api/brief/parse)") + # Test 3: Chat API (POST /api/chat) + print_step("Testing Chat API (POST /api/chat)") try: response = await client.post( - f"{app_url}/api/brief/parse", - json={"brief_text": "Create an ad for calm interior paint for homeowners."}, + f"{app_url}/api/chat", + json={"message": "Hello", "conversation_id": "test-post-deploy"}, headers={"Content-Type": "application/json"} ) if response.status_code == 200: - data = response.json() - if "brief" in data: - print_success(f"Brief parsed: {data['brief'].get('overview', '')[:60]}...") - results["brief_parse"] = True - else: - print_error(f"Unexpected response: {data}") - results["brief_parse"] = False + print_success("Chat API responding") + results["chat_api"] = True else: - print_error(f"Failed: {response.status_code} - {response.text[:200]}") - results["brief_parse"] = False + print_error(f"Failed: {response.status_code}") + results["chat_api"] = False except Exception as e: print_error(f"Failed: {e}") - results["brief_parse"] = False + results["chat_api"] = False # Test 4: Product Search (GET /api/products) print_step("Testing Product Search (GET /api/products?search=blue)")