bugsnag-maze-runner 10.9.1 → 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: 1c449054320543727d2947b81c59237b08553bb460ed7d384855212a727a21a0
4
- data.tar.gz: a7325b7824ccb04955755b9b2e53ead208006b8d9f68e5d77d7d58951628d5b7
3
+ metadata.gz: 318d65a08a73cbea9799d54c8e6373f77d1ef80013a5a001bebcf869eb944b9d
4
+ data.tar.gz: 835dc213ef927c6e1762b62a8f89864e2fbbdb91e67ff3ebdcdb9bef6d10c967
5
5
  SHA512:
6
- metadata.gz: f7ba9aab7de5a564f2e54ef9e03087c1e31c94084955c60c0f57267f96c68e5a3e8b9a86ada85fdfccddbeadf4f243a6c5e6456efb5c9a9c6742943943d98717
7
- data.tar.gz: 45e277bf469a8281b194f113063316d2fcbdf3b978364845cff9a4a39cb43a1363973d0fccbe162bd2d14c04a0cb9342102a973dd8ea3c9e4715f9feb4cc500c
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
@@ -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.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.1'
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.1
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-10 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