bugsnag-maze-runner 10.9.0 → 10.10.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: 14062f1974a264eecd536a2c9b46087f85a3029a5273b49684b371ad8c62dedc
4
- data.tar.gz: a4fd7c7b1c2ccf45a348d58a43008c83ed8fd692a3c0d44ca58748dcb17fdfd0
3
+ metadata.gz: 318d65a08a73cbea9799d54c8e6373f77d1ef80013a5a001bebcf869eb944b9d
4
+ data.tar.gz: 835dc213ef927c6e1762b62a8f89864e2fbbdb91e67ff3ebdcdb9bef6d10c967
5
5
  SHA512:
6
- metadata.gz: 72aacdb28c60a90545d733e285e0024828a4d974fa76ddc8479802f69c6b57764ffbe15429668f5876a23dc024336098b2ecd452f683de051bfab0741fca30fb
7
- data.tar.gz: 86f8ae8f260e44105e956f70090313a0f0430421438ba7a95b454e9f3f8d648063b4ec8eec23ea75ba65d14f6389b1dc9f2a2dec838f656d31bc67642b523333
6
+ metadata.gz: cb496b07c7dd58b139c5a2fe00b3b97581862d2d0f9636199d29c00ce022bc89095407e7496c948799c490b2b20d5dfcd3c631a29b6cc708c435497e3129e465
7
+ data.tar.gz: b2e418a4fe459d5be70ad01ca5110299a4600c6e332a4acf2ce0c2a86c45af97826c910553d48c7ea5c666295719c2756458e961a83d93bad77e57b2adfc9d3f
@@ -35,6 +35,25 @@ When('I click the element {string} if present') do |element_id|
35
35
  Maze::Api::Appium::UiManager.new.click_element_if_present(element_id)
36
36
  end
37
37
 
38
+ # Touches the screen at the given coordinates
39
+ # Requires a running Appium driver
40
+ #
41
+ # @step_input element_id [String] The locator id
42
+ When('I touch the screen at {int},{int}') do |x, y|
43
+ Maze::Api::Appium::UiManager.new.touch_at(x, y)
44
+ end
45
+
46
+ # Touches the screen at the given coordinates a number of times
47
+ # Requires a running Appium driver
48
+ #
49
+ # @step_input element_id [String] The locator id
50
+ When('I touch the screen at {int},{int} {int} time(s)') do |x, y, times|
51
+ times.times do
52
+ Maze::Api::Appium::UiManager.new.touch_at(x, y)
53
+ sleep 1
54
+ end
55
+ end
56
+
38
57
  # Sends the app to the background indefinitely
39
58
  # Requires a running Appium driver
40
59
  When('I send the app to the background') do
@@ -48,6 +48,32 @@ module Maze
48
48
  raise e
49
49
  end
50
50
 
51
+ # Performs a touch operation at the given coordinates, using W3C actions.
52
+ #
53
+ # @param x [Integer] X coordinate
54
+ # @param y [Integer] Y coordinate
55
+ #
56
+ # @returns [Boolean] Whether the operation was successfully performed
57
+ def touch_at(x, y)
58
+ if failed_driver?
59
+ $logger.error 'Cannot perform touch - Appium driver failed.'
60
+ return false
61
+ end
62
+
63
+ f1 = ::Selenium::WebDriver::Interactions.pointer(:touch, name: 'finger1')
64
+ f1.create_pointer_move(duration: 1, x: x, y: y,
65
+ origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
66
+ f1.create_pointer_down(:left)
67
+ f1.create_pointer_up(:left)
68
+ @driver.perform_actions([f1])
69
+ true
70
+ rescue Selenium::WebDriver::Error::ServerError => e
71
+ $logger.error "Error performing touch: #{e.message}"
72
+ # Assume the remote appium session has stopped, so crash out of the session
73
+ fail_driver(e)
74
+ raise e
75
+ end
76
+
51
77
  # Clicks a given element if present.
52
78
  #
53
79
  # @param element_id [String] the element to click
@@ -24,13 +24,6 @@ module Maze
24
24
  @start_attempts = 0
25
25
  end
26
26
 
27
- def sanitize_url(url)
28
- uri = URI.parse(url)
29
- uri.user = nil
30
- uri.password = nil
31
- uri.to_s
32
- end
33
-
34
27
  def start_session
35
28
  prepare_session
36
29
 
@@ -96,7 +89,8 @@ module Maze
96
89
  config.capabilities,
97
90
  config.locator
98
91
 
99
- $logger.info "Creating Appium session with #{sanitize_url(config.appium_server_url)}..."
92
+ sanitized_url = Maze::Helper.sanitize_url(config.appium_server_url)
93
+ $logger.info "Creating Appium session with #{sanitized_url}..."
100
94
  result = driver.start_driver
101
95
  if result
102
96
  # Log details of this session
@@ -16,6 +16,8 @@ module Maze
16
16
  $logger.trace "Attempting to start Selenium driver with capabilities: #{config.capabilities.to_json}"
17
17
  $logger.trace "Attempt #{attempts}"
18
18
  begin
19
+ sanitized_url = Maze::Helper.sanitize_url(selenium_url)
20
+ $logger.info "Creating Selenium session with #{sanitized_url}..."
19
21
  Maze.driver = Maze::Driver::Browser.new(:remote, selenium_url, config.capabilities)
20
22
  Maze.driver.start_driver
21
23
  Maze.driver.set_implicit_wait(20)
@@ -220,6 +220,10 @@ module Maze
220
220
  def session_capabilities
221
221
  driver.session_capabilities
222
222
  end
223
+
224
+ def perform_actions(actions)
225
+ @driver.perform_actions(actions)
226
+ end
223
227
  end
224
228
  end
225
229
  end
data/lib/maze/helper.rb CHANGED
@@ -118,6 +118,14 @@ module Maze
118
118
  def to_friendly_filename(string)
119
119
  string.gsub(/[:"& ]/, "_").gsub(/_+/, "_")
120
120
  end
121
+
122
+ # @return URL without any embedded username or password
123
+ def sanitize_url(url)
124
+ uri = URI.parse(url)
125
+ uri.user = nil
126
+ uri.password = nil
127
+ uri.to_s
128
+ end
121
129
  end
122
130
  end
123
131
  end
@@ -159,12 +159,12 @@ module Maze
159
159
  opt Option::APPIUM_SERVER,
160
160
  "Appium server URL. Defaults are: \n" +
161
161
  " --farm=local - MAZE_APPIUM_SERVER or http://localhost:4723/wd/hub\n" +
162
- " --farm=bb - MAZE_APPIUM_SERVER or https://us-west-mobile-hub.bitbar.com/wd/hub\n" +
162
+ " --farm=bb - MAZE_APPIUM_SERVER or https://eu-mobile-hub.bitbar.com/wd/hub\n" +
163
163
  'Not used for --farm=bs',
164
164
  short: :none,
165
165
  type: :string
166
166
  opt Option::SELENIUM_SERVER,
167
- "Selenium server URL. Only used for --farm=bb, defaulting to MAZE_SELENIUM_SERVER or https://us-west-desktop-hub.bitbar.com/wd/hub",
167
+ "Selenium server URL. Only used for --farm=bb, defaulting to MAZE_SELENIUM_SERVER or https://eu-desktop-hub.bitbar.com/wd/hub",
168
168
  short: :none,
169
169
  type: :string
170
170
 
@@ -269,8 +269,8 @@ module Maze
269
269
  when 'bb'
270
270
  options[Option::USERNAME] ||= ENV['BITBAR_USERNAME']
271
271
  options[Option::ACCESS_KEY] ||= ENV['BITBAR_ACCESS_KEY']
272
- options[Option::APPIUM_SERVER] ||= ENV['MAZE_APPIUM_SERVER'] || 'https://us-west-mobile-hub.bitbar.com/wd/hub'
273
- options[Option::SELENIUM_SERVER] ||= ENV['MAZE_SELENIUM_SERVER'] || 'https://us-west-desktop-hub.bitbar.com/wd/hub'
272
+ options[Option::APPIUM_SERVER] ||= ENV['MAZE_APPIUM_SERVER'] || 'https://eu-mobile-hub.bitbar.com/wd/hub'
273
+ options[Option::SELENIUM_SERVER] ||= ENV['MAZE_SELENIUM_SERVER'] || 'https://eu-desktop-hub.bitbar.com/wd/hub'
274
274
  end
275
275
 
276
276
  options[Option::BUGSNAG_REPEATER_API_KEY] ||= ENV['MAZE_REPEATER_API_KEY']
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 = '10.9.0'
11
+ VERSION = '10.10.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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-maze-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.9.0
4
+ version: 10.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Kirkland
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-12-05 00:00:00.000000000 Z
12
+ date: 2025-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cucumber