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 +4 -4
- data/lib/appium_failure_helper/capture.rb +13 -13
- data/lib/appium_failure_helper/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: c15543514bd288d39e5dd2d8d5d07b23aa9c21b78704b99c8e5eeca7400b08ed
|
4
|
+
data.tar.gz: c41bfaac49d288ca60d99eb6708b6e4eb71074494f0ee615251ccf429920dca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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,
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
183
|
+
locators << { strategy: 'text', locator: "//#{tag}[@text=\"#{self.truncate(attrs['text'])}\"]" }
|
184
184
|
end
|
185
185
|
|
186
186
|
# Fallback genérico (sempre adicionado)
|