Files
openobserve/tests/ui-testing
Shrinath RaoandClaude Opus 4.8 8844a46863 test: fix Sankey 'No Data' edge test starved by textContent auto-wait (#12848)
## What

Fixes the consistently-failing E2E test
`Dashboards/dashboard-sankey.spec.js:400 › should show No Data when only
Source field is configured` (surfaced by o2-enterprise run
[28041876852](https://github.com/openobserve/o2-enterprise/actions/runs/28041876852/job/83025088903),
`e2e / Dashboards-Charts`).

## Root cause

With **only a Source field**, the Sankey config is incomplete, so
clicking Apply triggers panel **validation errors** (`DashboardErrors`:
"Add one field for the target / value") and never runs the query — the
`[data-test="no-data"]` element is never rendered.

The poll predicate called `noDataLocator.textContent()` **first**.
`locator.textContent()` auto-waits for its element to attach, so it
blocked for the full 12s timeout and the predicate **never reached** the
`dashErrorLocator.isVisible()` fallback that would have passed. The
failure trace confirms it: `textContent` on `no-data` called 1×,
`isVisible` on `dashboard-error` called 0×. Deterministic, not flaky
(failed all 4 CI attempts × 4 retries).

## Fix

- Check the non-blocking `dashErrorLocator.isVisible()` **first**.
- Guard the no-data text read with `count()` (instant, no auto-wait);
only call `textContent()` once the element exists.
- Comments/message updated to reflect that validation errors are the
expected outcome for an incomplete Sankey config.

No page-object changes needed.

## Verification

Ran locally against `http://localhost:5080` **3× — all passed** (16.4s /
15.5s / 15.8s), with the validation error detected on the first poll
iteration each time.

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

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 02:05:32 +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