LearnNewsExamplesServices
Frontmatter
id7897
titleIndex `test/playwright/` in Knowledge Base as raw source
stateClosed
labels
enhancementaitesting
assigneestobiu
createdAtNov 24, 2025, 1:37 PM
updatedAtNov 24, 2025, 2:07 PM
githubUrlhttps://github.com/neomjs/neo/issues/7897
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 24, 2025, 2:02 PM

Index test/playwright/ in Knowledge Base as raw source

Closed v11.10.0 enhancementaitesting
tobiu
tobiu commented on Nov 24, 2025, 1:37 PM

Index test/playwright/ in Knowledge Base as raw source

The test/playwright/ directory contains the automated testing suite. This content is vital for the AI agent to understand how to write and maintain tests for the framework.

Unlike the ai/ directory, this content:

  1. Does NOT need to be in the public Docs App.
  2. Does NOT follow the strict class-based structure required by JSDoc.
  3. Should be indexed as raw source files with a new type: test.

Goal

Enhance DatabaseService.mjs to explicitly scan and index the test/playwright directory.

Tasks

  • Update ai/mcp/server/knowledge-base/openapi.yaml to include test as a valid type enum for the query_documents tool.
  • Modify ai/mcp/server/knowledge-base/services/DatabaseService.mjs to:
    • Implement a indexRawDirectory method (or similar) to scan a directory recursively.
    • Call this method for test/playwright during the createKnowledgeBase process.
    • Assign the type: 'test' to these chunks.
    • Note: There are no node_modules inside test/playwright, so no exclusion is needed for that.
tobiu added the enhancement label on Nov 24, 2025, 1:37 PM
tobiu added the ai label on Nov 24, 2025, 1:37 PM
tobiu added the testing label on Nov 24, 2025, 1:37 PM
tobiu assigned to @tobiu on Nov 24, 2025, 2:00 PM
tobiu referenced in commit 861b526 - "Index test/playwright/ in Knowledge Base as raw source #7897" on Nov 24, 2025, 2:01 PM
tobiu closed this issue on Nov 24, 2025, 2:02 PM
tobiu
tobiu Nov 24, 2025, 2:07 PM

Input from Gemini:

✦ The implementation is complete and verified.

Changes:

  1. Documentation (ai directory):

    • Modified buildScripts/docs/jsdocx.mjs to include ai/**/*.mjs.
    • Added logic to correctly map the ai directory to the Neo.ai namespace in the JSDoc output.
    • Fixed multiple invalid JSDoc type definitions in AI services to ensure successful parsing.
    • Verified that docs/output/all.json now contains Neo.ai entries.
  2. Tests (test/playwright directory):

    • Updated ai/mcp/server/knowledge-base/openapi.yaml to add test as a valid query type.
    • Enhanced DatabaseService.mjs with indexRawDirectory to scan and index the test/playwright folder as raw source files with type: 'test'.

Verification:

  • A Knowledge Base sync was performed using the Code Execution pattern (sync_knowledge_base.mjs).
  • Manual testing in a parallel session confirmed that queries with type: 'test' correctly return relevant Playwright specs (e.g., test/playwright/unit/button/Base.spec.mjs for query "button").

The Knowledge Base now covers the SDK, MCP servers, and the automated testing suite.