Class: Playwright::FileChooser
- Inherits:
-
PlaywrightApi
- Object
- PlaywrightApi
- Playwright::FileChooser
- Defined in:
- lib/playwright_api/file_chooser.rb
Overview
FileChooser objects are dispatched by the page in the [‘event: Page.filechooser`] event.
“‘js page.on(’filechooser’, async (fileChooser) =>
await fileChooser.setFiles('/tmp/myfile.pdf');
); “‘
“‘python async page.on(“filechooser”, lambda file_chooser: file_chooser.set_files(“/tmp/myfile.pdf”)) “`
“‘python sync page.on(“filechooser”, lambda file_chooser: file_chooser.set_files(“/tmp/myfile.pdf”)) “`
Instance Method Summary collapse
-
#element ⇒ Object
Returns input element associated with this file chooser.
-
#multiple? ⇒ Boolean
Returns whether this file chooser accepts multiple files.
-
#page ⇒ Object
Returns page this file chooser belongs to.
-
#set_files(files, noWaitAfter: nil, timeout: nil) ⇒ Object
(also: #files=)
Sets the value of the file input this chooser is associated with.
Methods inherited from PlaywrightApi
#==, from_channel_owner, #initialize
Constructor Details
This class inherits a constructor from Playwright::PlaywrightApi
Instance Method Details
#element ⇒ Object
Returns input element associated with this file chooser.
21 22 23 |
# File 'lib/playwright_api/file_chooser.rb', line 21 def element raise NotImplementedError.new('element is not implemented yet.') end |
#multiple? ⇒ Boolean
Returns whether this file chooser accepts multiple files.
26 27 28 |
# File 'lib/playwright_api/file_chooser.rb', line 26 def multiple? raise NotImplementedError.new('multiple? is not implemented yet.') end |
#page ⇒ Object
Returns page this file chooser belongs to.
31 32 33 |
# File 'lib/playwright_api/file_chooser.rb', line 31 def page raise NotImplementedError.new('page is not implemented yet.') end |
#set_files(files, noWaitAfter: nil, timeout: nil) ⇒ Object Also known as: files=
Sets the value of the file input this chooser is associated with. If some of the filePaths are relative paths, then they are resolved relative to the the current working directory. For empty array, clears the selected files.
37 38 39 |
# File 'lib/playwright_api/file_chooser.rb', line 37 def set_files(files, noWaitAfter: nil, timeout: nil) raise NotImplementedError.new('set_files is not implemented yet.') end |