Add the Playwright Interactor adapter - #324
Draft
cowboyd wants to merge 1 commit into
Draft
Conversation
Contributor
Package Changes Through 80cf510There are 1 changes which include @interactors/core with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Contributor
|
🚀 Deploy Preview Ready!
|
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 5, 2026 20:43
5916a9c to
ad602fb
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 8, 2026 21:19
ad602fb to
68c3b9f
Compare
cowboyd
changed the base branch from
codex/interactors-compile
to
codex/cli-dual-runtime
September 8, 2026 21:48
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 8, 2026 22:00
68c3b9f to
bd126ec
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 8, 2026 22:05
bd126ec to
2e8565c
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 9, 2026 02:02
2e8565c to
a00e413
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 9, 2026 03:04
a00e413 to
0b8f5ed
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 9, 2026 03:32
0b8f5ed to
9f43095
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 9, 2026 03:50
9f43095 to
b40d07d
Compare
cowboyd
force-pushed
the
codex/interactors-playwright
branch
from
September 9, 2026 16:38
b40d07d to
80cf510
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The compiled artifact set needs a Playwright-side consumer that is type-safe in the test process while executing the real Interactor implementation against the browser DOM.
Approach
Add
@interactors/playwright, which validates the compiled registry, installs the browser agent for the current document and later navigations, and exposes typed remote proxies derived from the generated declarations. Commands crosspage.evaluate()with protocol and registry identity, supporting actions, assertions, nested Interactors, regular expressions, and built-in or custom matchers. Remote failures retain their browser error details.Remote proxies intentionally omit raw filter getter methods. Tests assert filter values through
has()oris(), preserving Interactors' convergence and diagnostics instead of extracting a value for a runner-side equality assertion.Register the package with the release configuration and derive prerelease npm tags from Git tags so alpha releases remain off
latest.Alternate Designs
Reimplementing Interactors with Playwright locators would duplicate behavior and allow the two implementations to drift. Importing browser-oriented constructors directly into the Playwright process would execute them in the wrong DOM context. The proxy and agent boundary keeps one implementation in the browser.
Possible Drawbacks or Risks
Command inputs must be JSON-shaped values, regular expressions, or remote matchers, and returned values must be serializable by Playwright. The current transport targets the page's main frame and expects one loader call per
Page; popup pages must be loaded separately.TODOs and Open Questions
Supporting child-frame-specific adapters can be considered separately.
Learning
Playwright's init-script lifecycle applies to both navigations and child frames. The adapter guards installation to the main frame and disposes the registered script when its initial agent handshake fails.
Code passed to
page.evaluate()cannot safely close over DNT-generated module shims. Browser callbacks instead discover their window through the document passed across the Playwright boundary.Screenshots
Not applicable; this is a test-runner integration API.