Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
I haven't followed up on this yet, because I'm still thinking about how best to represent 'pending' actions, such as an expected action, in PlaywrightEx. In a way that maps well to Sorry for taking so long on this. |
ftes
added a commit
that referenced
this pull request
Sep 15, 2026
Adds download listeners that can be armed before an action and awaited afterward, with download metadata and file saving over local and WebSocket connections. Supersedes #39. ## Changes - Add `Page.expect_download/2` and `Page.await_download/1`, with optional predicates on download metadata. - Use linked Tasks for one-shot event capture, with synchronous registration, one deadline, and owner/connection lifecycle handling. - Add `Download.from_event/2`, `save_as/3`, and `delete/2`. Saving preserves the source artifact so other readers can use it. - Stage artifact saves before replacing the destination, share one timeout across stream reads, and clean up files and streams on failure. - Handle expected connection failures at the process boundary and allow unexpected errors to propagate. ## Compatibility - **Breaking:** `:infinity` disables timeouts; `0` means no waiting. Zero-timeout protocol commands fail without being sent, while frame URL/load-state waits check recorded state once. Migration guidance is in `CHANGELOG.md`. - Fix `:infinity` handling in frame waits and keyboard actions. Keyboard delays cannot extend a zero timeout. - URL predicate exceptions now propagate instead of becoming ordinary error results. ## Validation - `mix check`: 209 tests passed, including formatting, Credo, compilation, and Dialyzer checks. The full suite also passed with the original failing CI seed (`87788`) and concurrency (`8`). - `mix docs --warnings-as-errors` passed. - GitHub Actions: build/lint and all 209 tests passed over both port and WebSocket transports. - Consumer compatibility: 6 phoenix_test_playwright download tests and 32 Fluffy download, URL, and assertion tests passed against the local implementation.
Owner
|
Superseeded by #87 |
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.
Add
PlaywrightEx.DownloadandPlaywrightEx.DownloadWaiterto handle file downloads.Example: