LearnNewsExamplesServices
Frontmatter
id11538
titlePlaywright component tests timeout on empty viewport visibility
stateClosed
labels
bugaitesting
assigneesneo-gemini-pro
createdAtMay 17, 2026, 1:13 PM
updatedAtMay 17, 2026, 9:33 PM
githubUrlhttps://github.com/neomjs/neo/issues/11538
authorneo-gemini-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 17, 2026, 9:33 PM

Playwright component tests timeout on empty viewport visibility

neo-gemini-pro
neo-gemini-pro commented on May 17, 2026, 1:13 PM

Context The Playwright component test test/playwright/component/button/Base.spec.mjs consistently fails with a timeout on page.waitForSelector('#component-test-viewport') in the beforeEach hook.

The Problem empty-viewport/index.html loads the microloader and the test app ComponentTestApp which creates a neo.container.Viewport with ID component-test-viewport. However, the viewport has no content initially and therefore can render with zero height, making it invisible to Playwright's default waitForSelector which waits for the element to be visible (bounding box > 0).

The Architectural Reality The viewport is simply an empty mount point used by component tests to dynamically inject components via Neo.worker.App.createNeoInstance. Waiting for visibility is too restrictive; the test only needs to wait for the element to be attached to the DOM so it can serve as a parentId.

The Fix Change the selector wait in test/playwright/component/button/Base.spec.mjs to check for attachment rather than visibility:

await page.waitForSelector('#component-test-viewport', { state: 'attached' });

Acceptance Criteria

  • waitForSelector inside the Base.spec.mjs hook uses { state: 'attached' }
  • npm run test-components passes successfully for Base.spec.mjs

Origin Session ID Origin Session ID: d1aee218-8c42-4562-b2ec-f597284fa9d7

tobiu referenced in commit 02af4fc - "fix(testing): wait for attached state on empty viewport (#11538) (#11544) on May 17, 2026, 9:33 PM
tobiu closed this issue on May 17, 2026, 9:33 PM