Skip to content

fix(ci): correct wiki repo URL, add Home.md, SQLite history, remove Quick Presets - #119

Merged
MyNameIsEdi merged 7 commits into
mainfrom
feat/playwright-dashboard-upgrade
May 25, 2026
Merged

MyNameIsEdi merged 7 commits into
mainfrom
feat/playwright-dashboard-upgrade

Conversation

@MyNameIsEdi

@MyNameIsEdi MyNameIsEdi commented May 25, 2026 •

Copy link
Copy Markdown
Owner

Description

Bundles two CI fixes with the dashboard feature work from this branch.

CI fixes:

  • update-wiki.yml was cloning the old repo name (intelligent-testing-toolkit instead of open-qa), causing the wiki sync job to fail on every push to main that touched README.md. Fixed the URL and added a guard so the copy step doesn't fail if .github/wiki/ is ever empty.
  • Created .github/wiki/Home.md — the wiki directory didn't exist at all, so the cp step died immediately.

Dashboard features:

  • SQLite run history — replaces per-run JSON files with better-sqlite3 (test-results/runs.db). archiveRun() INSERTs into the DB; history, results replay, and clear all query SQLite directly.
  • Remove Quick Presets — deleted the preset card and all related code from the Settings panel.
  • Run Output above Run History — terminal log now appears before the history table so live output is visible without scrolling.
  • Expanded DocsView — 5 → 8 sections; added Authentication, Visual & A11y, and CI/CD chapters.
  • Stop button fix — runAbortRef pattern ensures Stop aborts the active SSE fetch without blocking the next run.
  • streamSummary crash fix — removed stale RUNS_DIR reference left from the JSON-file era.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Summary by CodeRabbit

  • New Features

    • Created Open-QA wiki landing page with architecture overview and quick links
    • Persistent run history now stored in SQLite database instead of individual files
    • Expanded documentation with new sections: Authentication, Visual & A11y, and CI/CD
  • Bug Fixes

    • Fixed Stop button race condition affecting test execution cancellation
    • Resolved stale reference issue in stream summary
  • Documentation

    • Updated README for database-based history storage
    • Enhanced CHANGELOG with feature updates
  • Chores

    • Added SQLite database dependency support

Review Change Stack

MyNameIsEdi and others added 7 commits May 25, 2026 05:58
… above history

- Replace JSON-file run storage with SQLite (better-sqlite3):
  archiveRun() now writes id/run_at/spec/counts/run_log/raw_json into
  a single runs.db; GET /history reads via prepared SELECT; GET
  /results/:id reads raw_json + run_log from DB; DELETE /history
  executes DELETE FROM runs — no more RUNS_DIR file scatter
- Remove Quick Presets entirely: delete Preset interface, SV_CONFIG,
  SV_ALL_SPECS, PRESETS array, applyPreset(), noPresets prop, both
  JSX blocks (SettingsView card + always-visible presets bar), and
  unused Zap icon import
- Move Run Output terminal above Run History (RunsPanel) so users see
  the latest stdout immediately after a run without scrolling past the
  history table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tent

- Quick Start: add playwright.config.ts essentials block (multi-project,
  reporters, trace/screenshot/video defaults)
- Locator Strategies: add getByTitle(), expand code examples with
  chaining, correct all descriptions
- Core Assertions: expand from 11 to 20 assertions across 4 card groups
  (toBeAttached, toBeDisabled, toBeEditable, toHaveValues, toHaveClass,
  toHaveCSS, toHaveCount, toHaveAccessibilityTree); add negation +
  soft-assertion examples
- Common Patterns: add Parallel & Sharded runs section; expand POM with
  typed Locator fields; update Fixtures with DashboardPage; add
  network modify-response pattern
- Authentication (new section): global-setup storageState, multi-role
  auth, API-based JWT auth, config project setup
- Visual & Accessibility Testing (new section): screenshot workflow
  steps, mask/maxDiffPixelRatio options, axe-core WCAG 2.1 AA integration,
  accessibility checklist (keyboard, contrast, alt text, RTL, ARIA)
- CI / CD Integration (new section): GitHub Actions workflow, sharding
  across parallel jobs, environment variables, recommended CI flags
- CLI Reference: expand from 11 to 16 flags (--grep-invert,
  --forbid-only, --shard, --update-snapshots, --pass-with-no-tests);
  add merge-reports and --help examples
- Add GitBranch icon import; add 3 new TOC entries and sidebar links

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… cache

- Remove RUN_HISTORY_KEY and the lazy localStorage initialiser for
  runHistory — state now always starts as [] and is populated by the
  first fetchHistory() call on mount
- Remove the useEffect that wrote runHistory back to localStorage after
  every change (stale cache was masking real DB data on page refresh)
- Add one-time localStorage.removeItem('pw_run_history_v1') at module
  level to clear any stale pre-SQLite data in existing browsers
- Remove LIMIT 30 cap from GET /api/playwright/history — all runs are
  returned from SQLite; caller can pass ?limit=N to override

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Stop button was calling setRunning(false) directly, which only
updated local state. The AbortController inside runWithSSE/runDynamicTest
was never invoked, so:
  1. The fetch/SSE stream kept running server-side after Stop was clicked
  2. When the orphaned stream eventually finished, its finally block
     called setRunning(false) again — silently cancelling any new run
     the user had just started

Fix: store the AbortController in runAbortRef (useRef). The Stop button
now calls runAbortRef.current?.abort() which throws an AbortError inside
the running fetch, causing the catch block to log [TIMEOUT] and the
finally block to clean up normally. Both runWithSSE and runDynamicTest
are updated; the ref is cleared in each finally block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… SQLite

streamSummary() still used path.join(RUNS_DIR, ...) to load the archived
run JSON for the AI post-mortem, but RUNS_DIR was deleted in the SQLite
migration. This crashed the server the moment a run finished, keeping
the dashboard stuck in RUNNING state forever.

Fix: when creds.runId is set, query the runs table directly
(SELECT raw_json FROM runs WHERE id = ?); fall back to RESULTS_PATH
only when no runId is provided (legacy path).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…& run output reorder

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The update-wiki workflow was cloning the old repo name
(intelligent-testing-toolkit instead of open-qa) and the .github/wiki/
directory didn't exist, causing the cp step to fail immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b369b210-1386-4091-a33d-924a4e73c44e

📥 Commits

Reviewing files that changed from the base of the PR and between a7c2235 and 4418690.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • .github/wiki/Home.md
  • .github/workflows/update-wiki.yml
  • CHANGELOG.md
  • README.md
  • package.json
  • server/index.ts
  • ui/src/pages/PlaywrightDashboard.tsx

📝 Walkthrough

Walkthrough

This PR migrates Playwright run archival from filesystem JSON files to a SQLite database, refactors corresponding API endpoints, improves test run cancellation via AbortController tracking, removes the Quick Presets UI feature, relocates the run output terminal, and substantially expands dashboard documentation with updated guides and CLI references.

Changes

SQLite Run History & Dashboard Modernization

Layer / File(s) Summary
SQLite Dependencies & Schema Setup
package.json, server/index.ts
Add better-sqlite3 and @types/better-sqlite3 dependencies; initialize /test-results/runs.db with a runs table storing run metadata, aggregated test counts, durations, capped run logs, and raw Playwright JSON.
Run Archival to SQLite
server/index.ts
Refactor archiveRun() to replace filesystem writes with SQL INSERT OR REPLACE; compute aggregated passed/failed/skipped totals; store capped run log text and full raw JSON for later normalization.
History & Results API Endpoints
server/index.ts
Rewrite /api/playwright/history (list archived runs with SQL ordering and optional LIMIT), /api/playwright/results/:runId (select stored raw_json and run_log by id), and DELETE endpoint (clear all runs table rows) to use SQLite instead of filesystem.
Results Loading from SQLite
server/index.ts
Update streamSummary() to prefer SQLite-stored results when runId is provided; remove filesystem path selection logic; fall back to pw-results.json only when runId is absent.
Dashboard Run History & Abort Infrastructure
ui/src/pages/PlaywrightDashboard.tsx
Clear legacy pw_run_history_v1 localStorage on dashboard load; initialize runHistory empty instead of from storage; add runAbortRef to track active AbortController for SSE stream cancellation; remove localStorage persistence effect.
Run Abort Control Implementation
ui/src/pages/PlaywrightDashboard.tsx
Track AbortController in runWithSSE and runDynamicTest by assigning to runAbortRef.current; clear ref in finally blocks; update Stop button to abort via runAbortRef instead of only toggling run state.
Presets Feature Removal
ui/src/pages/PlaywrightDashboard.tsx
Delete presets declarations block; remove noPresets prop from SettingsView signature; update SettingsView render logic; remove Quick Presets bar from dashboard header; remove noPresets when invoking SettingsView.
Documentation Content & UI Updates
ui/src/pages/PlaywrightDashboard.tsx
Update DocsView TOC with GitBranch icon for CI/CD; replace Official Docs link chips; rewrite Quick Start, Locator Strategies, Core Assertions, Common Patterns sections with updated code samples and guidance; expand CLI Reference options and bash examples.
Run Output Relocation & Layout
ui/src/pages/PlaywrightDashboard.tsx
Relocate run output terminal UI earlier in dashboard render tree above run history; remove previous terminal placement; maintain line-coloring logic in new position.
Changelog, README & Wiki
CHANGELOG.md, README.md, .github/wiki/Home.md, .github/workflows/update-wiki.yml
Document Unreleased changes in CHANGELOG; update README feature description for SQLite storage; create wiki home page with architecture overview; update wiki clone workflow with conditional file-copy logic.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • MyNameIsEdi/open-qa#118: Implements the same SQLite-based test-results/runs.db migration and dashboard UI fixes (preset removal, Stop-button abort ref).
  • MyNameIsEdi/open-qa#114: Overlaps in PlaywrightDashboard.tsx modifications to SSE/summary handling and archived run result/log hydration.
  • MyNameIsEdi/open-qa#113: Both PRs update server/index.ts streamSummary() to use runId-driven result loading; this PR uses SQLite while prior PR used filesystem RUNS_DIR.

Poem

🐰 A database hops into the fray,
Replacing files that clutter the way,
With SQLite's grace, history runs free,
And AbortControllers let tests cease to be!
Stop buttons now snap with a swift abort—
the Dashboard's run saga ends as it ought. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/playwright-dashboard-upgrade

Comment @coderabbitai help to get the list of available commands and usage tips.

@MyNameIsEdi
MyNameIsEdi merged commit 4aefea2 into main May 25, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant