mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Resolve paths against CWD in page.uploadFile() method
This patch: - teaches page.uploadFile() to resolve given file paths against current working directory. This aligns paths handling with all the other methods - moves page.uploadFile() under Frame - changes test to use relative path for file upload
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
+ [frame.name()](#framename)
|
||||
+ [frame.parentFrame()](#frameparentframe)
|
||||
+ [frame.title()](#frametitle)
|
||||
+ [frame.uploadFile(selector, ...filePaths)](#frameuploadfileselector-filepaths)
|
||||
+ [frame.url()](#frameurl)
|
||||
+ [frame.waitFor(selectorOrFunctionOrTimeout[, options])](#framewaitforselectororfunctionortimeout-options)
|
||||
+ [frame.waitForFunction(pageFunction[, options, ...args])](#framewaitforfunctionpagefunction-options-args)
|
||||
@@ -630,7 +631,7 @@ To press a special key, use [`page.press`](#pagepresskey-options).
|
||||
|
||||
#### page.uploadFile(selector, ...filePaths)
|
||||
- `selector` <[string]> A query [selector] to a file input
|
||||
- `...filePaths` <[string]> Sets the value of the file input these paths
|
||||
- `...filePaths` <[string]> Sets the value of the file input these paths. If some of the `filePaths` are relative paths, then they are resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd).
|
||||
- returns: <[Promise]> Promise which resolves when the value is set.
|
||||
|
||||
#### page.url()
|
||||
@@ -900,6 +901,11 @@ Note: This value is calculated once when the frame is created, and will not upda
|
||||
#### frame.title()
|
||||
- returns: <[Promise]<[string]>> Returns page's title.
|
||||
|
||||
#### frame.uploadFile(selector, ...filePaths)
|
||||
- `selector` <[string]> A query [selector] to a file input
|
||||
- `...filePaths` <[string]> Sets the value of the file input these paths. If some of the `filePaths` are relative paths, then they are resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd).
|
||||
- returns: <[Promise]> Promise which resolves when the value is set.
|
||||
|
||||
#### frame.url()
|
||||
- returns: <[string]>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user