appium_failure_helper 1.9.0 → 1.10.0
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/appium_failure_helper/version.rb +1 -1
- data/lib/appium_failure_helper/xpath_factory.rb +20 -3
- 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: e08435a47e2a5b5382abe20a9e6a7d6eb51e72c12cd22f9fb3a7ad3bf3cbbaa1
|
4
|
+
data.tar.gz: '086f706107584495fd9dafdafc762223126c7e6e677fbe86e9f6cf10809b9fb7'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 486211c6d651c1ce903e8a3faa3b99ad368a8ee7dfb33bf9eb0f7c12a1504cd389a4ea2bbde636a3df76f967a8439e007afb01e576b4b0e7c1be7bd1232f6093
|
7
|
+
data.tar.gz: '09f7261766cb390321f040475cea639f431b0bf39ee8b387f5df742773097ef92853e5f1b891a7422eb0265e672f2d7c0d16c064ccfa26efca7a2706d08dac7d'
|
@@ -38,16 +38,33 @@ module AppiumFailureHelper
|
|
38
38
|
|
39
39
|
def self.add_direct_attribute_strategies(strategies, tag, attrs)
|
40
40
|
if (id = attrs['resource-id']) && !id.empty?
|
41
|
-
strategies << { name: "
|
41
|
+
strategies << { name: "Localizar por resource-id (Recomendado)", strategy: 'xpath', locator: "//*[@resource-id='#{id}']", reliability: :alta }
|
42
42
|
end
|
43
|
+
|
44
|
+
# iOS specific attributes
|
45
|
+
ios_attrs = %w[name label value]
|
46
|
+
ios_attrs.each do |attr|
|
47
|
+
next unless attrs[attr] && !attrs[attr].empty?
|
48
|
+
strategies << { name: "Atributo iOS: #{attr}", strategy: 'xpath', locator: "//#{tag}[@#{attr}=\"#{attrs[attr]}\"]", reliability: :alta }
|
49
|
+
strategies << { name: "Atributo iOS contém #{attr}", strategy: 'xpath', locator: "//#{tag}[contains(@#{attr}, \"#{attrs[attr].split.first}\")]", reliability: :media }
|
50
|
+
strategies << { name: "Texto com Inicial (iOS)", strategy: :xpath, locator: "//#{tag}[starts-with(@label, \"#{attrs[attr]}\" ) or starts-with(@name, \"#{attrs[attr]}\")]", reliability: :alta }
|
51
|
+
strategies << { name: "Texto com Final (iOS)", strategy: :xpath, locator: "//#{tag}[substring(@label, string-length(@label) - string-length(\"#{attrs[attr]}\") + 1) = \"#{attrs[attr]}\" or substring(@name, string-length(@name) - string-length(\"#{attrs[attr]}\") + 1) = \"#{attrs[attr]}\"]", reliability: :media }
|
52
|
+
end
|
53
|
+
|
54
|
+
# Android specific attributes
|
43
55
|
if (text = attrs['text']) && !text.empty?
|
44
|
-
strategies << { name: "Texto Exato", strategy: 'xpath', locator: "//#{tag}[@text
|
56
|
+
strategies << { name: "Texto Exato (Android)", strategy: 'xpath', locator: "//#{tag}[@text=\"#{text}\"]", reliability: :alta }
|
57
|
+
strategies << { name: "Texto com Inicial (Android)", strategy: 'xpath', locator: "//#{tag}[starts-with(@text, \"#{text}\")]", reliability: :alta }
|
58
|
+
strategies << { name: "Texto com Final (Android)", strategy: :xpath, locator: "//#{tag}[substring(@text, string-length(@text) - string-length(\"#{text}\") + 1) = \"#{text}\"]", reliability: :media }
|
59
|
+
strategies << { name: "Texto Parcial (Android)", strategy: 'xpath', locator: "//#{tag}[contains(@text, \"#{text.split.first}\")]", reliability: :media }
|
45
60
|
end
|
61
|
+
|
46
62
|
if (desc = attrs['content-desc']) && !desc.empty?
|
47
|
-
strategies << { name: "
|
63
|
+
strategies << { name: "content-desc (Acessibilidade Android)", strategy: 'xpath', locator: "//#{tag}[@content-desc=\"#{desc}\"]", reliability: :alta }
|
48
64
|
end
|
49
65
|
end
|
50
66
|
|
67
|
+
|
51
68
|
def self.add_combinatorial_strategies(strategies, tag, attrs)
|
52
69
|
valid_attrs = attrs.select { |k, v| %w[text content-desc class package].include?(k) && v && !v.empty? }
|
53
70
|
return if valid_attrs.keys.size < 2
|