Files
Imhotep/packages/imhotep-playwright
John Dvorak 6c2471052f refactor: runtime isolation — deprecate global singletons, add counter resets
config.ts: @deprecated on configure/getConfig/project/getProjectConfig.
  Current code has zero production callers — dead code path. Functions
  remain for backward compatibility but signal migration to scoped config.

context.ts: @deprecated on setDefaultContext. Documents that consumers
  should call resetDefaultContext() after use in tests to prevent
  context-seed leakage.

pipeline.ts: Export resetTraceCounter() for test isolation of _traceId
  counter variable.

extraction.ts: Export resetPageCacheNamespaceCounter() for test
  isolation of pageCacheNamespaceCounter.

Combined with prior fix (defaultPredicatesRegistered→sentinel check
+ compatibilityWarningEmitted→warnedUis WeakSet), 5 of 7 correctness-
  affecting global mutable state items are now tied down. Remaining:
  globalPredicateRegistry/globalClauseRegistry (already @deprecated
  with explicit injection path via LogicEngineOptions/EvalOptions).

605 SDK + 57 E2E = 662 tests pass.
2026-05-22 15:35:20 -07:00
..

imhotep-playwright

Playwright integration layer for Imhotep. Provides page wrapping, CDP-backed geometry extraction, runtime pooling, property-based test runners, renderer adapters, and preset assertion contracts.

Key Exports

Export Description
imhotep(page, opts) Attach Imhotep to a Playwright page
imhotepComponent(id, opts) Property-run entry for rendered components
imhotepStory(url, opts) Property-run entry for Storybook stories
imhotepFixture(path, opts) Property-run entry for fixture files
test, expect, imhotepFixtures Playwright test fixtures
ContextPool, PagePool, Semaphore Pooled runtime for multi-worker testing
touchTarget through modalContainment Reusable assertion presets