Frontmatter
| id | 8851 |
| title | Exploration: Neural Link Driven Playwright Tests (Deep E2E) |
| state | Closed |
| labels | enhancementno auto closeaitestingarchitecture |
| assignees | tobiu |
| createdAt | Jan 21, 2026, 3:53 PM |
| updatedAt | Apr 8, 2026, 12:16 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8851 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | 9782 Neural Link Playwright SDK Integration 9783 Implement NeuralLink Playwright Test Fixture |
| subIssuesCompleted | 2 |
| subIssuesTotal | 2 |
| blockedBy | [ ] 9821 Enhancement: Neural Link VDOM Sync Primitives, [ ] 9820 R&D: Grid Component Mutability & Column Synchronization, [ ] 9819 R&D: Identify Ideal Candidates for Whitebox E2E Testing |
| blocking | [] |
| closedAt | Apr 8, 2026, 12:16 PM |
Exploration: Neural Link Driven Playwright Tests (Deep E2E)

✦ While standard Neo.mjs unit tests (like RealWorldUpdates.spec.mjs) have some visibility because they run inside the framework's context (single-threaded mode), E2E tests running against a real production build (Worker mode) are typically walled off.
Neural Link bridges that wall.
By getting write access (set_instance_properties, evaluate_expression), we unlock "God Mode" for E2E testing:
- State Injection: Skip the 10-step wizard setup by injecting the final state directly into the Store/Model.
- Chaos Engineering: Randomly kill a window or disconnect a worker connection to verify recovery logic.
- Hot-Patching during Test: Inject a console.log spy into a specific method on the fly to assert it was called.
The topology check is indeed the first handshake. Once we know who is online (App Worker ID), we own the runtime.
Issue #8851 serves as the placeholder for this "Next Level" capability. It aligns perfectly with the "Application Engine" narrative—providing professional-grade tooling that toy frameworks can't match.

Input from Antigravity (Gemini 3.1 Pro):
✦ ### White-Box E2E Testing Implemented
The implementation for Neural Link Driven Playwright Integration is complete.
Changes Included:
- Enhanced
Bridge.mjsto authorizerole=testconnections and updatedConnectionService.mjsto cacheappName.- Developed
waitForSessioninConnectionService.mjsto handle Playwright's sequential test sync requirements.- Developed
neuralLinktest fixture exposingapp.getComponent,app.getStore,app.callMethod, andapp.setProperties.- Addressed robust DOM ID extraction inside the smoke test to support dynamic App Worker context bindings.
Verification: Fully verified with a new E2E smoke test (
test/playwright/e2e/NeuralLink.spec.mjs), which successfully intercepts internal component state (neo-viewport-1or dynamic ID) from worker memory seamlessly via websocket, modifies it natively withsetProperties, and confirms the DOM mutates viatoHaveCSS(). All without interacting directly with Playwright page handles!Changes have been pushed to
feature/issue-8851-neural-link-playwright.
Concept
Move beyond traditional "Black-Box" E2E testing (which only inspects the DOM) to "White-Box" testing that can inspect the internal state of the Neo.mjs App Worker directly during a Playwright test run.
By integrating the Neural Link (NL) SDK (
ai/services.mjs) into the Playwright Node.js environment, tests can establish a WebSocket connection to the running application.The Architecture
Key Benefits
1. Multi-Window Mastery
Testing multi-window apps with Playwright is notoriously flaky due to context switching. With NL, we don't need to switch the Playwright "page" context to inspect a popup. We simply ask the App Worker (which owns all windows) for the state of the component, regardless of where it is rendering.
2. State > DOM
Verifying complex data structures (e.g., a Grid with 10k rows) via DOM selectors is slow and brittle. NL allows direct inspection of Stores, Managers, and Component Configs.
expect(await page.locator('.row').count()).toBe(100)expect(await app.getStore('my-store').count).toBe(100)3. Event Telemetry
We can potentially subscribe to internal framework events (
vnodeInitialized,storeLoaded) to create precise, deterministic wait conditions, eliminating flakywaitForTimeoutcalls.Implementation Tasks
ai/services.mjsto ensure it can be imported and instantiated easily within a Node.js Playwright environment (outside the context of a full Agent).Example Usage
test('Panel moves to new window correctly', async ({ page, neuralLink }) => { // 1. Setup const app = await neuralLink.connectToApp('Helix'); const panelId = 'neo-panel-1'; // 2. Initial State Check (Internal) const initialProps = await app.getComponent(panelId); expect(initialProps.windowId).toBe(1); // 3. Action (User Input via Playwright) await page.click('#detach-button'); // 4. Verification (Internal via Neural Link) // Wait for the worker to acknowledge the move await expect.poll(async () => { const props = await app.getComponent(panelId); return props.windowId; }).not.toBe(1); });Strategic Value
This capability would uniquely position Neo.mjs as an exceptionally testable framework for complex, multi-window, data-heavy applications—something traditional frameworks struggle to offer.