Files
openobserve/tests/ui-testing/playwright-tests/RegressionSet
Shrinath Rao 2834186b8a test(e2e/alpha1): unique per-run alert destination/template so Add Alert button enables (#13783)
## Why

After #13776 merged, the alpha1 **RegressionSet** shard still failed —
but on a **new, different** cause than #13776 fixed. All 4
`alerts-regression` tests died at the very first step
(`clickAddAlertButton`) because the button was **disabled**:

```
<button disabled aria-disabled="true"
        title="No destinations available"
        data-test="alert-list-add-alert-btn">
19 × locator resolved to disabled  → toBeEnabled() timed out after 15s
```

## Root cause (reproduced live on the RegressionSet org, auto_org_2)

[`AlertList.vue`](web/src/components/alerts/AlertList.vue#L51) disables
the Add Alert button while `destinations.length === 0`:
```vue
:disabled="!destinations.length || !templates.length"
:title="!destinations.length ? t('alerts.noDestinations') : ''"
```

On the **shared** cloud org the **fixed** names `e2e_promql_dest` /
`e2e_promql_template` were stuck ghost records — a concurrent run's
cleanup couldn't fully delete them (UI delete timed out /
`destinations_templates_fk` 500). So the beforeAll create returned `400
"already exists"`, yet the destinations list loaded **empty**, keeping
the button disabled through the 15s `toBeEnabled` wait. Not a product
regression — the org simply had no *loadable* destination.

This is the same **shared-org fixed-name collision** class fixed for
streams in #13776.

## Fix

- `e2e_promql_dest` / `e2e_promql_template` → `..._<RUN_TOKEN>` (unique
per run), so the beforeAll always creates a real, loadable destination.
Keeps the `e2e_promql_` prefix so `cleanup.spec.js` still reclaims them.
- Gate the beforeAll on the destination actually appearing in the
`/alerts/destinations` list API before tests run, so the button is
reliably enabled (`destinations.length > 0`) instead of racing the
fetch.

## Verification (alpha, RegressionSet org auto_org_2 — reproduced 100%
before)

- Before: `Add Alert` disabled → `toBeEnabled` 15s timeout → 4/4 fail.
- After: `Destination confirmed in list API | e2e_promql_dest_<token>` →
button enabled → **alerts-regression 5/5 pass** (#9967, #10899, #10872,
#10110, #10472); alerts saved for both `>=` and `<=`.

## Scope
OSS-only test file. Picked up by the ENT alpha1 workflow the same way as
#13776 (checks out opensource `main`, or dispatch with
`o2_opensource_repo=test/alerts-regression-destinations-gate`).
2026-08-12 11:57:01 +00:00
..