-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable download behavior #4197
Open
1 of 8 tasks
Labels
Comments
page.on('download').cancel()
Open
I like this new proposal where we're working with an existing field on const context = await browser.newContext({
acceptDownloads: false,
}); |
3 tasks
inancgumus
referenced
this issue
Oct 29, 2024
I'm not yet sure if we should add this PR as it's a part of a bigger functionality that we expect to have in k6 v0.56. See the issue for more details: https://github.com/grafana/xk6-browser/issues/1289
oleiade
referenced
this issue
Nov 11, 2024
* Initialize v0.55.0 release notes * Update release notes for browser 1448 * Update release notes for browser page.on generalization * Update release notes for browser 1439 * Update release notes for browser 1461 * Update release notes for browser 1496 I'm not yet sure if we should add this PR as it's a part of a bigger functionality that we expect to have in k6 v0.56. See the issue for more details: https://github.com/grafana/xk6-browser/issues/1289 * Replace issue 1461 with PR 1462 * release notes: webcrypto RSA support * release notes: statsd output removal * release notes: outputs changes * Add browser related changes to release notes * Remove template examples from release notes * Add browser#1457 to release notes * release notes: updates check recommendation * Add initial page.on('metric') release note change * Add issues to the page.on('metric') release note * release notes: add TLA support section * release notes: add tracing breaking change and future open ones * auto-assigner changelog * check recommendation apply feedback * fixup! release notes: add tracing breaking change and future open ones * Apply release notes clean-ups and fillers * Address wrong formulation of tracing removal * Update release notes/v0.55.0.md Co-authored-by: Oleg Bespalov <[email protected]> * Apply suggestions from code review Co-authored-by: Ankur <[email protected]> * Apply suggestions from code review Co-authored-by: Ankur <[email protected]> * Apply pull request review suggestions * Update the page.on('metric') description * Update release notes/v0.55.0.md Co-authored-by: Ankur <[email protected]> * Update page.on example as an expandable detail * Align last sections format with template * Update ControlOrMeta description * Update wording of page.on example * Apply pull request review suggestions * Document #4017 bug fix * Update release notes/v0.55.0.md Co-authored-by: Mihail Stoykov <[email protected]> * Bring minor improvement to #4009 --------- Co-authored-by: İnanç Gümüş <[email protected]> Co-authored-by: Oleg Bespalov <[email protected]> Co-authored-by: ankur22 <[email protected]> Co-authored-by: Mihail Stoykov <[email protected]> Co-authored-by: Mihail Stoykov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What?
Add support to make download behavior configurable:
Why?
Turning off is required because some scripts hang when the file choosers open.
Turning on is required when users want to download files and see where the files are.
How?
Turning On and Off Downloads
We can control the download behavior using the existing
BrowserContext.acceptDownloads
option:However, although we have the option implemented (set to
false
by default), we don't use it in the module code. So, the module's current behavior is always to accept downloads and open file choosers.The goal of this issue is to use this option to control download behavior.
Other tools set this option to
true
by default. One advantage of keeping itfalse
is that it lets us learn about user behavior. The disadvantage is that users would need to explicitly set it totrue
to make downloading in their scripts work. We'll set the option totrue
by default to match the general industry.Setting the download path
We can let users where to save files using the
downloadsPath
option:When set, files are downloaded into the directory. Otherwise, they're saved in a temporary directory.
CDP API
Explanation:
SetDownloadBehaviorBehaviorDefault
: Opens a file chooser by default. This is the browser module's current behavior even without callingSetDownloadBehavior
.SetDownloadBehaviorBehaviorAllow
: Automatically downloads files to a user-specified folder. Other tools randomly pick a directory name if not specified. We'll follow suit.SetDownloadBehaviorBehaviorDeny
: Denies downloads. We'll set this based on the user's request or if the test run is on the cloud.Tasks
Tasks
browserContext.downloadsPath
xk6-browser#1496Related PR(s)/Issue(s)
#4233
The text was updated successfully, but these errors were encountered: