-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add setInputFiles docs for browser module #1528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor style nits, and a question about the example. 🙏
docs/sources/next/javascript-api/k6-experimental/browser/elementhandle/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/elementhandle/setinputfiles.md
Outdated
Show resolved
Hide resolved
const eh = page.$('input[id="upload"]'); | ||
|
||
// The file is set to the input element with the id "upload". | ||
eh.setInputFiles({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would this file have to be for this example to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is inline in the code i.e. it's all there in the object (name
, mimetype
and buffer
). This new API doesn't work with the local filesystem at all. A user will need to work with the experimental FS module to do that.
docs/sources/next/javascript-api/k6-experimental/browser/frame/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/frame/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/frame/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/page/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/page/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/page/setinputfiles.md
Outdated
Show resolved
Hide resolved
docs/sources/next/javascript-api/k6-experimental/browser/page/setinputfiles.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Heitor Tashiro Sergent <heitortsergent@gmail.com>
@heitortsergent i'm merging this into make the next release, but please add any more suggestions and I will add them to a new PR. |
@ankur22 I think it would be great if we had an example with a real use case, whether that's using the experimental What do you think? I could open a separate issue for it. |
That's a good idea, and I already have one ready to be added into the docs. I'll create a PR soon. |
@ankur22 thank you!! 🙇 |
What?
Add
setInputFiles
docs for browser module. The API is available inframe
,page
andelementHandle
.Checklist
npm start
command locally and verified that the changes look good.docs/sources/next
folder of the documentation.Related PR(s)/Issue(s)
grafana/xk6-browser#1097 & grafana/xk6-browser#1244