openobserve/tests/ui-testing
Prabhat Sharma 624425a08a
feat(editor): rebuild query autocomplete, and fix the value path behind it (#13586)
Design at autocomplete/autocomplete.md

Rewrites the query editor's autocomplete across every surface that has
one, and
follows the field-value path far enough to fix the bugs it was hiding.
53
commits, in six phases; each phase was written test-first, reviewed
adversarially, and checked in a browser before the next one started.

## What was wrong

The completion providers were wired inconsistently. Six surfaces bound a
resolver that was never defined, so their value completion could not
resolve at
all — SLO, dashboards and anomaly detection among them. Traces never
bound
`:suggestions`. Alerts never called `updateStreamKeywords`. PromQL ran a
second
editor runtime purely for its grammar, and asked
`/prometheus/api/v1/series`
— the heaviest endpoint available — for data the stream schema already
has.

## Phases

**1 — icons, staleness, quoting.** Correct `CompletionItemKind` glyphs,
stream
keywords refreshed when the stream changes, `spath` quoting.

**2 — the function catalog.** Custom functions get one tab stop per
argument,
org VRL functions stop appearing twice, column types read from
`dataType` as
well as `type`.

**3 — signature help, hover, async completion.** Providers return real
`CompletionList`s with `incomplete: true`, so a list that arrives late
is
re-queried rather than pinned.

**4 — numeric ranking.** Numeric columns sort first inside a numeric
aggregate.

**5 — values for streams nobody has searched.** The value cache only
ever held
what a search had already returned, so a stream you had not queried
offered
nothing. Values are now fetched on demand, bounded (10s timeout, 60s
cooldown,
one in-flight request per key), and shared between the editor and the
builder.
PromQL joins the same path: labels from the stream schema, values from
the
shared cache. `/series` now has zero production callers.

**6 — one way to fetch a value.** Item 22 only, in this PR.

## The dashboard filter 400

Clicking the ✕ beside "Select Field" in a filter's dropdown sets the
column to
`{}`, and the watcher on `condition.column` then asks for that column's
values.
`loadFilterItem` built `fields: [row.field]` out of `undefined`,
JSON.stringify
turned that into `null`, and the server answered

```
400 {"code":400,"message":"SerdeJsonError# invalid type: null, expected a string"}
```

`_values_stream` answers 400, not an empty result, for each way a piece
of the
payload can go missing — and every one is reachable: an unresolved
stream alias
(`.find(…)?.stream`), a stream not yet chosen (`""`), a range not yet
set. The
range fails differently: `meta.dateTime` starts as `{start_time: ""}`
and
`""?.toISOString()` does not short-circuit, so it throws and both
callers
surface "Something went wrong!" for a lookup the user never asked to
fail.

Guarded at the two callers, where the payload is built and where the
throw
happens. Not at `fetchFieldValues` — a guard there is too late to stop
the
throw and would duplicate validation the callers need anyway. The
trigger is
left alone: re-picking a field must still load its values.

## Notable removals

CodeMirror is gone — it was still bundled for the PromQL grammar alone.
Bundle 26.3 MB → 25.43 MB; the PromQL chunks 442.7 KB → 20.6 KB. The
PromQL
term catalog went from 7 entries to 113, generated from Prometheus's own
tables
and vendored with its MIT notice.

## Verification

- 76 files, +10.5k/−1.4k, ~9,100 tests passing across the touched areas.
- `vue-tsc` clean, `npm run build` exit 0.
- Every phase checked in a running browser against a live instance,
including
the 400 above: the ✕ now produces no request and no toast, adding a
filter and
re-picking a field each still fetch once, and the value list still
populates.

## Known, deliberately out of scope

- A filter still fetches twice (once on add, once on open) — that is
item 23,
  the cache read, not this PR.
- `useMetricsExplorer.loadFilterItem` has the same unguarded
`toISOString()`
  pattern on a different surface.
- `services/metrics.ts` and `services/search.ts` still carry dead
  `get_promql_series` wrappers now that nothing calls `/series`.
2026-08-03 22:29:04 +00:00
..
ci-matrix ci(playwright): single-source ALL shard matrices via ci-matrix/ manifests (#13606) 2026-08-03 17:36:29 +00:00
fixtures chore(deps-dev): bump esbuild from 0.24.2 to 0.28.1 in /tests/ui-testing/fixtures/rum/npm-app (#13072) 2026-07-07 11:59:23 +00:00
pages fix: restore Table default log-detail view (#13368) + heal alert-name inline-edit read (#13585) 2026-08-03 07:19:28 +00:00
playwright-results test: e2e test dino poc (#8771) 2025-10-10 18:30:24 +05:30
playwright-tests feat(editor): rebuild query autocomplete, and fix the value path behind it (#13586) 2026-08-03 22:29:04 +00:00
scripts test: add alpha1 cloud compatibility for E2E logs tests (#10763) 2026-03-07 07:00:07 +05:30
utils test(e2e): stabilize alpha1 cloud E2E — shared https-ingestion fix + Streams revamp/cloud-race/CI-flake fixes (#13191) 2026-07-17 06:15:43 +00:00
.gitignore ci: add test-assist-ci caller + fixture data (#12946) 2026-07-01 05:24:27 +00:00
.nycrc fix: e2e test coverage setup (#4897) 2024-11-13 15:13:36 +05:30
README.md test: File cleanup for cypress files, removed websocket tests (#8027) 2025-08-18 10:54:15 +05:30
env.sh feat: add MCP category annotations to API endpoints (#9937) 2026-01-15 17:05:43 +08:00
package-lock.json chore(deps): bump qs from 6.15.1 to 6.15.2 in /tests/ui-testing (#12168) 2026-05-29 17:11:21 +00:00
package.json chore: last refreshed for logs and traces (#11398) 2026-04-23 11:30:00 +05:30
playwright-alpha1.config.js test(alpha1): split shard logins across multiple Dex users (#13602) 2026-08-03 15:00:09 +00:00
playwright.config.js test(ci): loud stdout banner when Playwright retries a test (#13529) 2026-07-29 06:15:33 +00:00

README.md

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