bugsnag-maze-runner 9.9.1 → 9.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2566c04b9d1881f81990f985eb8efa046b0449720ae2ce5bf622ff31004d6b9b
4
- data.tar.gz: 0d95e74f82af5ba1e4b4b36c64f80fd3c7d3c5ba640dfdbf7173a69ea0fd42cd
3
+ metadata.gz: 4b0f13e3bc3237d32a7bf41c6807e043b154a71b8f1832fe8c1b69290dd8b075
4
+ data.tar.gz: 65661961ef9e706583a283807c144fed3f4e011741819d413793237c277fcb48
5
5
  SHA512:
6
- metadata.gz: 868999a7e1eef3eff804ccaf88f7f411dc44af9f8eb48a0468e29359e263bd993e5f1e520358b526fb8d39ee16bcb48a29a1fdba309b4d317813444e24ebe7d8
7
- data.tar.gz: 1507cb637007cff352cb4d71ad38f8a460699a02ef0de1548da3e9edeb2f1d0aa550d45bce0c724213a89547c11915ff860fc1f48ba7b89cf8a30ff50946dfc0
6
+ metadata.gz: a051cc35b09023db1afc3ca5b1d8c7db49ff254c5292c13731afc999b498cdfcbe8038814260b7a402b0623b07182ed3601bcd1eca4d4f83b956c31660cbdd15
7
+ data.tar.gz: 1b5d887497d813b64e7e2427247b8117ace37a8db1c17338a131a3c2383ad22b8d64bdcb593b73931f384b42e0d514a4ec3dfeed80933630bafa2cd02caca044
@@ -96,6 +96,10 @@ Then('the trace payload field {string} boolean attribute {string} is false') do
96
96
  assert_attribute field, key, { 'boolValue' => false }
97
97
  end
98
98
 
99
+ Then('the trace payload field {string} double attribute {string} equals {float}') do |field, attribute, expected|
100
+ check_attribute_equal field, attribute, 'doubleValue', expected
101
+ end
102
+
99
103
  # @!group Span steps
100
104
  Then('a span {word} equals {string}') do |attribute, expected|
101
105
  spans = spans_from_request_list(Maze::Server.list_for('traces'))
@@ -259,8 +263,10 @@ def attribute_value_matches?(attribute_value, expected_type, expected_value)
259
263
  expected_value.to_f.eql?(attribute_value[expected_type])
260
264
  when 'boolValue'
261
265
  expected_value.eql?('true').eql?(attribute_value[expected_type])
262
- when 'arrayValue', 'kvlistValue'
263
- $logger.error('Span attribute validation does not currently support the "arrayValue" or "kvlistValue" types')
266
+ when 'arrayValue'
267
+ expected_value == attribute_value[expected_type]['values']
268
+ when 'kvlistValue'
269
+ $logger.error('Span attribute validation does not currently support the "kvlistValue" type')
264
270
  false
265
271
  else
266
272
  $logger.error("An invalid attribute type was expected: '#{expected_type}'")
@@ -323,3 +329,46 @@ def assert_attribute(field, key, expected)
323
329
  attributes = Maze::Helper.read_key_path(list.current[:body], "#{field}.attributes")
324
330
  Maze.check.equal({ 'key' => key, 'value' => expected }, attributes.find { |a| a['key'] == key })
325
331
  end
332
+
333
+ def check_array_attribute_equal(field, attribute, expected_values)
334
+ actual_values = get_attribute_value(field, attribute, 'arrayValue')['values']
335
+
336
+ # Convert string representations of integers to integers for comparison
337
+ actual_values.map! do |value|
338
+ if value.key?('intValue')
339
+ value['intValue'].to_i
340
+ else
341
+ value
342
+ end
343
+ end
344
+
345
+ expected_values.map! do |value|
346
+ if value.key?('intValue')
347
+ value['intValue'].to_i
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ Maze.check.equal(expected_values, actual_values)
354
+ end
355
+
356
+ Then('the trace payload field {string} string array attribute {string} equals the array:') do |field, attribute, expected_values|
357
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'stringValue' => v } }
358
+ check_array_attribute_equal field, attribute, expected_values_list
359
+ end
360
+
361
+ Then('the trace payload field {string} integer array attribute {string} equals the array:') do |field, attribute, expected_values|
362
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'intValue' => v.to_i } }
363
+ check_array_attribute_equal(field, attribute, expected_values_list)
364
+ end
365
+
366
+ Then('the trace payload field {string} double array attribute {string} equals the array:') do |field, attribute, expected_values|
367
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'doubleValue' => v.to_f } }
368
+ check_array_attribute_equal field, attribute, expected_values_list
369
+ end
370
+
371
+ Then('the trace payload field {string} boolean array attribute {string} equals the array:') do |field, attribute, expected_values|
372
+ expected_values_list = expected_values.raw.flatten.map { |v| { 'boolValue' => v == 'true' } }
373
+ check_array_attribute_equal field, attribute, expected_values_list
374
+ end
@@ -71,13 +71,14 @@ module Maze
71
71
  def create_hash
72
72
  hash = {
73
73
  # Classic, non-specific devices for each Android version
74
+ 'ANDROID_14' => make_android_hash('Google Pixel 8', '14.0'),
74
75
  'ANDROID_13' => make_android_hash('Google Pixel 6 Pro', '13.0'),
75
76
  'ANDROID_12' => make_android_hash('Google Pixel 5', '12.0'),
76
77
  'ANDROID_11' => make_android_hash('Google Pixel 4', '11.0'),
77
78
  'ANDROID_10' => make_android_hash('Google Pixel 4', '10.0'),
78
79
  'ANDROID_9' => make_android_hash('Google Pixel 3', '9.0'),
79
80
  'ANDROID_8' => make_android_hash('Samsung Galaxy Note 9', '8.1'),
80
- 'ANDROID_7' => make_android_hash('Google Pixel', '7.1'),
81
+ 'ANDROID_7' => make_android_hash('Samsung Galaxy S8', '7.0'),
81
82
 
82
83
  # iOS devices
83
84
  'IOS_17' => make_ios_hash('iPhone 15', '17'),
data/lib/maze.rb CHANGED
@@ -7,7 +7,7 @@ require_relative 'maze/timers'
7
7
  # Glues the various parts of MazeRunner together that need to be accessed globally,
8
8
  # providing an alternative to the proliferation of global variables or singletons.
9
9
  module Maze
10
- VERSION = '9.9.1'
10
+ VERSION = '9.11.0'
11
11
 
12
12
  class << self
13
13
  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.9.1
4
+ version: 9.11.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: 2024-06-22 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber