feat(expect): support AbortSignal on web-first assertions#41157
Draft
Skn0tt wants to merge 3 commits into
Draft
Conversation
Adds a client-only `signal` option that aborts an in-flight server operation via a new fire-and-forget `__cancel__` message, which aborts the call's ProgressController in the dispatcher. Wires it up on Locator.click and Locator.waitFor as a starting point. Fixes: microsoft#40578
Adds the signal option next to every existing timeout option on action, getter and navigation methods, threading it through the client so in-flight calls can be cancelled via the __cancel__ wire message. Refs: microsoft#40578
Adds a client-only `signal` option to web-first assertions (toBeVisible, toHaveText, toHaveCount, toMatchAriaSnapshot, toHaveURL, etc.). Aborting cancels the in-flight server call via the existing __cancel__ mechanism and rejects with the signal's reason, matching AbortSignal semantics on actions and waiters. Refs: microsoft#40578
Contributor
Test results for "MCP"7263 passed, 1109 skipped Merge workflow run. |
Contributor
Test results for "tests 1"1 flaky39598 passed, 771 skipped Merge workflow run. |
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.
Summary
signal?: AbortSignaloption to web-first assertions (toBeVisible,toHaveText,toHaveCount,toMatchAriaSnapshot,toHaveURL, etc.).__cancel__mechanism and rejects withsignal.reason— a cancellation, not an assertion outcome — matchingAbortSignalsemantics on actions (feat: support AbortSignal on server-side methods #41141) and waiters (feat: addAbortSignalsupport to client-side Waiter methods #41136).Notes
feat/abort-signal-server-side); the first two commits belong to that PR and drop out once it merges.expect.softintentionally gets no special handling — this is an automation feature, not a testing one.Refs #40578