Class: Puppeteer::FunctionLocator
- Defined in:
- lib/puppeteer/locators.rb,
sig/puppeteer/locators.rbs
Constant Summary
Constants inherited from Locator
Class Method Summary collapse
Instance Method Summary collapse
- #_clone ⇒ Object
- #_wait(options) ⇒ Object
-
#initialize(page_or_frame, func) ⇒ FunctionLocator
constructor
A new instance of FunctionLocator.
Methods inherited from Locator
#click, #clone, #copy_options, #fill, #filter, #filter_handle, function_string?, #hover, #map, #map_handle, #on, #once, race, #scroll, #set_ensure_element_is_in_the_viewport, #set_timeout, #set_visibility, #set_wait_for_enabled, #set_wait_for_stable_bounding_box, #timeout, #wait, #wait_handle
Methods included from EventCallbackable
#add_event_listener, #emit_event, #observe_first, #off, #on_event, #remove_event_listener
Constructor Details
#initialize(page_or_frame, func) ⇒ FunctionLocator
Returns a new instance of FunctionLocator.
567 568 569 570 571 |
# File 'lib/puppeteer/locators.rb', line 567 def initialize(page_or_frame, func) super() @page_or_frame = page_or_frame @func = func end |
Class Method Details
.create(page_or_frame, func) ⇒ Puppeteer::Locator
563 564 565 |
# File 'lib/puppeteer/locators.rb', line 563 def self.create(page_or_frame, func) new(page_or_frame, func).set_timeout(default_timeout_for(page_or_frame)) end |
Instance Method Details
#_clone ⇒ Object
573 574 575 |
# File 'lib/puppeteer/locators.rb', line 573 protected def _clone self.class.new(@page_or_frame, @func).(self) end |
#_wait(options) ⇒ Object
577 578 579 |
# File 'lib/puppeteer/locators.rb', line 577 protected def _wait() @page_or_frame.wait_for_function(@func, timeout: [:timeout]) end |