Class: AngularWebdriver::ProtractorElement

Inherits:
Object
  • Object
show all
Defined in:
lib/angular_webdriver/protractor/protractor_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(watir) ⇒ ProtractorElement

Returns a new instance of ProtractorElement.



5
6
7
8
9
10
# File 'lib/angular_webdriver/protractor/protractor_element.rb', line 5

def initialize watir
  is_watir = watir.is_a?(Watir::Browser)
  raise 'Must init with a Watir::Browser' unless is_watir

  @watir = watir
end

Instance Attribute Details

#watirObject (readonly)

Returns the value of attribute watir.



3
4
5
# File 'lib/angular_webdriver/protractor/protractor_element.rb', line 3

def watir
  @watir
end

Instance Method Details

#all(*args) ⇒ Object

Protractor all method.

Example: element.all(by.css(‘bar’))

Returns:

  • Watir::HTMLElementCollection



29
30
31
# File 'lib/angular_webdriver/protractor/protractor_element.rb', line 29

def all *args
  watir.elements *args
end

#element(*args) ⇒ Object

Protractor element

Example: element(by.css(‘bar’))

Returns:

  • Watir::HTMLElement



18
19
20
21
# File 'lib/angular_webdriver/protractor/protractor_element.rb', line 18

def element *args
  return self unless args.length > 0
  watir.element *args
end