bugsnag-maze-runner 9.27.2 → 9.27.3

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: b280c22e5ebba0999aab175bdff85961db4eecda551b9ef7af9b86ce3e9a2dfb
4
- data.tar.gz: 8ed9875673535f2753586d57b1c70352700a522e728b6e1a25de54175028e82e
3
+ metadata.gz: 0311fd0e499a676775d0b02bc1d5a9a73fba218845a531b60e4c2848bfd2f138
4
+ data.tar.gz: b38995cabfda41bc015b509ca10185198be47ad65210c7bcb24748c58278679d
5
5
  SHA512:
6
- metadata.gz: 184bbd13f45aedd6eaa04fe00afa119b8f8d23978e78674acced363a8af30858f94b3dc32414ec45973127bfff9880bd3577829fce0ae53e3cff621c78ef267a
7
- data.tar.gz: c06d158038c59513ca71e63d1d0ea0a2a5462500e5236eccf54c4371631e943ccb8e641becf01f7b5aca37d6d7b67468b7285f0f42695ee50f5e0ab738f5d3f2
6
+ metadata.gz: 48a00d3048487f3382bd4b7daeda0a3b27e3cce03037f1bd595d7e1217bdcf21428bd45af8c6d7097f858f655f434d8d8c1d740fb8ca66b78af7dbf88a4e9f9f
7
+ data.tar.gz: 40b2f8ba974a603f680a99baa2dced5b3645641e7d6f6eae69188bc5fd3052543c9dffca252bd44fab76bcac7832b6e35144eb116fc43e0d5fe93289584804a3
@@ -232,11 +232,17 @@ After do |scenario|
232
232
  # Call any pre_complete hooks registered by the client
233
233
  Maze.hooks.call_pre_complete scenario
234
234
 
235
+ # Fail the scenario if there are any invalid requests
235
236
  unless Maze::Server.invalid_requests.size_all == 0
236
237
  msg = "#{Maze::Server.invalid_requests.size_all} invalid request(s) received during scenario"
237
238
  Maze.scenario.mark_as_failed msg
238
239
  end
239
240
 
241
+ # Fail the scenario if the Appium driver failed
242
+ if Maze.mode == :appium && Maze.driver.failed?
243
+ Maze.scenario.mark_as_failed Maze.driver.failure_reason
244
+ end
245
+
240
246
  Maze.scenario.complete
241
247
  end
242
248
 
@@ -18,14 +18,17 @@ module Maze
18
18
  @driver.activate_app(@driver.app_id)
19
19
  true
20
20
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
21
+ $logger.error "Failed to activate app: #{e.message}"
21
22
  # Assume the remote appium session has stopped, so crash out of the session
22
23
  fail_driver(e.message)
23
24
  raise e
24
25
  end
25
26
 
26
- # Terminates the app
27
+ # Terminates the app. If terminate fails then clients may wish to ty the legacy close method, so an option
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
27
30
  # @returns [Boolean] Whether the app was successfully closed
28
- def terminate
31
+ def terminate(fail_driver = true)
29
32
  if failed_driver?
30
33
  $logger.error 'Cannot terminate the app - Appium driver failed.'
31
34
  return false
@@ -34,8 +37,9 @@ module Maze
34
37
  @driver.terminate_app(@driver.app_id)
35
38
  true
36
39
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
40
+ $logger.error "Failed to terminate app: #{e.message}"
37
41
  # Assume the remote appium session has stopped, so crash out of the session
38
- fail_driver(e.message)
42
+ fail_driver(e.message) if fail_driver
39
43
  raise e
40
44
  end
41
45
 
@@ -50,6 +54,7 @@ module Maze
50
54
  @driver.launch_app
51
55
  true
52
56
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
57
+ $logger.error "Failed to launch app: #{e.message}"
53
58
  # Assume the remote appium session has stopped, so crash out of the session
54
59
  fail_driver(e.message)
55
60
  raise e
@@ -66,6 +71,7 @@ module Maze
66
71
  @driver.close_app
67
72
  true
68
73
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
74
+ $logger.error "Failed to close app: #{e.message}"
69
75
  # Assume the remote appium session has stopped, so crash out of the session
70
76
  fail_driver(e.message)
71
77
  raise e
@@ -81,6 +87,7 @@ module Maze
81
87
 
82
88
  @driver.app_state(@driver.app_id)
83
89
  rescue Selenium::WebDriver::Error::ServerError, Selenium::WebDriver::Error::UnknownError => e
90
+ $logger.error "Failed to get app state: #{e.message}"
84
91
  # Assume the remote appium session has stopped, so crash out of the session
85
92
  fail_driver(e.message)
86
93
  raise e
@@ -19,6 +19,7 @@ module Maze
19
19
  @driver.unlock
20
20
  true
21
21
  rescue Selenium::WebDriver::Error::ServerError => e
22
+ $logger.error "Failed to unlock the device: #{e.message}"
22
23
  # Assume the remote appium session has stopped, so crash out of the session
23
24
  fail_driver(e.message)
24
25
  raise e
@@ -35,6 +36,7 @@ module Maze
35
36
  @driver.back
36
37
  true
37
38
  rescue Selenium::WebDriver::Error::ServerError => e
39
+ $logger.error "Failed to press back: #{e.message}"
38
40
  # Assume the remote appium session has stopped, so crash out of the session
39
41
  fail_driver(e.message)
40
42
  raise e
@@ -52,6 +54,7 @@ module Maze
52
54
 
53
55
  @driver.get_log(log_type)
54
56
  rescue Selenium::WebDriver::Error::ServerError => e
57
+ $logger.error "Failed to get logs: #{e.message}"
55
58
  # Assume the remote appium session has stopped, so crash out of the session
56
59
  fail_driver(e.message)
57
60
  raise e
@@ -69,6 +72,7 @@ module Maze
69
72
  @driver.set_rotation(orientation)
70
73
  true
71
74
  rescue Selenium::WebDriver::Error::ServerError => e
75
+ $logger.error "Failed to set the device rotation: #{e.message}"
72
76
  # Assume the remote appium session has stopped, so crash out of the session
73
77
  fail_driver(e.message)
74
78
  raise e
@@ -84,6 +88,7 @@ module Maze
84
88
 
85
89
  JSON.generate(@driver.device_info)
86
90
  rescue Selenium::WebDriver::Error::ServerError => e
91
+ $logger.error "Failed to get the device info: #{e.message}"
87
92
  # Assume the remote appium session has stopped, so crash out of the session
88
93
  fail_driver(e.message)
89
94
  raise e
@@ -35,6 +35,7 @@ module Maze
35
35
  $logger.error "Error writing file to device: #{e.message}"
36
36
  false
37
37
  rescue Selenium::WebDriver::Error::ServerError => e
38
+ $logger.error "Error writing file to device: #{e.message}"
38
39
  # Assume the remote appium session has stopped, so crash out of the session
39
40
  fail_driver(e.message)
40
41
  raise e
@@ -72,6 +73,7 @@ module Maze
72
73
  $logger.error "Error reading file from device: #{e.message}"
73
74
  nil
74
75
  rescue Selenium::WebDriver::Error::ServerError => e
76
+ $logger.error "Error reading file from device: #{e.message}"
75
77
  # Assume the remote appium session has stopped, so crash out of the session
76
78
  fail_driver(e.message)
77
79
  raise e
@@ -22,6 +22,7 @@ module Maze
22
22
 
23
23
  @driver.wait_for_element(element_id, timeout, retry_if_stale)
24
24
  rescue Selenium::WebDriver::Error::ServerError => e
25
+ $logger.error "Error waiting for element #{element_id}: #{e.message}"
25
26
  # Assume the remote appium session has stopped, so crash out of the session
26
27
  fail_driver(e.message)
27
28
  raise e
@@ -41,6 +42,7 @@ module Maze
41
42
  @driver.click_element(element_id)
42
43
  true
43
44
  rescue Selenium::WebDriver::Error::ServerError => e
45
+ $logger.error "Error clicking element #{element_id}: #{e.message}"
44
46
  # Assume the remote appium session has stopped, so crash out of the session
45
47
  fail_driver(e.message)
46
48
  raise e
@@ -59,6 +61,7 @@ module Maze
59
61
 
60
62
  @driver.click_element_if_present(element_id)
61
63
  rescue Selenium::WebDriver::Error::ServerError => e
64
+ $logger.error "Error clicking element #{element_id}: #{e.message}"
62
65
  # Assume the remote appium session has stopped, so crash out of the session
63
66
  fail_driver(e.message)
64
67
  raise e
@@ -26,21 +26,23 @@ module Maze
26
26
  def after(scenario)
27
27
  manager = Maze::Api::Appium::AppManager.new
28
28
  if Maze.config.os == 'macos'
29
- # Close the app - without the sleep, launching the app for the next scenario intermittently fails
29
+ # Close the app - without the sleep launching the app for the next scenario intermittently fails
30
30
  system("killall -KILL #{Maze.config.app} && sleep 1")
31
31
  elsif [:bb, :bs, :local].include? Maze.config.farm
32
- # Reset the server to ensure that test fixtures cannot fetch
33
- # commands from the previous scenario (in idempotent mode).
32
+ close_fallback = Maze.config.appium_version && Maze.config.appium_version.to_f < 2.0
34
33
  begin
35
- manager.terminate
34
+ manager.terminate(!close_fallback)
36
35
  rescue Selenium::WebDriver::Error::UnknownError, Selenium::WebDriver::Error::InvalidSessionIdError
37
- if Maze.config.appium_version && Maze.config.appium_version.to_f < 2.0
36
+ if close_fallback
38
37
  $logger.warn 'terminate_app failed, using the slower but more forceful close_app instead'
39
38
  manager.close
40
39
  else
41
40
  $logger.warn 'terminate_app failed, future errors may occur if the application did not close remotely'
42
41
  end
43
42
  end
43
+
44
+ # Reset the server before relaunching the app to ensure that test fixtures cannot fetch
45
+ # commands from the previous scenario (in idempotent mode).
44
46
  Maze::Server.reset!
45
47
  manager.activate
46
48
  end
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.2'
11
+ VERSION = '9.27.3'
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.2
4
+ version: 9.27.3
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-08 00:00:00.000000000 Z
11
+ date: 2025-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber