Files
openobserve/tests/ui-testing
ktx-akshay 39c1d8ae83 test: reduce Logs-Builder-Basic e2e runtime by removing dead waits and duplicate setup (#13080)
## Reduce `Logs-Builder-Basic` e2e shard runtime — ~10 min → ~5 min

### 🎯 Result (measured on CI)

| Metric | Before | After | Saved |
|--------|--------|-------|-------|
| **`Logs-Builder-Basic` shard** | **10m 05s** | **5m 12s** | **~4m 53s
(≈48% faster)** |

The shard runtime is cut roughly in half. Most of the old time was fixed
sleeps, waits that always ran their full timeout, and duplicated
per-test setup — not actual test logic. **No test cases, steps, or
assertions were removed.**

### What we changed

| # | Area | Before | After | Saving |
|---|------|--------|-------|--------|
| 1 | `initQueryBuilderTest` setup | Logs page loaded twice (helper
`goto` + `selectStream` navigates again) | Navigate once | 1 page load ×
~41 tests |
| 2 | `waitForBuildTabLoaded` | Always waited up to 10s for editor to
fill, even when it's meant to be empty | Skip when SQL mode is off |
~10s dead wait on many tests |
| 3 | `enableSqlModeIfNeeded` | 2s watcher wait + 500ms sleep, even
where the watcher never fires | Gated to Build tab; waits on real signal
| ~2.5s × ~35 tests |
| 4 | `disableSqlModeIfNeeded` | Fixed 500–600ms sleeps | Deterministic
wait on editor update | Blind sleeps removed |
| 5 | `applyQueryButton` | Clicked Run blindly | Waits for button ready
first | Fewer early-click retries |
| 6 | `pagination.spec` | Fresh stream ingest + index-wait per test (9×)
| One ingest per worker, reused | 8 redundant ingests + waits |
| 7 | `pagination.spec` | Dead `waitForTimeout(2000)` per streaming test
| Removed | ~2s × 5 tests |
| 8 | `unflattened.spec` | Search run twice with 3s + 1s sleeps | Single
run | ~5s × ~8 calls |
| 9 | `unflattened` row scan | Fixed 3s sleep per row | Wait for content
to render | 15-row scan: ~97s → seconds |
| 10 | `unflattened.spec` | Blind sleep after ingest | Poll until stream
queryable | No over-waiting |

### Bonus

Items 2–5 live in the shared `logsPage` page object, so
`Logs-Builder-Advanced`, `Logs-Core`, and `Logs-Features` shards get
faster for free too.

### Notes

| Item | Detail |
|------|--------|
| `playwright.yml` | Unchanged — shard layout stays as-is |
| Assertions | Preserved everywhere (e.g. pagination still checks the
same record counts) |
| Validation | All 52 tests still discovered by `playwright --list`;
shard confirmed green on CI at 5m 12s |
2026-07-08 09:47:08 +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