Spaces:
Running
Running
mike boone commited on
Commit ·
90f035f
1
Parent(s): 79f3f3b
fix: align e2e quality model with runtime default
Browse files- tests/e2e_quality.py +18 -2
tests/e2e_quality.py
CHANGED
|
@@ -34,6 +34,8 @@ from playwright.sync_api import Page, sync_playwright
|
|
| 34 |
|
| 35 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 36 |
|
|
|
|
|
|
|
| 37 |
# ---------------------------------------------------------------------------
|
| 38 |
# Setup
|
| 39 |
# ---------------------------------------------------------------------------
|
|
@@ -68,7 +70,7 @@ RUN_SETTINGS = {
|
|
| 68 |
"object_prefix": "tst",
|
| 69 |
"share_with": "mike.boone@thoughtspot.com",
|
| 70 |
"geo_scope": "USA Only",
|
| 71 |
-
"ai_model":
|
| 72 |
"ts_environment": "secloud - primary", # change to test other TS instances
|
| 73 |
}
|
| 74 |
|
|
@@ -236,9 +238,23 @@ def build_test_suite(config: dict) -> list:
|
|
| 236 |
def select_gradio_dropdown(page: Page, label: str, value: str):
|
| 237 |
"""Select a value from a Gradio dropdown using aria-label (confirmed from DOM inspection)."""
|
| 238 |
inp = page.locator(f'input[aria-label="{label}"]').first
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
inp.click(timeout=5000)
|
| 240 |
page.wait_for_timeout(300)
|
| 241 |
-
page.get_by_role('option', name=value, exact=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
page.wait_for_timeout(300)
|
| 243 |
|
| 244 |
|
|
|
|
| 34 |
|
| 35 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 36 |
|
| 37 |
+
from llm_config import DEFAULT_LLM_MODEL
|
| 38 |
+
|
| 39 |
# ---------------------------------------------------------------------------
|
| 40 |
# Setup
|
| 41 |
# ---------------------------------------------------------------------------
|
|
|
|
| 70 |
"object_prefix": "tst",
|
| 71 |
"share_with": "mike.boone@thoughtspot.com",
|
| 72 |
"geo_scope": "USA Only",
|
| 73 |
+
"ai_model": DEFAULT_LLM_MODEL, # Follow app runtime default/temporary failover
|
| 74 |
"ts_environment": "secloud - primary", # change to test other TS instances
|
| 75 |
}
|
| 76 |
|
|
|
|
| 238 |
def select_gradio_dropdown(page: Page, label: str, value: str):
|
| 239 |
"""Select a value from a Gradio dropdown using aria-label (confirmed from DOM inspection)."""
|
| 240 |
inp = page.locator(f'input[aria-label="{label}"]').first
|
| 241 |
+
try:
|
| 242 |
+
current_value = (inp.input_value(timeout=1000) or "").strip()
|
| 243 |
+
if current_value == value:
|
| 244 |
+
return
|
| 245 |
+
except Exception:
|
| 246 |
+
pass
|
| 247 |
inp.click(timeout=5000)
|
| 248 |
page.wait_for_timeout(300)
|
| 249 |
+
option = page.get_by_role('option', name=value, exact=True)
|
| 250 |
+
try:
|
| 251 |
+
option.click(timeout=5000)
|
| 252 |
+
except Exception as e:
|
| 253 |
+
visible_options = page.locator('[role="option"]').all_inner_texts()
|
| 254 |
+
raise RuntimeError(
|
| 255 |
+
f"Dropdown {label!r} does not contain {value!r}. "
|
| 256 |
+
f"Visible options: {visible_options}"
|
| 257 |
+
) from e
|
| 258 |
page.wait_for_timeout(300)
|
| 259 |
|
| 260 |
|