Class: UIBase

Inherits:
Object
  • Object
show all
Defined in:
lib/calios-uikit-extension/ui_base.rb

Class Method Summary collapse

Class Method Details

.accessibility_identifierObject Also known as: identifier



53
54
55
# File 'lib/calios-uikit-extension/ui_base.rb', line 53

def accessibility_identifier
  self.property(:accessibilityIdentifier)
end

.accessibility_labelObject Also known as: label



47
48
49
# File 'lib/calios-uikit-extension/ui_base.rb', line 47

def accessibility_label
  self.property(:accessibilityLabel)
end

.class_nameObject



5
6
7
# File 'lib/calios-uikit-extension/ui_base.rb', line 5

def class_name
  name
end

.double_tap(aIdOrIndex = nil) ⇒ Object



28
29
30
31
# File 'lib/calios-uikit-extension/ui_base.rb', line 28

def double_tap(aIdOrIndex=nil)
  q = self.parse_query(aIdOrIndex)
  Calabash::Cucumber::Core.double_tap(q)
end

.enabled?(aIdOrIndex = nil) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/calios-uikit-extension/ui_base.rb', line 16

def enabled?(aIdOrIndex=nil)
  q = self.parse_query(aIdOrIndex)
  Calabash::Cucumber::Core.query(q, :isEnabled).first.to_boolean
end

.flash(aIdOrIndex = nil) ⇒ Object Also known as: f



40
41
42
43
# File 'lib/calios-uikit-extension/ui_base.rb', line 40

def flash(aIdOrIndex=nil)
  q = parse_query(aIdOrIndex)
  Calabash::Cucumber::Core.flash(q)
end

.helpObject Also known as: h



59
60
61
# File 'lib/calios-uikit-extension/ui_base.rb', line 59

def help
  public_methods(false)
end

.parse_query(aIdOrIndex) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/calios-uikit-extension/ui_base.rb', line 65

def parse_query(aIdOrIndex)
  raise_if_invalid(aIdOrIndex)

  if aIdOrIndex.nil?
    qStr = "#{self.class_name}"
  else
    qStr = aIdOrIndex.is_a?(String) ? "#{self.class_name} marked:'#{aIdOrIndex}'" : "#{self.class_name} index:#{aIdOrIndex}"
  end

  qStr
end

.property(*aParams) ⇒ Object Also known as: prop, p



9
10
11
# File 'lib/calios-uikit-extension/ui_base.rb', line 9

def property(*aParams)
  Calabash::Cucumber::Core.query(self.class_name, *aParams)
end

.query(aIdOrIndex = nil) ⇒ Object Also known as: q



33
34
35
36
# File 'lib/calios-uikit-extension/ui_base.rb', line 33

def query(aIdOrIndex=nil)
  q = parse_query(aIdOrIndex)
  Calabash::Cucumber::Core.query(q)
end

.touch(aIdOrIndex = nil) ⇒ Object Also known as: tap



21
22
23
24
# File 'lib/calios-uikit-extension/ui_base.rb', line 21

def touch(aIdOrIndex=nil)
  q = self.parse_query(aIdOrIndex)
  Calabash::Cucumber::Core.touch(q)
end