Skip to content

Commit c583930

Browse files
fix: e2e test locator change update
2 parents 95c8134 + dd77555 commit c583930

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

scripts/post_deploy.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ async def check_admin_api_health(config: ResourceConfig) -> bool:
146146
try:
147147
response = await client.get(f"{config.app_url}/api/admin/health")
148148
if response.status_code == 200:
149-
data = response.json()
150-
print_success(f"Admin API healthy (API key required: {data.get('api_key_required', False)})")
149+
print_success("Admin API is healthy")
151150
return True
152151
else:
153152
print_error(f"Admin API returned {response.status_code}")
@@ -391,28 +390,23 @@ async def run_application_tests(config: ResourceConfig, dry_run: bool = False) -
391390
print_warning(f"Health check failed: {e}")
392391
results["health"] = False
393392

394-
# Test 3: Brief Parsing (POST /api/brief/parse)
395-
print_step("Testing Brief Parsing (POST /api/brief/parse)")
393+
# Test 3: Chat API (POST /api/chat)
394+
print_step("Testing Chat API (POST /api/chat)")
396395
try:
397396
response = await client.post(
398-
f"{app_url}/api/brief/parse",
399-
json={"brief_text": "Create an ad for calm interior paint for homeowners."},
397+
f"{app_url}/api/chat",
398+
json={"message": "Hello", "conversation_id": "test-post-deploy"},
400399
headers={"Content-Type": "application/json"}
401400
)
402401
if response.status_code == 200:
403-
data = response.json()
404-
if "brief" in data:
405-
print_success(f"Brief parsed: {data['brief'].get('overview', '')[:60]}...")
406-
results["brief_parse"] = True
407-
else:
408-
print_error(f"Unexpected response: {data}")
409-
results["brief_parse"] = False
402+
print_success("Chat API responding")
403+
results["chat_api"] = True
410404
else:
411-
print_error(f"Failed: {response.status_code} - {response.text[:200]}")
412-
results["brief_parse"] = False
405+
print_error(f"Failed: {response.status_code}")
406+
results["chat_api"] = False
413407
except Exception as e:
414408
print_error(f"Failed: {e}")
415-
results["brief_parse"] = False
409+
results["chat_api"] = False
416410

417411
# Test 4: Product Search (GET /api/products)
418412
print_step("Testing Product Search (GET /api/products?search=blue)")

tests/e2e-test/pages/HomePage.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class HomePage(BasePage):
2828

2929
# Response and status locators
3030
TYPING_INDICATOR = "//div[@class='typing-indicator']"
31-
AGENT = "//div[.='PlanningAgent']"
31+
AGENT = "//*[contains(text(),'PlanningAgent')]"
3232
CONFIRM_BRIEF_BUTTON = "//button[normalize-space()='Confirm brief']"
3333
BRIEF_CONFIRMED_TEXT = "//div[contains(text(),'Brief Confirmed')]"
3434
OLIVE_STONE_TEXT = "(//span[normalize-space()='Olive Stone'])[last()]"
3535
OBSIDIAN_TEXT = "(//span[normalize-space()='Obsidian Pearl'])[last()]"
3636
GENERATE_CONTENT_BUTTON = "//button[normalize-space()='Generate Content']"
37-
ANALYZING_BRIEF_TEXT = "//span[contains(text(),'Analyzing creative brief..')]"
37+
ANALYZING_BRIEF_TEXT = "//span[contains(text(),'Processing your request')]"
3838
GENERATED_CONTENT_TEXT_OLIVE = "//span[contains(.,'✨ Discover the serene elegance of Olive Stone.')]"
3939
GENERATED_CONTENT_TEXT_OBSIDIAN = "//span[contains(.,'✨ Discover the serene elegance of Obsidian Pearl.')]"
4040
PAINT_LIST = "//span[.='Here is the list of available paints:']"
@@ -1039,8 +1039,8 @@ def assert_no_error_in_response(self, context=""):
10391039

10401040
def validate_planning_agent_response_quality(self, extra_keywords=None):
10411041
"""
1042-
Validate that the PlanningAgent response is present and contains meaningful
1043-
brief-related content (mentions objectives, key message, tone, etc.).
1042+
Validate that the response contains meaningful brief-related content
1043+
(mentions objectives, key message, tone, etc.).
10441044
10451045
Hard assertion: At least 2 baseline brief keywords must be present.
10461046
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):
10501050
(e.g., ["social media", "back to school"] for Obsidian Pearl).
10511051
10521052
Raises:
1053-
AssertionError: If PlanningAgent response is missing or lacks baseline content.
1053+
AssertionError: If response lacks baseline brief content.
10541054
"""
10551055
logger.info("🔍 Validating PlanningAgent response quality...")
10561056

10571057
try:
1058-
agent_label = self.page.locator(self.AGENT)
1059-
expect(agent_label).to_be_visible(timeout=15000)
1060-
logger.info("✓ PlanningAgent label is visible")
1061-
10621058
page_text = self.page.inner_text("body")
10631059
page_text_lower = page_text.lower()
10641060

0 commit comments

Comments
 (0)