appium_failure_helper 1.14.0 → 1.15.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: 04ea0c4e15827de9ded026389d94197ba0855c1cf47d59d3c884b8b4137b18a8
4
- data.tar.gz: 05aa2f0a47b71c3e3199ca7c1cd728ac5e063cc233355e352c9a0537e0a035b2
3
+ metadata.gz: 6693ea274ba569af7ec3440dcd29348769a3860920dc6b88f35b0d543c145183
4
+ data.tar.gz: 416b624ae5218f624d817c488498068237237fd52dca0b51aa603f488cc59c46
5
5
  SHA512:
6
- metadata.gz: 3de3145ca6f8ba1e9038a99a0e11f592021c87e9466e9441f310d9adc2adacb124102628e7d3566e5c54637985fede7d93d6c678dae373356c17d54771b76e2c
7
- data.tar.gz: fdb2e49ab24be05d518b54aab6bbfbe085069a93679cf6b84d9116c23b9ac274b850e22a0ff0421703a5de912a45723e55a58ede40f67c09f2f62acb95153a2b
6
+ metadata.gz: b2140d8b30afd01b22e5f23960efab1f7654c01727efce1e8f3687e4a4a10a76c589c083a7ee71dd79b95b0b4ee925b51bc9694d835789288a112052fec54a10
7
+ data.tar.gz: cee9beef7f24c1b839ab054861fcb37e2c681ba2140a36631f7d62158d7eb9c7526fe7c6db68a30406c05f86d16372950779b06d1037c884313cff1ac88ae1da
@@ -2,10 +2,11 @@ module AppiumFailureHelper
2
2
  module Analyzer
3
3
  def self.triage_error(exception)
4
4
  case exception
5
- when Selenium::WebDriver::Error::NoSuchElementError,
6
- Selenium::WebDriver::Error::TimeoutError,
7
- Selenium::WebDriver::Error::UnknownCommandError,
8
- defined?(Appium::Core::Wait::TimeoutError) ? Appium::Core::Wait::TimeoutError : nil
5
+ when *[
6
+ Selenium::WebDriver::Error::NoSuchElementError,
7
+ Selenium::WebDriver::Error::TimeoutError,
8
+ (Appium::Core::Wait::TimeoutError if defined?(Appium::Core::Wait::TimeoutError))
9
+ ].compact
9
10
  :locator_issue
10
11
  when Selenium::WebDriver::Error::ElementNotInteractableError
11
12
  :visibility_issue
@@ -81,7 +82,7 @@ module AppiumFailureHelper
81
82
  end
82
83
  end
83
84
 
84
- candidates.sort_by { |c| -c[:score] }.first
85
+ candidates.sort_by { |c| -c[:score] }.first(3)
85
86
  end
86
87
 
87
88
  private
@@ -59,6 +59,7 @@ module AppiumFailureHelper
59
59
  def self.extract_from_exception(exception)
60
60
  # Busca a primeira linha do backtrace que seja um arquivo .rb do projeto
61
61
  location = exception.backtrace.find { |line| line.include?('.rb') && !line.include?('gems') }
62
+ location ||= exception.backtrace&.first
62
63
  return {} unless location
63
64
 
64
65
  # Usa o Regex que funciona em Windows e Unix para extrair caminho e linha
@@ -1,3 +1,3 @@
1
1
  module AppiumFailureHelper
2
- VERSION = "1.14.0"
2
+ VERSION = "1.15.0"
3
3
  end
@@ -98,7 +98,7 @@ module AppiumFailureHelper
98
98
  strategies << {
99
99
  name: "Classe + Índice",
100
100
  strategy: 'xpath',
101
- locator: "(//#{cls})[#{index.to_i + 1}]",
101
+ locator: "(//#{tag}[@class=#{cls.inspect}])[#{index.to_i + 1}]",
102
102
  reliability: :baixa
103
103
  }
104
104
  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: 1.14.0
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Nascimento