Repository navigation
Fix existing WebView automation, errors, and screenshots - #660
Open
mattleibow wants to merge 1 commit into
Open
mattleibow wants to merge 1 commit into
mattleibow wants to merge 1 commit into
Conversation
Contributor
|
✅ Expert Code Review: 2 independent reviewers found no issues. Methodology: 2-model adversarial consensus. (1 reviewer failed to complete — reduced coverage, no tiebreaker)
|
Execute typed WebView evaluations once, propagate browser errors, forward selected contexts, and use native-first PNG screenshots. Report browser-network capture as unsupported without changing native HTTP capture. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dbcaf214-7d31-463c-a36a-e8e6aaada82b
mattleibow
force-pushed
the
mattleibow-webview-automation-fixes
branch
from
October 9, 2026 19:00
3fed69e to
b2a420e
Compare
This branch has not been deployed
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.
Scope
First of five approved replacement implementation layers above #652. Parent:
b404eb2247ea2ad10272e7a8088bdca9b5338ab5; implementation source inspected at the pinned #655 head889c5039ba09e50a167dcf052402655a4d424fd3. This PR owns only existing WebView automation correctness, its focused regressions, and related documentation. The existing native stack and #655 remain untouched; final restacking/supersession is coordinator-owned.Runtime.getProperties, without replaying the expression.AgentClient, CLI, and MCP. CLI query/query-all/snapshot forward the selected C# WebView argument to the request, never an undefined JavaScript variable. Click/fill/text use the existing action endpoints. Batch fails the process when any command fails, including--continue-on-error, and stops immediately by default.AgentClient.GetWebViewScreenshotAsyncover the existing native-first screenshot endpoint; use it in CLI/MCP and verify the PNG signature.webview.networkfor unsupported browser fetch/XHR capture and remove the advertised WebView network feature. Native .NET HTTP capture endpoints are unchanged.Breaking behavior
AgentClient.SendCdpCommandAsyncand typed WebView action methods now throw with HTTP/CDP/JavaScript details instead of returning error payloads orfalse./api/v1/webview/networkchanges from a misleading HTTP 200 native-store alias to 501 unsupported. Existing signatures, namespaces/type forwards, selectors,--webview/-w,webview/contextId, readiness aliases, and Blazor registration APIs are preserved.Issues and reproduction evidence
Fixes #621: focused process regressions cover the undefined-variable generation, selected-context forwarding, action errors, useful JavaScript exceptions, nonzero exits, failure-fast stopping, and aggregate batch failure. On the existing Mac Catalyst Blazor sample, a single nonverbose CLI process completed 30 commands: 10 evaluations, query/query-all, HTML source, snapshot, fill/readback (
unit1-value), insert/readback (unit1-value-typed), actual Add-button mutation (3 → 4items with the expected title), deletion restoring three items, checkbox toggle (0 → 1 → 0completed), and a valid PNG. A subsequent ReferenceError exited 1 and did not execute its sentinel. A separate single-process missing-selector click returned useful HTTP 404 details, exited 1, and did not execute its sentinel. The existing multi-Blazor test verifies left/right fill isolation. The Windows cause is source-proven and covered by platform-independent regressions; Windows runtime was not exercised.maui_query_cssremains a native-tree query, not a browser DOM tool.Related #232, not Fixes: repeated nonverbose evaluation and snapshot work on the tested run, but bridge readiness, wire-ID correlation, and broader timing reproduction belong to later layers.
Related #407, not Fixes: screenshot passed in the full 20-test WebView class, and CLI PNG verification checked signature, chunk CRCs, IEND, and IDAT decompression (374,398 bytes; 1250×1366). This is not proof that the existing in-suite flake is resolved. One later repeat on the long-lived app failed two readiness checks after a native WebKit SIGTRAP in
WebKit::ProcessThrottler::sendPrepareToSuspendIPC; a fresh owned app rerun passed 20/20. No native crash/bridge lifetime fix is claimed here.Related #654: only this layer's browser-network capability/spec correction and automation/error documentation. The broad tracker remains open. No claim of #257 onboarding fixes or #113's four new interaction tools.
Validation
netstandard2.0build succeeded with zero warnings/errors.WebViewTestsclass: 20 passed.ReferenceError: Can't find variable: __unit1McpMissingin anisErrorresult.SDK 10.0.401; per-process Xcode 26.6 selection, no global Xcode or sample-project edits. A cross-process handoff initially encountered the already-known mutation lease (#620); validation waited for expiry instead of changing lease behavior. Owned app/helpers stopped; shared broker/unrelated apps untouched. No dependencies changed. No full-suite-green, Windows, GTK/WPF, physical mobile-device, relative browser-navigation, or flake-resolution claim.
Intentionally deferred
Generic WebView package/assets/platform adapters and atomic owner/registry/Blazor/GTK/shipping migration; canonical context-only CLI/MCP/Inspector contracts and ready-only fields; generic DOM layout diagnostics; maintained standard/Hybrid/mixed sample and new cross-host matrix. Parent schema corrections outside the WebView network block remain intact.