Class: Playwright::FileChooser

Inherits:
PlaywrightApi show all
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');

); “‘

Instance Method Summary collapse

Methods inherited from PlaywrightApi

from_channel_owner

Instance Method Details

#elementObject

Returns input element associated with this file chooser.

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/playwright_api/file_chooser.rb', line 13

def element
  raise NotImplementedError.new('element is not implemented yet.')
end

#multiple?Boolean

Returns whether this file chooser accepts multiple files.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/playwright_api/file_chooser.rb', line 18

def multiple?
  raise NotImplementedError.new('multiple? is not implemented yet.')
end

#pageObject

Returns page this file chooser belongs to.

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/playwright_api/file_chooser.rb', line 23

def page
  raise NotImplementedError.new('page is not implemented yet.')
end

#set_files(files, noWaitAfter: nil, timeout: nil) ⇒ Object

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.

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/playwright_api/file_chooser.rb', line 29

def set_files(files, noWaitAfter: nil, timeout: nil)
  raise NotImplementedError.new('set_files is not implemented yet.')
end