Class: Puppeteer::RaceLocator
- 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(locators) ⇒ RaceLocator
constructor
A new instance of RaceLocator.
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(locators) ⇒ RaceLocator
Returns a new instance of RaceLocator.
749 750 751 752 |
# File 'lib/puppeteer/locators.rb', line 749 def initialize(locators) super() @locators = locators end |
Class Method Details
.create(locators) ⇒ Object
744 745 746 747 |
# File 'lib/puppeteer/locators.rb', line 744 def self.create(locators) array = check_locator_array(locators) new(array) end |
Instance Method Details
#_clone ⇒ Object
754 755 756 |
# File 'lib/puppeteer/locators.rb', line 754 protected def _clone self.class.new(@locators.map(&:clone)).(self) end |
#_wait(options) ⇒ Object
758 759 760 761 762 763 |
# File 'lib/puppeteer/locators.rb', line 758 protected def _wait() tasks = @locators.map do |locator| proc { locator.send(:_wait, ) } end Puppeteer::AsyncUtils.await_promise_race(*tasks) end |