Files
openobserve/tests/ui-testing
Shrinath RaoandClaude Opus 4.8 0afbe40fe4 test: fix flaky Alerts OSelect dropdowns (click trigger, not root div) (#12869)
## Problem

The scheduled **main** Playwright Regression run failed in the
**Alerts-Regression** shard ([run
28097849118](https://github.com/openobserve/openobserve/actions/runs/28097849118/job/83192928864))
with 2 tests failing on the **same** locator `[data-test$="-popover"]
[data-test$="-option"]` (dropdown options never found):

- `alerts-bugs.spec.js` › "Template should not appear twice in override
template input" (`@bug-10110`)
- `alerts-regression.spec.js` › "Bug #9967: PromQL alert creation"
(`@bug-9967`)

## Root cause

The alert form selects were migrated to the **OSelect** (reka-ui
popover) component. OSelect forwards the consumer's `data-test` onto an
**inner `<button data-test="...-trigger">`**, while the root element is
a plain `<div>`. Both tests clicked the **root `<div>`**, which does
**not** toggle the reka popover — `aria-expanded` stays `false`, the
popover never opens, and the option locator times out.

This is not caused by #12855; it reproduces on an older build too. The
codebase already had the correct pattern elsewhere (group-by select
clicks `[data-test$="-trigger"]`).

## Fix

- New shared helper `openOSelectDropdown(page, rootLocator)`
(`tests/ui-testing/pages/alertsPages/oselectHelpers.js`) that clicks the
inner `-trigger` and **retries until `aria-expanded="true"`** — the reka
trigger can open-then-close on a single Playwright click.
- `alertsPage.openAdvancedTemplateOverrideSelect()` uses the helper; the
spec now calls that page-object method (no raw locator in the spec).
- Routed **all 8** destination-dropdown open sites in
`alertCreationWizard.js` through the same helper (DRY; the same latent
bug affected every one).

## Validation (local, against running o2)

| Spec | Result |
|------|--------|
| `alerts-bugs.spec.js` | **4 passed** |
| `alerts-regression.spec.js` | **5 passed** (incl. Bug #9967 PromQL) |

Both originally-failing tests are green; no regressions across the
changed destination sites. Passed a Sentinel code-quality review (0
critical).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 14:36:41 +00:00
..
2024-11-13 15:13:36 +05:30

zinc-observe-ui-automation

Playwright UI Testing

Installation

npm install

Running Tests

cd playwright-runner
npm start

Then open http://localhost:3000 to access the test runner interface.

Using Command Line

# Run all tests
npx playwright test

# Run specific test by tag
npx playwright test -g @alertsImportExport

# Run in headed mode
npx playwright test --headed

# Run specific test file
npx playwright test Alerts/alerts-import.spec.js

Environment Configuration

Tests can be configured using:

  1. Playwright Runner UI - Set environment variables through the web interface
  2. Environment Variables - Set variables in terminal or .env file