Class: Domkey::View::LabelMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/domkey/view/label_mapper.rb

Class Method Summary collapse

Class Method Details

.find(pageobject) ⇒ Object

provide PageObject wrapping label corresponding to id of element in pageobject.



18
19
20
# File 'lib/domkey/view/label_mapper.rb', line 18

def self.find pageobject
  PageObject.new -> { label(for: pageobject.element.id) }, pageobject.container
end

.for(collection) ⇒ Array<PageObject>

return collection of PageObjects for label locators corresponding to id of each element in a collection

Parameters:

Returns:

  • (Array<PageObject>)

    where each PageObject is a locator for label for an id of a PageObject passed in parameters



11
12
13
14
15
# File 'lib/domkey/view/label_mapper.rb', line 11

def self.for collection
  collection.map do |e|
    PageObject.new -> { label(for: e.element.id) }, e.container
  end
end