mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 00:09:35 +00:00
## PR #12726 — Change Summary ### Problem Test `should render table with histogram(_timestamp) as X and count aggregation as Y` was flaky with: Error: locator.scrollIntoViewIfNeeded: Element is not attached to the DOM at dashboard-chart.js:163 Root cause: After searchInput.fill(fieldName), Vue reactively re-renders the field list multiple times (debounce / virtual scroll). waitFor({ state: "visible" }) passed during an intermediate render, then Vue triggered another re-render, detaching the element before scrollIntoViewIfNeeded() could act on it. --- ### Changes Made 1. tests/ui-testing/pages/dashboardPages/dashboard-chart.js — Flakiness Fix - Removed redundant scrollIntoViewIfNeeded() — hover() already auto-scrolls - Wrapped hover() in a 3-attempt retry loop that re-waits for the element after each DOM detachment - Raised initial waitFor timeout from 5000ms → 10000ms for heavier field lists 2. tests/ui-testing/playwright-tests/Dashboards/dashboard-table-chart.spec.js — Two changes a) Replaced waitForStreamComplete with page.waitForResponse + explicit status assertion - waitForStreamComplete silently timed out on non-200 responses — no assertion - page.waitForResponse resolves on any matching URL response, then expect(apiResponse.status()).toBe(200) fails clearly on 401/500 b) Fixed vacuous assertion (Test Inspector finding) - Original predicate had && r.status() === 200 — waitForResponse would only resolve on 200, making expect(apiResponse.status()).toBe(200) always true (no-op) - Removed status condition from predicate so the expect() is now a real assertion --- ### Test Inspector Findings Addressed | Finding | Status | |----------------------------------------------------------------------|---------------------| | Vacuous assertion — expect(apiResponse.status()).toBe(200) was no-op | Fixed | | Selector cross-validation — o-field-list-row-* matches OFieldList.vue:67 | Verified |
zinc-observe-ui-automation
Playwright UI Testing
Installation
npm install
Running Tests
Using Playwright Runner UI (Recommended)
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:
- Playwright Runner UI - Set environment variables through the web interface
- Environment Variables - Set variables in terminal or .env file