appom 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appom/element_finder.rb +24 -5
- data/lib/appom/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f34beb277b19dd56062d095dfc710b587ba210334fbaddca1ca278f1944a34a
|
4
|
+
data.tar.gz: 6d72a01178c225dec28c1320ac1aeb937b78f6b577d39c439f9645a364d8d3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2313c1979765e4af47c8b453183cd30507e0f2309879234c233f2f3671df2fbd82bb66d47c3c21721dfe903a4f96af7af9e4619598de7cfca505c9ece75077af
|
7
|
+
data.tar.gz: fd4da56697db614455a4c1334d3ec097bc229a97be03e006853aa2239300ab631f7d6ffaaed8f1a4249f17f391db2421d17005a974c876599744c0b3e6357bf2
|
data/lib/appom/element_finder.rb
CHANGED
@@ -31,7 +31,28 @@ module Appom
|
|
31
31
|
|
32
32
|
# Find elements
|
33
33
|
def _all(*find_args)
|
34
|
-
|
34
|
+
args, text, visible = deduce_element_args(find_args)
|
35
|
+
elements = page.find_elements(*args)
|
36
|
+
els = []
|
37
|
+
|
38
|
+
elements.each do |element|
|
39
|
+
if !visible.nil? && !text.nil?
|
40
|
+
if element.displayed? && element.text == text
|
41
|
+
els.push(element)
|
42
|
+
end
|
43
|
+
elsif !visible.nil?
|
44
|
+
if element.displayed?
|
45
|
+
els.push(element)
|
46
|
+
end
|
47
|
+
elsif !text.nil?
|
48
|
+
if element.text == text
|
49
|
+
els.push(element)
|
50
|
+
end
|
51
|
+
else
|
52
|
+
els.push(element)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
return els
|
35
56
|
end
|
36
57
|
|
37
58
|
# Check page has or has not element with find_args
|
@@ -93,12 +114,10 @@ module Appom
|
|
93
114
|
!_find(*find_args).enabled?
|
94
115
|
# Function only return true if we can find at leat one element (array is not empty) or raise error
|
95
116
|
when 'at least one element exists'
|
96
|
-
|
97
|
-
!page.find_elements(*args).empty?
|
117
|
+
!_all(*find_args).empty?
|
98
118
|
# Function only return true if we can't find at leat one element (array is empty) or raise error
|
99
119
|
when 'no element exists'
|
100
|
-
|
101
|
-
page.find_elements(*args).empty?
|
120
|
+
_all(*find_args).empty?
|
102
121
|
end
|
103
122
|
end
|
104
123
|
end
|
data/lib/appom/version.rb
CHANGED