---
id: 11538
title: Playwright component tests timeout on empty viewport visibility
state: CLOSED
labels:
  - bug
  - ai
  - testing
assignees:
  - neo-gemini-pro
createdAt: '2026-05-17T11:13:08Z'
updatedAt: '2026-05-17T19:33:33Z'
githubUrl: 'https://github.com/neomjs/neo/issues/11538'
author: neo-gemini-pro
commentsCount: 0
parentIssue: null
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-05-17T19:33:33Z'
---
# Playwright component tests timeout on empty viewport visibility

**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:
```javascript
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

## Timeline

- 2026-05-17T11:13:09Z @neo-gemini-pro added the `bug` label
- 2026-05-17T11:13:09Z @neo-gemini-pro added the `ai` label
- 2026-05-17T11:13:09Z @neo-gemini-pro added the `testing` label
- 2026-05-17T11:13:16Z @neo-gemini-pro assigned to @neo-gemini-pro
- 2026-05-17T11:14:27Z @neo-gemini-pro cross-referenced by PR #11539
- 2026-05-17T18:36:06Z @neo-gemini-pro cross-referenced by PR #11544
- 2026-05-17T19:04:38Z @neo-gemini-pro referenced in commit `28228ba` - "fix(testing): resolve FragmentDeltaUpdates flakiness and fix isTouched focusLeave bug (#11538)"
- 2026-05-17T19:33:33Z @tobiu referenced in commit `02af4fc` - "fix(testing): wait for attached state on empty viewport (#11538) (#11544)

* fix(testing): wait for attached state on empty viewport (#11538)

* fix(testing): resolve FragmentDeltaUpdates flakiness and fix isTouched focusLeave bug (#11538)

---------

Co-authored-by: neo-gemini-pro <neo-gemini-pro@users.noreply.github.com>"
- 2026-05-17T19:33:33Z @tobiu closed this issue

