LearnNewsExamplesServices
Frontmatter
id7254
titleInstall Playwright and Convert First Siesta Test
stateClosed
labels
enhancement
assigneestobiu
createdAtSep 25, 2025, 11:16 PM
updatedAtSep 25, 2025, 11:26 PM
githubUrlhttps://github.com/neomjs/neo/issues/7254
authortobiu
commentsCount0
parentIssue7262
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 25, 2025, 11:26 PM

Install Playwright and Convert First Siesta Test

Closed v11.0.0 enhancement
tobiu
tobiu commented on Sep 25, 2025, 11:16 PM

Install the Playwright test runner and convert an initial Siesta unit test to the new framework to establish a baseline pattern for future test migration.

Implementation Notes

The initial approach was to convert the VDOM unit test into a browser-based component integration test. However, the goal was refined to keep it as a pure VDOM unit test running within a Node.js environment.

The final, successful implementation uses Playwright's test runner without a browser. It works by:

  1. Creating a setup.mjs file to mock the necessary browser globals (DOMRect) and configure the Neo namespace on globalThis for a headless environment.
  2. Configuring playwright.config.mjs to run without a browser or web server.
  3. Writing the test spec as a pure Node.js module, importing the framework classes directly and asserting against the VDOM data structures returned by the component's methods.

This pattern allows for fast, browser-less unit testing of framework components using the Playwright test runner.

Tasks

  • Install @playwright/test dependency.
  • Create playwright.config.mjs for a Node.js test environment.
  • Create test/playwright/setup.mjs to configure the Node.js global scope.
  • Convert test/siesta/tests/classic/Button.mjs to test/playwright/classic/button.spec.mjs.
  • All tests are passing.
  • Move playwright.config.mjs into test/playwright/ and update paths.
tobiu assigned to @tobiu on Sep 25, 2025, 11:16 PM
tobiu added the enhancement label on Sep 25, 2025, 11:16 PM
tobiu referenced in commit af081ad - "Install Playwright and Convert First Siesta Test #7254" on Sep 25, 2025, 11:18 PM
tobiu closed this issue on Sep 25, 2025, 11:26 PM
tobiu added parent issue #7262 on Sep 27, 2025, 1:18 PM