Files
openobserve/tests
Shrinath RaoandClaude Opus 4.5 3bdf5cb210 test: resolve E2E test timeouts by replacing networkidle with deterministic waits (#10211)
## Summary

This PR fixes flaky E2E tests by replacing unreliable `networkidle`
waits and hard-coded timeouts with deterministic waiting strategies.

### Changes Made

#### 1. Replace `networkidle` with `domcontentloaded` + explicit waits
- `networkidle` waits for zero network activity for 500ms, which times
out in SPAs with persistent connections (WebSockets, polling, telemetry)
- Replaced with `domcontentloaded` plus explicit element/URL waits

#### 2. Replace hard-coded `waitForTimeout` with `waitForResponse`
- `alerts-incidents-tabs.spec.js`: Use `waitForResponse` for `/config`
API instead of `waitForTimeout(2000)`
- `logs-regression.spec.js`: Use `waitForResponse` for `/streams` API
instead of `waitForTimeout(3000)`

#### 3. Fix Alerts/Incidents menu visibility timing
- Increased timeout for incidents menu item (depends on
`service_graph_enabled` from config API)
- Added `waitFor` pattern before expect assertions in `alertsPage.js`
- Use `waitForResponse` for search API after page refresh

#### 4. Enable parallel test execution
- Enable parallel mode in `ui-regression.spec.js`
- Use unique stream names (with timestamp) to avoid test conflicts

## Files Changed

| File | Changes |
|------|---------|
| `logs-regression.spec.js` | Replace networkidle → domcontentloaded,
waitForTimeout → waitForResponse |
| `ui-regression.spec.js` | Enable parallel mode, use waitForURL for
navigation |
| `alerts-incidents-tabs.spec.js` | Replace networkidle →
domcontentloaded, waitForTimeout → waitForResponse |
| `alertsPage.js` | Improve menu visibility waits, replace networkidle
with domcontentloaded |

## Fixes

- Alerts E2E test timeouts waiting for incidents menu item
- logs-regression.spec.js: #9388 saved views, #9475 apostrophes
- ui-regression.spec.js: #9325 header navigation, #9565 org_identifier

## Test Plan

- [x] All alerts-incidents-tabs tests pass locally (3 passed, 2 skipped)
- [x] logs-regression tests pass locally
- [x] ui-regression tests pass locally
- [x] Tests run in parallel successfully

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 19:11:13 +05:30
..
2024-09-22 17:57:47 +08:00