appium_failure_helper 0.4.1 → 0.4.2

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: 0c223153b4956f8098f653d255a4487bb3814bbd0ed8306cd4c01ccba478b4d9
4
- data.tar.gz: 23ca5a6e67e1630473b37bd3ecaa1cab0b878ea35790e686bcd2eff6842462c2
3
+ metadata.gz: c15543514bd288d39e5dd2d8d5d07b23aa9c21b78704b99c8e5eeca7400b08ed
4
+ data.tar.gz: c41bfaac49d288ca60d99eb6708b6e4eb71074494f0ee615251ccf429920dca7
5
5
  SHA512:
6
- metadata.gz: 19483fead216b475eadac1f809e8bdd0ef2feafc46adfa41a396d18bb3572feb3a03b7768beacea1199046a4d7ffb982c2f9d8f9e4af13b1eee5fa035ff3a947
7
- data.tar.gz: 2834dc179101c611fdce1262a20144f8684b86b3dea3515e3d2e4dccf983bbfa9e3e73b57fa1266d36c4a1b7deb4e93b35d7456ec75a7d9dbff5ec70cab542ab
6
+ metadata.gz: 16773e8d4f28fdf2e453e80e739641756821a0efd9bb2c9df7917e67791b469b56e066a132992d38d361e68c9a66e7030fbae74fa7b9ae37253e620890ec8ac3
7
+ data.tar.gz: 73dff6f6a7045ba2749e6aa3157cf141b9c5f8bb315de50ff9820cee1dde3e8b83c485fcfd8e19bd6260c4f77bae629aea62903dea2120240cb0e95b050075c6
@@ -114,28 +114,28 @@ module AppiumFailureHelper
114
114
 
115
115
  # Estratégia 1: Combinação de atributos
116
116
  if attrs['resource-id'] && !attrs['resource-id'].empty? && attrs['text'] && !attrs['text'].empty?
117
- locators << { strategy: 'resource_id_and_text', locator: "//#{tag}[@resource-id='#{attrs['resource-id']}' and @text='#{self.truncate(attrs['text'])}']" }
117
+ locators << { strategy: 'resource_id_and_text', locator: "//#{tag}[@resource-id\"#{attrs['resource-id']}\" and @text=\"#{self.truncate(attrs['text'])}\"]" }
118
118
  elsif attrs['resource-id'] && !attrs['resource-id'].empty? && attrs['content-desc'] && !attrs['content-desc'].empty?
119
- locators << { strategy: 'resource_id_and_content_desc', locator: "//#{tag}[@resource-id='#{attrs['resource-id']}' and @content-desc='#{self.truncate(attrs['content-desc'])}']" }
119
+ locators << { strategy: 'resource_id_and_content_desc', locator: "//#{tag}[@resource-id=\"#{attrs['resource-id']}\" and @content-desc=\"#{self.truncate(attrs['content-desc'])}\"]" }
120
120
  end
121
121
 
122
122
  # Estratégia 2: ID único
123
123
  if attrs['resource-id'] && !attrs['resource-id'].empty?
124
- locators << { strategy: 'resource_id', locator: "//#{tag}[@resource-id='#{attrs['resource-id']}']" }
124
+ locators << { strategy: 'resource_id', locator: "//#{tag}[@resource-id=\"#{attrs['resource-id']}\"]" }
125
125
  end
126
126
 
127
127
  # Estratégia 3: starts-with para IDs dinâmicos
128
128
  if attrs['resource-id'] && attrs['resource-id'].include?(':id/')
129
129
  id_part = attrs['resource-id'].split(':id/').last
130
- locators << { strategy: 'starts_with_resource_id', locator: "//#{tag}[starts-with(@resource-id, '#{id_part}')]" }
130
+ locators << { strategy: 'starts_with_resource_id', locator: "//#{tag}[starts-with(@resource-id, \"#{id_part}\")]" }
131
131
  end
132
132
 
133
133
  # Estratégia 4: Texto e content-desc como identificadores
134
134
  if attrs['text'] && !attrs['text'].empty?
135
- locators << { strategy: 'text', locator: "//#{tag}[@text='#{self.truncate(attrs['text'])}']" }
135
+ locators << { strategy: 'text', locator: "//#{tag}[@text=\"#{self.truncate(attrs['text'])}\"]" }
136
136
  end
137
137
  if attrs['content-desc'] && !attrs['content-desc'].empty?
138
- locators << { strategy: 'content_desc', locator: "//#{tag}[@content-desc='#{self.truncate(attrs['content-desc'])}']" }
138
+ locators << { strategy: 'content_desc', locator: "//#{tag}[@content-desc=\"#{self.truncate(attrs['content-desc'])}\"]" }
139
139
  end
140
140
 
141
141
  # Fallback genérico (sempre adicionado)
@@ -149,20 +149,20 @@ module AppiumFailureHelper
149
149
 
150
150
  # Estratégia 1: Combinação de atributos
151
151
  if attrs['accessibility-id'] && !attrs['accessibility-id'].empty? && attrs['label'] && !attrs['label'].empty?
152
- locators << { strategy: 'accessibility_id_and_label', locator: "//#{tag}[@accessibility-id='#{attrs['accessibility-id']}' and @label='#{self.truncate(attrs['label'])}']" }
152
+ locators << { strategy: 'accessibility_id_and_label', locator: "//#{tag}[@accessibility-id=\"#{attrs['accessibility-id']}\" and @label=\"#{self.truncate(attrs['label'])}\"]" }
153
153
  end
154
154
 
155
155
  # Estratégia 2: ID único
156
156
  if attrs['accessibility-id'] && !attrs['accessibility-id'].empty?
157
- locators << { strategy: 'accessibility_id', locator: "//#{tag}[@accessibility-id='#{attrs['accessibility-id']}']" }
157
+ locators << { strategy: 'accessibility_id', locator: "//#{tag}[@accessibility-id=\"#{attrs['accessibility-id']}\"]" }
158
158
  end
159
159
 
160
160
  # Estratégia 3: label, name ou value
161
161
  if attrs['label'] && !attrs['label'].empty?
162
- locators << { strategy: 'label', locator: "//#{tag}[@label='#{self.truncate(attrs['label'])}']" }
162
+ locators << { strategy: 'label', locator: "//#{tag}[@label=\"#{self.truncate(attrs['label'])}\"]" }
163
163
  end
164
164
  if attrs['name'] && !attrs['name'].empty?
165
- locators << { strategy: 'name', locator: "//#{tag}[@name='#{self.truncate(attrs['name'])}']" }
165
+ locators << { strategy: 'name', locator: "//#{tag}[@name=\"#{self.truncate(attrs['name'])}\"]" }
166
166
  end
167
167
 
168
168
  # Fallback genérico (sempre adicionado)
@@ -174,13 +174,13 @@ module AppiumFailureHelper
174
174
  def self.generate_unknown_xpaths(tag, attrs)
175
175
  locators = []
176
176
  if attrs['resource-id'] && !attrs['resource-id'].empty?
177
- locators << { strategy: 'resource_id', locator: "//#{tag}[@resource-id='#{attrs['resource-id']}']" }
177
+ locators << { strategy: 'resource_id', locator: "//#{tag}[@resource-id=\"#{attrs['resource-id']}\"]" }
178
178
  end
179
179
  if attrs['content-desc'] && !attrs['content-desc'].empty?
180
- locators << { strategy: 'content_desc', locator: "//#{tag}[@content-desc='#{self.truncate(attrs['content-desc'])}']" }
180
+ locators << { strategy: 'content_desc', locator: "//#{tag}[@content-desc=\"#{self.truncate(attrs['content-desc'])}\"]" }
181
181
  end
182
182
  if attrs['text'] && !attrs['text'].empty?
183
- locators << { strategy: 'text', locator: "//#{tag}[@text='#{self.truncate(attrs['text'])}']" }
183
+ locators << { strategy: 'text', locator: "//#{tag}[@text=\"#{self.truncate(attrs['text'])}\"]" }
184
184
  end
185
185
 
186
186
  # Fallback genérico (sempre adicionado)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppiumFailureHelper
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
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: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento