Module: Appium::Flutter::Finder

Defined in:
lib/appium_flutter_finder.rb,
lib/appium_flutter_finder/version.rb

Overview

Get find element context for flutter driver

Constant Summary collapse

VERSION =
'0.4.0'.freeze

Instance Method Summary collapse

Instance Method Details

#by_ancestor(serialized_finder:, matching:, match_root: false, first_match_only: false) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/appium_flutter_finder.rb', line 20

def by_ancestor(serialized_finder:, matching:, match_root: false, first_match_only: false)
  by_ancestor_or_descendant(
    type: 'Ancestor',
    serialized_finder: serialized_finder,
    matching: matching,
    match_root: match_root,
    first_match_only: first_match_only
  )
end

#by_descendant(serialized_finder:, matching:, match_root: false, first_match_only: false) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/appium_flutter_finder.rb', line 30

def by_descendant(serialized_finder:, matching:, match_root: false, first_match_only: false)
  by_ancestor_or_descendant(
    type: 'Descendant',
    serialized_finder: serialized_finder,
    matching: matching,
    match_root: match_root,
    first_match_only: first_match_only
  )
end

#by_semantics_label(label) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/appium_flutter_finder.rb', line 40

def by_semantics_label(label)
  serialize(
    finderType: 'BySemanticsLabel',
    isRegExp: label.is_a?(Regexp),
    # Should be '/a/' as String in regex case
    label: label.is_a?(Regexp) ? label.source : label
  )
end

#by_text(text) ⇒ Object



77
78
79
80
81
82
# File 'lib/appium_flutter_finder.rb', line 77

def by_text(text)
  serialize(
    finderType: 'ByText',
    text: text
  )
end

#by_tooltip(text) ⇒ Object



49
50
51
52
53
54
# File 'lib/appium_flutter_finder.rb', line 49

def by_tooltip(text)
  serialize(
    finderType: 'ByTooltipMessage',
    text: text
  )
end

#by_type(type) ⇒ Object



56
57
58
59
60
61
# File 'lib/appium_flutter_finder.rb', line 56

def by_type(type)
  serialize(
    finderType: 'ByType',
    type: type
  )
end

#by_value_key(key) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/appium_flutter_finder.rb', line 63

def by_value_key(key)
  serialize(
    finderType: 'ByValueKey',
    keyValueString: key,
    keyValueType: key.is_a?(String) ? 'String' : 'int'
  )
end

#page_backObject



71
72
73
74
75
# File 'lib/appium_flutter_finder.rb', line 71

def page_back
  serialize(
    finderType: 'PageBack'
  )
end