appium_failure_helper 1.5.2 → 1.6.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/.idea/Appium_failure_helper.iml +3 -2
- data/lib/appium_failure_helper/analyzer.rb +42 -14
- data/lib/appium_failure_helper/version.rb +1 -1
- metadata +2 -5
- data/appium_failure_helper-1.5.1.gem +0 -0
- data/elements/cadastro.yaml +0 -7
- data/elements/login.yaml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0917102997fb6cabc11815b5cf139122a5463270aacd81f297c9962ae8d87b9
|
4
|
+
data.tar.gz: de8b9e66f04ca40ae2a997ada9d1b0e9c6fb02a1126eaed3041b238e30c02389
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4eb98152f746822fef5d6f4dfa81ede39baf86fe3c7f51610b1499df537c036fbb277a823ac14a3e3b011219c4250b46b8ba2e4df4cc0ff5021c4d07a6a7e50
|
7
|
+
data.tar.gz: b4699b9b3a7071498b4b0622dc7b3dc37e354913fb4bc76b525f639af1c0681b508109d9963f0540cb54cfaeea3ef6c8073444b663241ccc68766fdce8dea011
|
@@ -31,17 +31,18 @@
|
|
31
31
|
<orderEntry type="library" scope="PROVIDED" name="psych (v5.2.6, ruby-3.1.7-p261) [gem]" level="application" />
|
32
32
|
<orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, ruby-3.1.7-p261) [gem]" level="application" />
|
33
33
|
<orderEntry type="library" scope="PROVIDED" name="rake (v13.3.0, ruby-3.1.7-p261) [gem]" level="application" />
|
34
|
-
<orderEntry type="library" scope="PROVIDED" name="rdoc (v6.
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="rdoc (v6.15.0, ruby-3.1.7-p261) [gem]" level="application" />
|
35
35
|
<orderEntry type="library" scope="PROVIDED" name="reline (v0.6.2, ruby-3.1.7-p261) [gem]" level="application" />
|
36
36
|
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.13.1, ruby-3.1.7-p261) [gem]" level="application" />
|
37
37
|
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.13.5, ruby-3.1.7-p261) [gem]" level="application" />
|
38
38
|
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.13.5, ruby-3.1.7-p261) [gem]" level="application" />
|
39
39
|
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.13.5, ruby-3.1.7-p261) [gem]" level="application" />
|
40
40
|
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.13.6, ruby-3.1.7-p261) [gem]" level="application" />
|
41
|
-
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v3.1.
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="rubyzip (v3.1.1, ruby-3.1.7-p261) [gem]" level="application" />
|
42
42
|
<orderEntry type="library" scope="PROVIDED" name="selenium-webdriver (v3.142.7, ruby-3.1.7-p261) [gem]" level="application" />
|
43
43
|
<orderEntry type="library" scope="PROVIDED" name="stringio (v3.1.7, ruby-3.1.7-p261) [gem]" level="application" />
|
44
44
|
<orderEntry type="library" scope="PROVIDED" name="tomlrb (v1.3.0, ruby-3.1.7-p261) [gem]" level="application" />
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="tsort (v0.2.0, ruby-3.1.7-p261) [gem]" level="application" />
|
45
46
|
<orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.7.7, ruby-3.1.7-p261) [gem]" level="application" />
|
46
47
|
<orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.5, ruby-3.1.7-p261) [gem]" level="application" />
|
47
48
|
</component>
|
@@ -38,25 +38,48 @@ module AppiumFailureHelper
|
|
38
38
|
|
39
39
|
def self.perform_advanced_analysis(failed_info, all_page_elements, platform)
|
40
40
|
return nil if failed_info.empty? || all_page_elements.empty?
|
41
|
+
|
41
42
|
expected_attrs = parse_locator(failed_info[:selector_type], failed_info[:selector_value], platform)
|
42
43
|
return nil if expected_attrs.empty?
|
43
44
|
|
44
|
-
|
45
|
-
candidates =
|
45
|
+
id_key = (platform.to_s == 'ios') ? 'name' : 'resource-id'
|
46
|
+
candidates = []
|
47
|
+
|
48
|
+
all_page_elements.each do |element_on_screen|
|
46
49
|
score = 0
|
47
50
|
analysis = {}
|
51
|
+
screen_attrs = element_on_screen[:attributes]
|
48
52
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
max_len = [expected_attrs[id_key_to_check].to_s.length, actual_id.to_s.length].max
|
53
|
-
similarity = max_len.zero? ? 0 : 1.0 - (distance.to_f / max_len)
|
53
|
+
# Compara ID (pontuação máxima)
|
54
|
+
if expected_attrs[id_key] && screen_attrs[id_key]
|
55
|
+
similarity = calculate_similarity(expected_attrs[id_key], screen_attrs[id_key])
|
54
56
|
score += 100 * similarity
|
55
|
-
analysis[
|
57
|
+
analysis[id_key.to_sym] = { similarity: similarity, expected: expected_attrs[id_key], actual: screen_attrs[id_key] }
|
58
|
+
end
|
59
|
+
|
60
|
+
# Compara Texto (pontuação média)
|
61
|
+
if expected_attrs['text'] && screen_attrs['text']
|
62
|
+
similarity = calculate_similarity(expected_attrs['text'], screen_attrs['text'])
|
63
|
+
score += 50 * similarity
|
64
|
+
analysis[:text] = { similarity: similarity, expected: expected_attrs['text'], actual: screen_attrs['text'] }
|
56
65
|
end
|
57
66
|
|
58
|
-
|
59
|
-
|
67
|
+
# Compara Content Description (pontuação alta para Android)
|
68
|
+
if expected_attrs['content-desc'] && screen_attrs['content-desc']
|
69
|
+
similarity = calculate_similarity(expected_attrs['content-desc'], screen_attrs['content-desc'])
|
70
|
+
score += 80 * similarity
|
71
|
+
analysis[:'content-desc'] = { similarity: similarity, expected: expected_attrs['content-desc'], actual: screen_attrs['content-desc'] }
|
72
|
+
end
|
73
|
+
|
74
|
+
if score > 50 # Limiar mínimo para ser considerado um candidato
|
75
|
+
candidates << {
|
76
|
+
score: score,
|
77
|
+
name: element_on_screen[:name],
|
78
|
+
attributes: element_on_screen[:attributes],
|
79
|
+
analysis: analysis
|
80
|
+
}
|
81
|
+
end
|
82
|
+
end
|
60
83
|
|
61
84
|
candidates.sort_by { |c| -c[:score] }.first
|
62
85
|
end
|
@@ -65,13 +88,18 @@ module AppiumFailureHelper
|
|
65
88
|
|
66
89
|
def self.parse_locator(type, value, platform)
|
67
90
|
attrs = {}
|
91
|
+
type = type.to_s.downcase
|
92
|
+
|
68
93
|
if platform.to_s == 'ios'
|
69
|
-
attrs['name'] = value if type.
|
94
|
+
attrs['name'] = value if type.include?('id')
|
70
95
|
else # Android
|
71
|
-
attrs['resource-id'] = value if type.
|
96
|
+
attrs['resource-id'] = value if type.include?('id')
|
72
97
|
end
|
73
|
-
|
74
|
-
|
98
|
+
|
99
|
+
if type == 'xpath'
|
100
|
+
value.scan(/@([\w\-]+)='([^']+)'/).each do |match|
|
101
|
+
attrs[match[0]] = match[1]
|
102
|
+
end
|
75
103
|
end
|
76
104
|
attrs
|
77
105
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_failure_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Nascimento
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-10-
|
11
|
+
date: 2025-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -99,9 +99,6 @@ files:
|
|
99
99
|
- LICENSE.txt
|
100
100
|
- README.md
|
101
101
|
- Rakefile
|
102
|
-
- appium_failure_helper-1.5.1.gem
|
103
|
-
- elements/cadastro.yaml
|
104
|
-
- elements/login.yaml
|
105
102
|
- img/fluxo_appium_failure_helper.png
|
106
103
|
- lib/appium_failure_helper.rb
|
107
104
|
- lib/appium_failure_helper/analyzer.rb
|
Binary file
|
data/elements/cadastro.yaml
DELETED
data/elements/login.yaml
DELETED