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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a56eb0f75acb977e0d8e066b31593613b5ef167675cddb797fd474c152965cc3
4
- data.tar.gz: 2c3bf1de88d8976d9fd49622c4c1ae3523dd16f4afe6c0fef764a443edb255a7
3
+ metadata.gz: e08435a47e2a5b5382abe20a9e6a7d6eb51e72c12cd22f9fb3a7ad3bf3cbbaa1
4
+ data.tar.gz: '086f706107584495fd9dafdafc762223126c7e6e677fbe86e9f6cf10809b9fb7'
5
5
  SHA512:
6
- metadata.gz: 645ec5e70207e9345350ea66f64524db344c65cee481ec3aa189c8133557433bd504eca618eeba8aa56c7bb7517cc36170493c56631d5efc3dadc6c6725e99b6
7
- data.tar.gz: 3ee2904b1aae5428e5eec0edccdf9565284f147da00206ef6c74a7a2d1b79c0764fc51385ca29c5e63b31f205566c0c9ffb8452bf76afbe24559bf09981b3032
6
+ metadata.gz: 486211c6d651c1ce903e8a3faa3b99ad368a8ee7dfb33bf9eb0f7c12a1504cd389a4ea2bbde636a3df76f967a8439e007afb01e576b4b0e7c1be7bd1232f6093
7
+ data.tar.gz: '09f7261766cb390321f040475cea639f431b0bf39ee8b387f5df742773097ef92853e5f1b891a7422eb0265e672f2d7c0d16c064ccfa26efca7a2706d08dac7d'
@@ -1,3 +1,3 @@
1
1
  module AppiumFailureHelper
2
- VERSION = "1.9.0"
2
+ VERSION = "1.10.0"
3
3
  end
@@ -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: "ID Único (Recomendado)", strategy: 'id', locator: id, reliability: :alta }
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='#{text}']", reliability: :alta }
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: "Content Description", strategy: 'xpath', locator: "//#{tag}[@content-desc='#{desc}']", reliability: :alta }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_failure_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento