bugsnag-maze-runner 9.27.4 → 9.29.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: 87adf6fe40bf417708320af55a4cc71c2e8656e7f79bdd60902b473c2d7aa2b7
4
- data.tar.gz: 47b1d556a9bf643ada71d5476cffe5f82ca5db36c08238911f964c3ac4d9c4fe
3
+ metadata.gz: a9e19df4c516fad48f4e34008fe0d4f95c3478c3c6632f9f7972fe07f984cc13
4
+ data.tar.gz: 2d65eb337ee63c25eb22041b680152fd111d6fb5d9e0e9246c2e37eec1a87bfe
5
5
  SHA512:
6
- metadata.gz: ad05007ba4678a5a45811cae40ddbe6be9fce37d9a719520d7ee6494c436b9328f6ff649467286c4a241412c646ce5c9e83858fc565f5f69fdc3264f0a8bb478
7
- data.tar.gz: 310739ae63a5583838503902c78e51030eb2ed1ccf175715f0270d5a5946cd4c94f48f62de3f8fbef758a6d9da4298b23fee4f8e553359f7e2aba91be4f0f7ad
6
+ metadata.gz: 8ee7a5766f46be51714cb04d1813e1fe2065795ee07eb6f777a373eafc3d17b25700e1f64710a5298386c28d05e60646926258a1f4a32548ce7c05d70728c153
7
+ data.tar.gz: 36b984085c0f2eb7585b40e418fe3c44ce3b867a46f62bd35dfd11bcf2d31e90c968cf4255a4eaefd7573b67dea92884268710052be4bdd2157544d5e65feadd
@@ -38,7 +38,7 @@ end
38
38
  # Sends the app to the background indefinitely
39
39
  # Requires a running Appium driver
40
40
  When('I send the app to the background') do
41
- Maze.driver.background_app(-1)
41
+ Maze::Api::Appium::AppManager.new.background(-1)
42
42
  end
43
43
 
44
44
  # Sends the app to the background for a number of seconds
@@ -46,7 +46,7 @@ end
46
46
  #
47
47
  # @step_input timeout [Integer] The amount of time the app is in the background in seconds
48
48
  When('I send the app to the background for {int} second(s)') do |timeout|
49
- Maze.driver.background_app(timeout)
49
+ Maze::Api::Appium::AppManager.new.background(timeout)
50
50
  end
51
51
 
52
52
  # Clears a given element
@@ -26,7 +26,7 @@ module Maze
26
26
 
27
27
  # Terminates the app. If terminate fails then clients may wish to ty the legacy close method, so an option
28
28
  # is provided to not fail the Appium driver.
29
- # @fail_driver [Boolean] Whether to fail the Appium driver if the app cannot be terminated
29
+ # @param fail_driver [Boolean] Whether to fail the Appium driver if the app cannot be terminated
30
30
  # @returns [Boolean] Whether the app was successfully closed
31
31
  def terminate(fail_driver = true)
32
32
  if failed_driver?
@@ -43,6 +43,24 @@ module Maze
43
43
  raise e
44
44
  end
45
45
 
46
+ # Instructs Appium to background the app
47
+ # @param seconds [Integers] The number of seconds to background the app for, or -1 for indefinitely
48
+ # @returns [Boolean] Whether the instruction to Appium was successfully made
49
+ def background(seconds = -1)
50
+ if failed_driver?
51
+ $logger.error 'Cannot background the app - Appium driver failed.'
52
+ return false
53
+ end
54
+
55
+ @driver.background_app(seconds)
56
+ true
57
+ rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
58
+ $logger.error "Failed to background app: #{e.message}"
59
+ # Assume the remote appium session has stopped, so crash out of the session
60
+ fail_driver(e.message)
61
+ raise e
62
+ end
63
+
46
64
  # Launches the app (legacy method).
47
65
  # @returns [Boolean] Whether the app was successfully launched
48
66
  def launch
@@ -38,6 +38,8 @@ module Maze
38
38
  interval = 10
39
39
  elsif error.message.include? '\'platformVersion\' must be a valid version number.'
40
40
  interval = 10
41
+ elsif error.message.include?('Device model with name') && error.message.include?('is currently unavailable')
42
+ interval = 10
41
43
  else
42
44
  # Do not retry in any other case
43
45
  end
@@ -65,9 +65,9 @@ module Maze
65
65
  short: :none,
66
66
  type: :string
67
67
  opt Option::PORT,
68
- 'Mock server port',
68
+ 'Mock server port, defaulting to MAZE_PORT or 9339',
69
69
  short: :none,
70
- default: 9339
70
+ type: :integer
71
71
  opt Option::NULL_PORT,
72
72
  'Terminating connection port',
73
73
  short: :none,
@@ -279,6 +279,7 @@ module Maze
279
279
  options[Option::BUGSNAG_REPEATER_API_KEY] ||= ENV['MAZE_REPEATER_API_KEY']
280
280
  options[Option::SB_LOCAL] ||= ENV['MAZE_SB_LOCAL'] || '/SBSecureTunnel'
281
281
  options[Option::BS_LOCAL] ||= ENV['MAZE_BS_LOCAL'] || '/BrowserStackLocal'
282
+ options[Option::PORT] ||= ENV['MAZE_PORT'] || 9339
282
283
  options[Option::APPIUM_SERVER] ||= ENV['MAZE_APPIUM_SERVER'] || 'http://localhost:4723/wd/hub'
283
284
  options[Option::APPLE_TEAM_ID] ||= ENV['MAZE_APPLE_TEAM_ID']
284
285
  options[Option::UDID] ||= ENV['MAZE_UDID']
data/lib/maze.rb CHANGED
@@ -8,7 +8,7 @@ require_relative 'maze/timers'
8
8
  # providing an alternative to the proliferation of global variables or singletons.
9
9
  module Maze
10
10
 
11
- VERSION = '9.27.4'
11
+ VERSION = '9.29.0'
12
12
 
13
13
  class << self
14
14
  attr_accessor :check, :driver, :internal_hooks, :mode, :start_time, :dynamic_retry, :public_address,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-maze-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.27.4
4
+ version: 9.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Kirkland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber