From dc0b7e5db6b2bd7d38aebb2c0f4f6cf8b885482c Mon Sep 17 00:00:00 2001 From: Bugsnag notifiers Date: Wed, 31 Jul 2024 16:06:28 +0000 Subject: [PATCH] Docs update --- _index.html | 2 +- file.README.html | 2 +- index.html | 2 +- method_list.html | 30 +- requirements.html | 4 +- requirements/step_transformers.html | 3711 +++++++++++++++------------ requirements/tags.html | 2 +- stepdefinition_list.html | 398 +-- top-level-namespace.html | 308 ++- 9 files changed, 2507 insertions(+), 1952 deletions(-) diff --git a/_index.html b/_index.html index 49972c3b0..f9ce78ba9 100644 --- a/_index.html +++ b/_index.html @@ -90,7 +90,7 @@

Namespace Listing A-Z

diff --git a/file.README.html b/file.README.html index 58f86e6f5..6b78f6da1 100644 --- a/file.README.html +++ b/file.README.html @@ -85,7 +85,7 @@

Running the tests

diff --git a/index.html b/index.html index 016289a54..fd375e623 100644 --- a/index.html +++ b/index.html @@ -85,7 +85,7 @@

Running the tests

diff --git a/method_list.html b/method_list.html index ca063fbae..dbc0fd491 100644 --- a/method_list.html +++ b/method_list.html @@ -162,7 +162,7 @@

Method List

  • @@ -170,7 +170,7 @@

    Method List

  • @@ -178,7 +178,7 @@

    Method List

  • - #sanitized + #parse_multipart_body Top Level Namespace
  • @@ -186,7 +186,7 @@

    Method List

  • - #should_skip_platform_check + #sanitized Top Level Namespace
  • @@ -194,7 +194,7 @@

    Method List

  • @@ -202,7 +202,7 @@

    Method List

  • @@ -210,7 +210,7 @@

    Method List

  • @@ -218,7 +218,7 @@

    Method List

  • @@ -226,7 +226,7 @@

    Method List

  • @@ -234,7 +234,7 @@

    Method List

  • @@ -242,13 +242,21 @@

    Method List

  • +
    + #validate_error_reporting_thread + Top Level Namespace +
    +
  • + + +
  • #verify_feature_flags_with_table Top Level Namespace diff --git a/requirements.html b/requirements.html index 728d2a0b8..f8efa2d34 100644 --- a/requirements.html +++ b/requirements.html @@ -94,7 +94,7 @@
    Step Definitions & Transforms
    - 268 + 272 Step Definitions 3 Transforms @@ -109,7 +109,7 @@
    diff --git a/requirements/step_transformers.html b/requirements/step_transformers.html index 4ec93b9c4..a4a10cf27 100644 --- a/requirements/step_transformers.html +++ b/requirements/step_transformers.html @@ -67,7 +67,7 @@
    Step Definitions & Transforms
    @@ -17874,10 +17874,10 @@ ">
    - Then - 'the {request_type} payload field {string} equals the platform-dependent string:' + When + 'I clear and send the keys {string} to the element {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -17888,24 +17888,15 @@
    -
    lib/features/steps/app_automator_steps.rb:82
    +
    lib/features/steps/app_automator_steps.rb:72
    -

    Tests that the given payload value is correct for the target BrowserStack platform. -This step will assume the expected and payload values are strings. -If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    - -

    The DataTable used for this step should have ios and android in the same row as their expected value: - | android | Java.lang.RuntimeException | - | ios | NSException |

    - -

    If the expected value is set to "@skip", the check should be skipped -If the expected value is set to "@null", the check will be for null -If the expected value is set to "@not_null", the check will be for a non-null value

    +

    Sends keys to a given element, clearing it first +Requires a running Appium driver

    @@ -17921,18 +17912,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    -
    - -
  • - -
  • - - - - - -

    field_path [String] The field to test

    +

    keys [String] The keys to send to the element

  • @@ -17943,7 +17923,7 @@ -

    platform_values [DataTable] A table of acceptable values for each platform

    +

    element_id [String] The locator id

    @@ -17959,13 +17939,13 @@ @@ -17993,10 +17973,10 @@ ">
    - Then - 'the event {string} equals the platform-dependent string:' + When + 'I start the document server'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18007,46 +17987,21 @@
    -
    lib/features/steps/app_automator_steps.rb:90
    +
    lib/features/steps/document_server_steps.rb:5
    -

    See the error payload field {string} equals the platform-dependent string:

    +

    Starts the document server manually. It will be stopped automatically at the end of each scenario +(if started in this way).

    -

    Step parameters:

    -
      - -
    • - - - - - -

      field_path [String] The field to test, prepended with "events.0"

      -
      - -
    • - -
    • - - - - - -

      platform_values [DataTable] A table of acceptable values for each platform

      -
      - -
    • - -
    @@ -18057,13 +18012,13 @@
    -
    82
    -83
    -84
    +
    72
    +73
    +74
    -
    Then('the {request_type} payload field {string} equals the platform-dependent string:') do |request_type, field_path, platform_values|
    -  test_string_platform_values(request_type, field_path, platform_values)
    +            
    When('I clear and send the keys {string} to the element {string}') do |keys, element_id|
    +  Maze.driver.clear_and_send_keys_to_element(element_id, keys)
     end
    @@ -18092,9 +18047,9 @@
    Then - 'the {request_type} payload field {string} equals the platform-dependent numeric:' + 'the error is valid for the error reporting API version {string} for the {string} notifier'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18105,24 +18060,15 @@
    -
    lib/features/steps/app_automator_steps.rb:109
    +
    lib/features/steps/error_reporting_steps.rb:10
    -

    Tests that the given payload value is correct for the target BrowserStack platform. -This step will assume the expected and payload values are numeric. -If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    - -

    The DataTable used for this step should have ios and android in the same row as their expected value: - | android | 1 | - | ios | 5.5 |

    - -

    If the expected value is set to "@skip", the check should be skipped -If the expected value is set to "@null", the check will be for null -If the expected value is set to "@not_null", the check will be for a non-null value

    +

    Verifies that generic elements of an error payload are present. +APIKey fields and headers are tested against the '$api_key' global variable.

    @@ -18138,18 +18084,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    -
    - - - -
  • - - - - - -

    field_path [String] The field to test

    +

    version [String] The payload version expected

  • @@ -18160,7 +18095,7 @@ -

    platform_values [DataTable] A table of acceptable values for each platform

    +

    name [String] The expected name of the notifier

    @@ -18176,13 +18111,15 @@
    -
    90
    -91
    -92
    +
    5
    +6
    +7
    -
    Then('the event {string} equals the platform-dependent string:') do |field_path, platform_values|
    -  test_string_platform_values('error', "events.0.#{field_path}", platform_values)
    +            
    When('I start the document server') do
    +  Maze::DocumentServer.manual_start
     end
    @@ -18211,9 +18148,11 @@
    Then - 'the event {string} equals the platform-dependent numeric:' + 'the error is valid for the error reporting API version {string}' \ +' for the {string} notifier with the apiKey {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18224,14 +18163,14 @@
    -
    lib/features/steps/app_automator_steps.rb:117
    +
    lib/features/steps/error_reporting_steps.rb:20
    -

    See the payload field {string} equals the platform-dependent numeric:

    +

    Verifies that generic elements of an error payload are present.

    @@ -18247,7 +18186,7 @@ -

    field_path [String] The field to test, prepended with "events.0"

    +

    version [String] The payload version expected

    @@ -18258,7 +18197,18 @@ -

    platform_values [DataTable] A table of acceptable values for each platform

    +

    name [String] The expected name of the notifier

    +
    + + + +
  • + + + + + +

    api_key [String] The API key expected

  • @@ -18274,13 +18224,51 @@
    -
    109
    -110
    -111
    +
    10
    +11
    +12
    +13
    -
    Then('the {request_type} payload field {string} equals the platform-dependent numeric:') do |request_type, field_path, platform_values|
    -  test_numeric_platform_values(request_type, field_path, platform_values)
    +            
    Then('the error is valid for the error reporting API version {string} for the {string} notifier') do |version, name|
    +  step "the error is valid for the error reporting API version \"#{version}\"" \
    +       " for the \"#{name}\" notifier with the apiKey \"#{$api_key}\""
     end
    @@ -18309,9 +18297,9 @@
    Then - 'the {request_type} payload field {string} equals the platform-dependent boolean:' + 'event {int} is unhandled'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18322,68 +18310,25 @@
    -
    lib/features/steps/app_automator_steps.rb:136
    +
    lib/features/steps/error_reporting_steps.rb:51
    -

    Tests that the given payload value is correct for the target BrowserStack platform. -This step will assume the expected and payload values are booleans. -If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    - -

    The DataTable used for this step should have ios and android in the same row as their expected value: - | android | 1 | - | ios | 5 |

    - -

    If the expected value is set to "@skip", the check should be skipped -If the expected value is set to "@null", the check will be for null -If the expected value is set to "@not_null", the check will be for a non-null value

    +

    Verifies that an event is correct for an unhandled error +This checks various elements of the payload matching an unhandled error including: + The unhandled flag + Any attached session information + Severity

    -

    Step parameters:

    -
      - -
    • - - - - - -

      request_type [String] The type of request (error, session, build, etc)

      -
      - -
    • - -
    • - - - - - -

      field_path [String] The field to test

      -
      - -
    • - -
    • - - - - - -

      platform_values [DataTable] A table of acceptable values for each platform

      -
      - -
    • - -
    - +
    @@ -18393,13 +18338,13 @@
    -
    117
    -118
    -119
    +
    20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    -
    Then('the event {string} equals the platform-dependent numeric:') do |field_path, platform_values|
    -  test_numeric_platform_values('error', "events.0.#{field_path}", platform_values)
    +            
    Then('the error is valid for the error reporting API version {string}' \
    +     ' for the {string} notifier with the apiKey {string}') do |payload_version, notifier_name, api_key|
    +  steps %(
    +    Then the error "Bugsnag-Api-Key" header equals "#{api_key}"
    +    And the error payload field "apiKey" equals "#{api_key}"
    +    And the error "Bugsnag-Payload-Version" header equals "#{payload_version}"
    +    And the error payload contains the payloadVersion "#{payload_version}"
    +    And the error "Content-Type" header equals "application/json"
    +    And the error "Bugsnag-Sent-At" header is a timestamp
    +    And the error Bugsnag-Integrity header is valid
    +
    +    And the error payload field "notifier.name" equals "#{notifier_name}"
    +    And the error payload field "notifier.url" is not null
    +    And the error payload field "notifier.version" is not null
    +    And the error payload field "events" is a non-empty array
    +
    +    And each element in error payload field "events" has "severity"
    +    And each element in error payload field "events" has "severityReason.type"
    +    And each element in error payload field "events" has "unhandled"
    +    And each element in error payload field "events" has "exceptions"
    +  )
     end
    @@ -18428,9 +18373,9 @@
    Then - 'the event {string} equals the platform-dependent boolean:' + 'event {int} is unhandled with the severity {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18441,46 +18386,24 @@
    -
    lib/features/steps/app_automator_steps.rb:144
    +
    lib/features/steps/error_reporting_steps.rb:63
    -

    See the payload field {string} equals the platform-dependent boolean:

    +

    Verifies that an event is correct for an unhandled error +This checks various elements of the payload matching an unhandled error including: + The unhandled flag + Any attached session information + Severity

    -

    Step parameters:

    -
      - -
    • - - - - - -

      field_path [String] The field to test, prepended with "events.0"

      -
      - -
    • - -
    • - - - - - -

      platform_values [DataTable] A table of acceptable values for each platform

      -
      - -
    • - -
    @@ -18491,13 +18414,13 @@
    -
    136
    -137
    -138
    +
    51
    +52
    +53
    -
    Then('the {request_type} payload field {string} equals the platform-dependent boolean:') do |request_type, field_path, platform_values|
    -  test_boolean_platform_values(request_type, field_path, platform_values)
    +            
    Then('event {int} is unhandled') do |event|
    +  test_unhandled_state(event, true)
     end
    @@ -18526,9 +18449,9 @@
    Then - 'the exception {string} equals the platform-dependent string:' + 'event {int} is handled'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18539,46 +18462,24 @@
    -
    lib/features/steps/app_automator_steps.rb:152
    +
    lib/features/steps/error_reporting_steps.rb:74
    -

    See the payload field {string} equals the platform-dependent string:

    +

    Verifies that an event is correct for an handled error +This checks various elements of the payload matching an unhandled error including: + The unhandled flag + Any attached session information + Severity

    -

    Step parameters:

    -
      - -
    • - - - - - -

      field_path [String] The field to test, prepended with "events.0.exceptions.0."

      -
      - -
    • - -
    • - - - - - -

      platform_values [DataTable] A table of acceptable values for each platform

      -
      - -
    • - -
    @@ -18589,13 +18490,13 @@
    -
    144
    -145
    -146
    +
    63
    +64
    +65
    -
    Then('the event {string} equals the platform-dependent boolean:') do |field_path, platform_values|
    -  test_boolean_platform_values('error', "events.0.#{field_path}", platform_values)
    +            
    Then('event {int} is unhandled with the severity {string}') do |event, severity|
    +  test_unhandled_state(event, true, severity)
     end
    @@ -18624,9 +18525,9 @@
    Then - 'the {string} of stack frame {int} equals the platform-dependent string:' + 'event {int} is handled with the severity {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18637,57 +18538,24 @@
    -
    lib/features/steps/app_automator_steps.rb:161
    +
    lib/features/steps/error_reporting_steps.rb:86
    -

    See the payload field {string} equals the platform-dependent string:

    +

    Verifies that an event is correct for an handled error +This checks various elements of the payload matching an unhandled error including: + The unhandled flag + Any attached session information + Severity

    -

    Step parameters:

    -
      - -
    • - - - - - -

      field_path [String] The field to test, prepended with "events.0.exceptions.0.stacktrace.#{num}"

      -
      - -
    • - -
    • - - - - - -

      num [Integer] The index of the stack frame to test

      -
      - -
    • - -
    • - - - - - -

      platform_values [DataTable] A table of acceptable values for each platform

      -
      - -
    • - -
    @@ -18698,13 +18566,13 @@
    -
    152
    -153
    -154
    +
    74
    +75
    +76
    -
    Then('the exception {string} equals the platform-dependent string:') do |field_path, platform_values|
    -  test_string_platform_values('error', "events.0.exceptions.0.#{field_path}", platform_values)
    +            
    Then('event {int} is handled') do |event|
    +  test_unhandled_state(event, false)
     end
    @@ -18732,10 +18600,10 @@ ">
    - When - 'I clear and send the keys {string} to the element {string}' + Then + 'the error payload contains the payloadVersion {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18746,15 +18614,16 @@
    -
    lib/features/steps/app_automator_steps.rb:170
    +
    lib/features/steps/error_reporting_steps.rb:95
    -

    Sends keys to a given element, clearing it first -Requires a running Appium driver

    +

    Checks the payloadVersion is set correctly. + For Javascript this should be in the events. + For all other notifiers this should be a top-level key.

    @@ -18770,18 +18639,7 @@ -

    keys [String] The keys to send to the element

    -
    - - - -
  • - - - - - -

    element_id [String] The locator id

    +

    payload_version [String] The payload version expected

  • @@ -18797,13 +18655,29 @@
    -
    161
    -162
    -163
    +
    86
    +87
    +88
    -
    Then('the {string} of stack frame {int} equals the platform-dependent string:') do |field_path, num, platform_values|
    -  test_string_platform_values('error', "events.0.exceptions.0.stacktrace.#{num}.#{field_path}", platform_values)
    +            
    Then('event {int} is handled with the severity {string}') do |event, severity|
    +  test_unhandled_state(event, false, severity)
     end
    @@ -18831,10 +18705,10 @@ ">
    - When - 'I start the document server' + Then + /^the event "(.+)" is (true|false|null|not null)$/
    - Rubular + Rubular | UNUSED [Collapse] @@ -18845,21 +18719,46 @@
    -
    lib/features/steps/document_server_steps.rb:5
    +
    lib/features/steps/error_reporting_steps.rb:111
    -

    Starts the document server manually. It will be stopped automatically at the end of each scenario -(if started in this way).

    +

    Tests whether a value in the first event entry matches a literal.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      field [String] The relative location of the value to test

      +
      + +
    • + +
    • + + + + + +

      literal [Enum] The literal to test against, one of: true, false, null, not null

      +
      + +
    • + +
    @@ -18870,13 +18769,13 @@
    -
    170
    -171
    -172
    +
    95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    -
    When('I clear and send the keys {string} to the element {string}') do |keys, element_id|
    -  Maze.driver.clear_and_send_keys_to_element(element_id, keys)
    +            
    Then('the error payload contains the payloadVersion {string}') do |payload_version|
    +  body_version = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'payloadVersion')
    +  body_set = payload_version == body_version
    +  event_version = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'events.0.payloadVersion')
    +  event_set = payload_version == event_version
    +  Maze.check.true(
    +    body_set || event_set,
    +    "The payloadVersion was not the expected value of #{payload_version}. " \
    +    "#{body_version} found in body, #{event_version} found in event"
    +  )
     end
    @@ -18905,9 +18804,9 @@
    Then - 'the error is valid for the error reporting API version {string} for the {string} notifier' + 'the event {string} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -18918,15 +18817,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:10
    +
    lib/features/steps/error_reporting_steps.rb:119
    -

    Verifies that generic elements of an error payload are present. -APIKey fields and headers are tested against the '$api_key' global variable.

    +

    Tests whether a value in the first event entry matches a string.

    @@ -18942,7 +18840,7 @@ -

    version [String] The payload version expected

    +

    field [String] The relative location of the value to test

    @@ -18953,7 +18851,7 @@ -

    name [String] The expected name of the notifier

    +

    string_value [String] The string to match against

    @@ -18969,15 +18867,13 @@
    -
    5
    -6
    -7
    +
    111
    +112
    +113
    -
    When('I start the document server') do
    -  Maze::DocumentServer.manual_start
    +            
    Then(/^the event "(.+)" is (true|false|null|not null)$/) do |field, literal|
    +  step "the error payload field \"events.0.#{field}\" is #{literal}"
     end
    @@ -19006,11 +18902,9 @@
    Then - 'the error is valid for the error reporting API version {string}' \ -' for the {string} notifier with the apiKey {string}' + 'the event {string} equals {float}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19021,14 +18915,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:20
    +
    lib/features/steps/error_reporting_steps.rb:127
    -

    Verifies that generic elements of an error payload are present.

    +

    Tests whether a value in the first event entry matches a floating point value.

    @@ -19044,18 +18938,7 @@ -

    version [String] The payload version expected

    -
    - - - -
  • - - - - - -

    name [String] The expected name of the notifier

    +

    field [String] The relative location of the value to test

  • @@ -19066,7 +18949,7 @@ -

    api_key [String] The API key expected

    +

    string_value [String] The string to match against

    @@ -19082,51 +18965,13 @@
    -
    10
    -11
    -12
    -13
    +
    119
    +120
    +121
    -
    Then('the error is valid for the error reporting API version {string} for the {string} notifier') do |version, name|
    -  step "the error is valid for the error reporting API version \"#{version}\"" \
    -       " for the \"#{name}\" notifier with the apiKey \"#{$api_key}\""
    +            
    Then('the event {string} equals {string}') do |field, string_value|
    +  step "the error payload field \"events.0.#{field}\" equals \"#{string_value}\""
     end
    @@ -19155,9 +19000,9 @@
    Then - 'event {int} is unhandled' + 'the event {string} equals {float} to {int} decimal place(s)'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19168,24 +19013,46 @@
    -
    lib/features/steps/error_reporting_steps.rb:51
    +
    lib/features/steps/error_reporting_steps.rb:135
    -

    Verifies that an event is correct for an unhandled error -This checks various elements of the payload matching an unhandled error including: - The unhandled flag - Any attached session information - Severity

    +

    Tests whether a value in the first event entry matches a floating point value, to a given number of decimal places.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      field [String] The relative location of the value to test

      +
      + +
    • + +
    • + + + + + +

      string_value [String] The string to match against

      +
      + +
    • + +
    @@ -19196,13 +19063,13 @@
    -
    20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    +
    127
    +128
    +129
    -
    Then('the error is valid for the error reporting API version {string}' \
    -     ' for the {string} notifier with the apiKey {string}') do |payload_version, notifier_name, api_key|
    -  steps %(
    -    Then the error "Bugsnag-Api-Key" header equals "#{api_key}"
    -    And the error payload field "apiKey" equals "#{api_key}"
    -    And the error "Bugsnag-Payload-Version" header equals "#{payload_version}"
    -    And the error payload contains the payloadVersion "#{payload_version}"
    -    And the error "Content-Type" header equals "application/json"
    -    And the error "Bugsnag-Sent-At" header is a timestamp
    -    And the error Bugsnag-Integrity header is valid
    -
    -    And the error payload field "notifier.name" equals "#{notifier_name}"
    -    And the error payload field "notifier.url" is not null
    -    And the error payload field "notifier.version" is not null
    -    And the error payload field "events" is a non-empty array
    -
    -    And each element in error payload field "events" has "severity"
    -    And each element in error payload field "events" has "severityReason.type"
    -    And each element in error payload field "events" has "unhandled"
    -    And each element in error payload field "events" has "exceptions"
    -  )
    +            
    Then('the event {string} equals {float}') do |field, float_value|
    +  step "the error payload field \"events.0.#{field}\" equals #{float_value}"
     end
    @@ -19231,9 +19098,9 @@
    Then - 'event {int} is unhandled with the severity {string}' + 'the event {string} equals {int}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19244,24 +19111,46 @@
    -
    lib/features/steps/error_reporting_steps.rb:63
    +
    lib/features/steps/error_reporting_steps.rb:143
    -

    Verifies that an event is correct for an unhandled error -This checks various elements of the payload matching an unhandled error including: - The unhandled flag - Any attached session information - Severity

    +

    Tests whether a value in the first event entry equals an integer.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      field [String] The relative location of the value to test

      +
      + +
    • + +
    • + + + + + +

      value [Integer] The integer to test against

      +
      + +
    • + +
    @@ -19272,13 +19161,13 @@
    -
    51
    -52
    -53
    +
    135
    +136
    +137
    -
    Then('event {int} is unhandled') do |event|
    -  test_unhandled_state(event, true)
    +            
    Then('the event {string} equals {float} to {int} decimal place(s)') do |field, float_value, places|
    +  step "the error payload field \"events.0.#{field}\" equals #{float_value} to #{places} decimal places"
     end
    @@ -19307,9 +19196,9 @@
    Then - 'event {int} is handled' + 'the event {string} starts with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19320,24 +19209,46 @@
    -
    lib/features/steps/error_reporting_steps.rb:74
    +
    lib/features/steps/error_reporting_steps.rb:151
    -

    Verifies that an event is correct for an handled error -This checks various elements of the payload matching an unhandled error including: - The unhandled flag - Any attached session information - Severity

    +

    Tests whether a value in the first event entry starts with a string.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      field [String] The relative location of the value to test

      +
      + +
    • + +
    • + + + + + +

      string_value [String] The string to match against

      +
      + +
    • + +
    @@ -19348,13 +19259,13 @@
    -
    63
    -64
    -65
    +
    143
    +144
    +145
    -
    Then('event {int} is unhandled with the severity {string}') do |event, severity|
    -  test_unhandled_state(event, true, severity)
    +            
    Then('the event {string} equals {int}') do |field, value|
    +  step "the error payload field \"events.0.#{field}\" equals #{value}"
     end
    @@ -19383,9 +19294,9 @@
    Then - 'event {int} is handled with the severity {string}' + 'the event {string} ends with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19396,24 +19307,46 @@
    -
    lib/features/steps/error_reporting_steps.rb:86
    +
    lib/features/steps/error_reporting_steps.rb:159
    -

    Verifies that an event is correct for an handled error -This checks various elements of the payload matching an unhandled error including: - The unhandled flag - Any attached session information - Severity

    +

    Tests whether a value in the first event entry ends with a string.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      field [String] The relative location of the value to test

      +
      + +
    • + +
    • + + + + + +

      string_value [String] The string to match against

      +
      + +
    • + +
    @@ -19424,13 +19357,13 @@
    -
    74
    -75
    -76
    +
    151
    +152
    +153
    -
    Then('event {int} is handled') do |event|
    -  test_unhandled_state(event, false)
    +            
    Then('the event {string} starts with {string}') do |field, string_value|
    +  step "the error payload field \"events.0.#{field}\" starts with \"#{string_value}\""
     end
    @@ -19459,9 +19392,9 @@
    Then - 'the error payload contains the payloadVersion {string}' + 'the event {string} matches {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19472,16 +19405,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:95
    +
    lib/features/steps/error_reporting_steps.rb:167
    -

    Checks the payloadVersion is set correctly. - For Javascript this should be in the events. - For all other notifiers this should be a top-level key.

    +

    Tests whether a value in the first event entry matches a regex.

    @@ -19497,7 +19428,18 @@ -

    payload_version [String] The payload version expected

    +

    field [String] The relative location of the value to test

    +
    + + + +
  • + + + + + +

    pattern [String] The regex to match against

  • @@ -19513,29 +19455,13 @@
    -
    86
    -87
    -88
    +
    159
    +160
    +161
    -
    Then('event {int} is handled with the severity {string}') do |event, severity|
    -  test_unhandled_state(event, false, severity)
    +            
    Then('the event {string} ends with {string}') do |field, string_value|
    +  step "the error payload field \"events.0.#{field}\" ends with \"#{string_value}\""
     end
    @@ -19564,9 +19490,9 @@
    Then - /^the event "(.+)" is (true|false|null|not null)$/ + 'the event {string} is a timestamp'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19577,14 +19503,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:111
    +
    lib/features/steps/error_reporting_steps.rb:174
    -

    Tests whether a value in the first event entry matches a literal.

    +

    Tests whether a value in the first event entry is a timestamp.

    @@ -19605,17 +19531,6 @@ -
  • - - - - - -

    literal [Enum] The literal to test against, one of: true, false, null, not null

    -
    - -
  • -
    @@ -19627,13 +19542,13 @@
    -
    95
    -96
    -97
    -98
    -99
    -100
    -101
    -102
    -103
    -104
    -105
    +
    167
    +168
    +169
    -
    Then('the error payload contains the payloadVersion {string}') do |payload_version|
    -  body_version = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'payloadVersion')
    -  body_set = payload_version == body_version
    -  event_version = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], 'events.0.payloadVersion')
    -  event_set = payload_version == event_version
    -  Maze.check.true(
    -    body_set || event_set,
    -    "The payloadVersion was not the expected value of #{payload_version}. " \
    -    "#{body_version} found in body, #{event_version} found in event"
    -  )
    +            
    Then('the event {string} matches {string}') do |field, pattern|
    +  step "the error payload field \"events.0.#{field}\" matches the regex \"#{pattern}\""
     end
    @@ -19662,9 +19577,9 @@
    Then - 'the event {string} equals {string}' + 'the event {string} is a parsable timestamp in seconds'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19675,14 +19590,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:119
    +
    lib/features/steps/error_reporting_steps.rb:181
    -

    Tests whether a value in the first event entry matches a string.

    +

    Tests whether a value in the first event entry is a numeric and parsable timestamp.

    @@ -19703,17 +19618,6 @@ -
  • - - - - - -

    string_value [String] The string to match against

    -
    - -
  • -
    @@ -19725,13 +19629,13 @@
    -
    111
    -112
    -113
    +
    174
    +175
    +176
    -
    Then(/^the event "(.+)" is (true|false|null|not null)$/) do |field, literal|
    -  step "the error payload field \"events.0.#{field}\" is #{literal}"
    +            
    Then('the event {string} is a timestamp') do |field|
    +  step "the error payload field \"events.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
     end
    @@ -19760,9 +19664,9 @@
    Then - 'the event {string} equals {float}' + 'the event {string} equals the environment variable {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19773,14 +19677,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:127
    +
    lib/features/steps/error_reporting_steps.rb:189
    -

    Tests whether a value in the first event entry matches a floating point value.

    +

    Tests the Event field value against an environment variable.

    @@ -19796,7 +19700,7 @@ -

    field [String] The relative location of the value to test

    +

    field [String] The payload element to check

    @@ -19807,7 +19711,7 @@ -

    string_value [String] The string to match against

    +

    env_var [String] The environment variable to test against

    @@ -19823,13 +19727,13 @@
    -
    119
    -120
    -121
    +
    181
    +182
    +183
    -
    Then('the event {string} equals {string}') do |field, string_value|
    -  step "the error payload field \"events.0.#{field}\" equals \"#{string_value}\""
    +            
    Then('the event {string} is a parsable timestamp in seconds') do |field|
    +  step "the error payload field \"events.0.#{field}\" is a parsable timestamp in seconds"
     end
    @@ -19858,9 +19762,9 @@
    Then - 'the event {string} equals {float} to {int} decimal place(s)' + 'the event {string} matches the JSON fixture in {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19871,14 +19775,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:135
    +
    lib/features/steps/error_reporting_steps.rb:197
    -

    Tests whether a value in the first event entry matches a floating point value, to a given number of decimal places.

    +

    Tests whether a value in the first event entry matches a JSON fixture.

    @@ -19905,7 +19809,7 @@ -

    string_value [String] The string to match against

    +

    fixture_path [String] The fixture to match against

    @@ -19921,13 +19825,13 @@
    -
    127
    -128
    -129
    +
    189
    +190
    +191
    -
    Then('the event {string} equals {float}') do |field, float_value|
    -  step "the error payload field \"events.0.#{field}\" equals #{float_value}"
    +            
    Then('the event {string} equals the environment variable {string}') do |field, env_var|
    +  step "the error payload field \"events.0.#{field}\" equals the environment variable \"#{env_var}\""
     end
    @@ -19956,9 +19860,9 @@
    Then - 'the event {string} equals {int}' + 'the event {string} string is empty'
    - Rubular + Rubular | UNUSED [Collapse] @@ -19969,48 +19873,12 @@
    -
    lib/features/steps/error_reporting_steps.rb:143
    +
    lib/features/steps/error_reporting_steps.rb:201
    -
    -
    -

    Tests whether a value in the first event entry equals an integer.

    - - -
    -
    -
    - -

    Step parameters:

    -
      - -
    • - - - - - -

      field [String] The relative location of the value to test

      -
      - -
    • - -
    • - - - - -

      value [Integer] The integer to test against

      -
      - -
    • - -
    - -
    @@ -20019,13 +19887,15 @@
    -
    135
    -136
    -137
    +
    197
    +198
    +199
    -
    Then('the event {string} equals {float} to {int} decimal place(s)') do |field, float_value, places|
    -  step "the error payload field \"events.0.#{field}\" equals #{float_value} to #{places} decimal places"
    +            
    Then('the event {string} matches the JSON fixture in {string}') do |field, fixture_path|
    +  step "the error payload field \"events.0.#{field}\" matches the JSON fixture in \"#{fixture_path}\""
     end
    @@ -20054,9 +19924,9 @@
    Then - 'the event {string} starts with {string}' + 'the event {string} is greater than {int}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20067,48 +19937,12 @@
    -
    lib/features/steps/error_reporting_steps.rb:151
    +
    lib/features/steps/error_reporting_steps.rb:206
    -
    -
    -

    Tests whether a value in the first event entry starts with a string.

    - - -
    -
    -
    - -

    Step parameters:

    -
      - -
    • - - - - - -

      field [String] The relative location of the value to test

      -
      - -
    • - -
    • - - - - - -

      string_value [String] The string to match against

      -
      -
    • - -
    - -
    @@ -20117,13 +19951,17 @@
    -
    143
    -144
    -145
    +
    201
    +202
    +203
    +204
    -
    Then('the event {string} equals {int}') do |field, value|
    -  step "the error payload field \"events.0.#{field}\" equals #{value}"
    +            
    Then('the event {string} string is empty') do |keypath|
    +  value = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], keypath)
    +  Maze.check.true(value.nil? || value.empty?, "The #{keypath} is not empty: '#{value}'")
     end
    @@ -20152,9 +19990,9 @@
    Then - 'the event {string} ends with {string}' + 'the exception {string} starts with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20165,14 +20003,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:159
    +
    lib/features/steps/error_reporting_steps.rb:216
    -

    Tests whether a value in the first event entry ends with a string.

    +

    Tests whether a value in the first exception of the first event entry starts with a string.

    @@ -20215,13 +20053,13 @@
    -
    151
    -152
    -153
    +
    206
    +207
    +208
    +209
    +210
    -
    Then('the event {string} starts with {string}') do |field, string_value|
    -  step "the error payload field \"events.0.#{field}\" starts with \"#{string_value}\""
    +            
    Then('the event {string} is greater than {int}') do |keypath, int|
    +  value = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], "events.0.#{keypath}")
    +  Maze.check.false(value.nil?, "The event #{keypath} is nil")
    +  Maze.check.operator(value, :>, int)
     end
    @@ -20250,9 +20088,9 @@
    Then - 'the event {string} matches {string}' + 'the exception {string} ends with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20263,14 +20101,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:167
    +
    lib/features/steps/error_reporting_steps.rb:224
    -

    Tests whether a value in the first event entry matches a regex.

    +

    Tests whether a value in the first exception of the first event entry ends with a string.

    @@ -20297,7 +20135,7 @@ -

    pattern [String] The regex to match against

    +

    string_value [String] The string to match against

    @@ -20313,13 +20151,13 @@
    -
    159
    -160
    -161
    +
    216
    +217
    +218
    -
    Then('the event {string} ends with {string}') do |field, string_value|
    -  step "the error payload field \"events.0.#{field}\" ends with \"#{string_value}\""
    +            
    Then('the exception {string} starts with {string}') do |field, string_value|
    +  step "the error payload field \"events.0.exceptions.0.#{field}\" starts with \"#{string_value}\""
     end
    @@ -20348,9 +20186,9 @@
    Then - 'the event {string} is a timestamp' + 'the exception {string} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20361,14 +20199,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:174
    +
    lib/features/steps/error_reporting_steps.rb:232
    -

    Tests whether a value in the first event entry is a timestamp.

    +

    Tests whether a value in the first exception of the first event entry equals a string.

    @@ -20389,6 +20227,17 @@ +
  • + + + + + +

    string_value [String] The string to match against

    +
    + +
  • +
    @@ -20400,13 +20249,13 @@
    -
    167
    -168
    -169
    +
    224
    +225
    +226
    -
    Then('the event {string} matches {string}') do |field, pattern|
    -  step "the error payload field \"events.0.#{field}\" matches the regex \"#{pattern}\""
    +            
    Then('the exception {string} ends with {string}') do |field, string_value|
    +  step "the error payload field \"events.0.exceptions.0.#{field}\" ends with \"#{string_value}\""
     end
    @@ -20435,9 +20284,9 @@
    Then - 'the event {string} is a parsable timestamp in seconds' + 'the exception {string} matches {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20448,14 +20297,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:181
    +
    lib/features/steps/error_reporting_steps.rb:240
    -

    Tests whether a value in the first event entry is a numeric and parsable timestamp.

    +

    Tests whether a value in the first exception of the first event entry matches a regex.

    @@ -20476,6 +20325,17 @@ +
  • + + + + + +

    pattern [String] The regex to match against

    +
    + +
  • +
    @@ -20487,13 +20347,13 @@
    -
    174
    -175
    -176
    +
    232
    +233
    +234
    -
    Then('the event {string} is a timestamp') do |field|
    -  step "the error payload field \"events.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
    +            
    Then('the exception {string} equals {string}') do |field, string_value|
    +  step "the error payload field \"events.0.exceptions.0.#{field}\" equals \"#{string_value}\""
     end
    @@ -20522,9 +20382,9 @@
    Then - 'the event {string} equals the environment variable {string}' + 'the {string} of stack frame {int} equals {int}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20535,14 +20395,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:189
    +
    lib/features/steps/error_reporting_steps.rb:249
    -

    Tests the Event field value against an environment variable.

    +

    Tests whether a element of a stack frame in the first exception of the first event equals an integer.

    @@ -20558,7 +20418,7 @@ -

    field [String] The payload element to check

    +

    key [String] The element of the stack frame to test

    @@ -20569,7 +20429,18 @@ -

    env_var [String] The environment variable to test against

    +

    num [Integer] The stack frame where the element is present

    +
    + + + +
  • + + + + + +

    value [Integer] The value to test against

  • @@ -20585,13 +20456,15 @@
    -
    181
    -182
    -183
    +
    240
    +241
    +242
    -
    Then('the event {string} is a parsable timestamp in seconds') do |field|
    -  step "the error payload field \"events.0.#{field}\" is a parsable timestamp in seconds"
    +            
    Then('the exception {string} matches {string}') do |field, pattern|
    +  step "the error payload field \"events.0.exceptions.0.#{field}\" matches the regex \"#{pattern}\""
     end
    @@ -20620,9 +20493,9 @@
    Then - 'the event {string} matches the JSON fixture in {string}' + 'the {string} of stack frame {int} matches {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20633,14 +20506,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:197
    +
    lib/features/steps/error_reporting_steps.rb:259
    -

    Tests whether a value in the first event entry matches a JSON fixture.

    +

    Tests whether an element of a stack frame in the first exception of the first event matches a regex pattern.

    @@ -20656,7 +20529,7 @@ -

    field [String] The relative location of the value to test

    +

    key [String] The element of the stack frame to test

    @@ -20667,7 +20540,18 @@ -

    fixture_path [String] The fixture to match against

    +

    num [Integer] The stack frame where the element is present

    +
    + + + +
  • + + + + + +

    pattern [String] The regex to match against

  • @@ -20683,13 +20567,15 @@
    -
    189
    -190
    -191
    +
    249
    +250
    +251
    +252
    -
    Then('the event {string} equals the environment variable {string}') do |field, env_var|
    -  step "the error payload field \"events.0.#{field}\" equals the environment variable \"#{env_var}\""
    +            
    Then('the {string} of stack frame {int} equals {int}') do |key, num, value|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" equals #{value}"
     end
    @@ -20718,9 +20604,9 @@
    Then - 'the event {string} string is empty' + 'the {string} of stack frame {int} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20731,76 +20617,59 @@
    -
    lib/features/steps/error_reporting_steps.rb:201
    +
    lib/features/steps/error_reporting_steps.rb:269
    - -
    - +
    +
    +

    Tests whether an element of a stack frame in the first exception of the first event equals a string.

    - -
    -
    -
    197
    -198
    -199
    +
    259
    +260
    +261
    +262
    -
    Then('the event {string} matches the JSON fixture in {string}') do |field, fixture_path|
    -  step "the error payload field \"events.0.#{field}\" matches the JSON fixture in \"#{fixture_path}\""
    +            
    Then('the {string} of stack frame {int} matches {string}') do |key, num, pattern|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" matches the regex \"#{pattern}\""
     end
    - - - - -
    -
    201
    -202
    -203
    -204
    -
    -
    Then('the event {string} string is empty') do |keypath|
    -  value = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], keypath)
    -  Maze.check.true(value.nil? || value.empty?, "The #{keypath} is not empty: '#{value}'")
    -end
    -
    -
    - - -
    - -
    No steps were found to match this step definition.
    - -
    - - -
    - - - - -
    - -
    - Then - 'the event {string} is greater than {int}' -
    - Rubular +
    + +

    Step parameters:

    +
    -
    -
    - -
    - -
    -
    lib/features/steps/error_reporting_steps.rb:206
    -
    - - -
    + + + +

    key [String] The element of the stack frame to test

    +
    + + + +
  • + + + + + +

    num [Integer] The stack frame where the element is present

    +
    + +
  • + +
  • + + + + + +

    value [String] The value to test against

    +
    + +
  • + + + +
    @@ -20809,17 +20678,15 @@ @@ -20845,12 +20712,12 @@
    - +
    Then - 'the exception {string} starts with {string}' + 'the {string} of stack frame {int} starts with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20861,14 +20728,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:216
    +
    lib/features/steps/error_reporting_steps.rb:279
    -

    Tests whether a value in the first exception of the first event entry starts with a string.

    +

    Tests whether an element of a stack frame in the first exception of the first event starts with a string.

    @@ -20884,7 +20751,7 @@ -

    field [String] The relative location of the value to test

    +

    key [String] The element of the stack frame to test

    @@ -20895,7 +20762,18 @@ -

    string_value [String] The string to match against

    +

    num [Integer] The stack frame where the element is present

    +
    + + + +
  • + + + + + +

    value [String] The value to test against

  • @@ -20911,13 +20789,15 @@
    -
    206
    -207
    -208
    -209
    -210
    +
    269
    +270
    +271
    +272
    -
    Then('the event {string} is greater than {int}') do |keypath, int|
    -  value = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], "events.0.#{keypath}")
    -  Maze.check.false(value.nil?, "The event #{keypath} is nil")
    -  Maze.check.operator(value, :>, int)
    +            
    Then('the {string} of stack frame {int} equals {string}') do |key, num, value|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" equals \"#{value}\""
     end
    @@ -20943,12 +20823,12 @@
    - +
    Then - 'the exception {string} ends with {string}' + 'the {string} of stack frame {int} ends with {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -20959,14 +20839,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:224
    +
    lib/features/steps/error_reporting_steps.rb:289
    -

    Tests whether a value in the first exception of the first event entry ends with a string.

    +

    Tests whether an element of a stack frame in the first exception of the first event ends with a string.

    @@ -20982,7 +20862,7 @@ -

    field [String] The relative location of the value to test

    +

    key [String] The element of the stack frame to test

    @@ -20993,7 +20873,18 @@ -

    string_value [String] The string to match against

    +

    num [Integer] The stack frame where the element is present

    +
    + + + +
  • + + + + + +

    value [String] The value to test against

  • @@ -21009,13 +20900,15 @@
    -
    216
    -217
    -218
    +
    279
    +280
    +281
    +282
    -
    Then('the exception {string} starts with {string}') do |field, string_value|
    -  step "the error payload field \"events.0.exceptions.0.#{field}\" starts with \"#{string_value}\""
    +            
    Then('the {string} of stack frame {int} starts with {string}') do |key, num, value|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" starts with \"#{value}\""
     end
    @@ -21041,12 +20934,12 @@
    - +
    Then - 'the exception {string} equals {string}' + /^the "(.*)" of stack frame (\d*) is (true|false|null|not null)$/
    - Rubular + Rubular | UNUSED [Collapse] @@ -21057,14 +20950,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:232
    +
    lib/features/steps/error_reporting_steps.rb:299
    -

    Tests whether a value in the first exception of the first event entry equals a string.

    +

    Tests whether an element of a stack frame in the first exception of the first event matches a literal.

    @@ -21080,7 +20973,7 @@ -

    field [String] The relative location of the value to test

    +

    key [String] The element of the stack frame to test

    @@ -21091,7 +20984,18 @@ -

    string_value [String] The string to match against

    +

    num [Integer] The stack frame where the element is present

    +
    + + + +
  • + + + + + +

    literal [Enum] The literal to test against, one of: true, false, null, not null

  • @@ -21107,13 +21011,15 @@
    -
    224
    -225
    -226
    +
    289
    +290
    +291
    +292
    -
    Then('the exception {string} ends with {string}') do |field, string_value|
    -  step "the error payload field \"events.0.exceptions.0.#{field}\" ends with \"#{string_value}\""
    +            
    Then('the {string} of stack frame {int} ends with {string}') do |key, num, value|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" ends with \"#{value}\""
     end
    @@ -21139,12 +21045,12 @@
    - +
    Then - 'the exception {string} matches {string}' + 'the thread with name {string} contains the error reporting flag'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21155,14 +21061,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:240
    +
    lib/features/steps/error_reporting_steps.rb:307
    -

    Tests whether a value in the first exception of the first event entry matches a regex.

    +

    Tests whether a thread from the first event, identified by name, is the error reporting thread.

    @@ -21178,18 +21084,7 @@ -

    field [String] The relative location of the value to test

    -
    - - - -
  • - - - - - -

    pattern [String] The regex to match against

    +

    thread_name [String] The name of the thread to test

  • @@ -21205,13 +21100,13 @@
    -
    232
    -233
    -234
    +
    299
    +300
    +301
    +302
    -
    Then('the exception {string} equals {string}') do |field, string_value|
    -  step "the error payload field \"events.0.exceptions.0.#{field}\" equals \"#{string_value}\""
    +            
    Then(/^the "(.*)" of stack frame (\d*) is (true|false|null|not null)$/) do |key, num, literal|
    +  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    +  step "the error payload field \"#{field}\" is #{literal}"
     end
    @@ -21237,12 +21132,12 @@
    - +
    Then - 'the {string} of stack frame {int} equals {int}' + 'the thread with id {string} contains the error reporting flag'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21253,14 +21148,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:249
    +
    lib/features/steps/error_reporting_steps.rb:314
    -

    Tests whether a element of a stack frame in the first exception of the first event equals an integer.

    +

    Tests whether a thread from the first event, identified by an id, is the error reporting thread.

    @@ -21276,29 +21171,7 @@ -

    key [String] The element of the stack frame to test

    -
    - - - -
  • - - - - - -

    num [Integer] The stack frame where the element is present

    -
    - -
  • - -
  • - - - - - -

    value [Integer] The value to test against

    +

    thread_id [String] The id of the thread to test

  • @@ -21314,15 +21187,13 @@
    -
    240
    -241
    -242
    +
    307
    +308
    +309
    -
    Then('the exception {string} matches {string}') do |field, pattern|
    -  step "the error payload field \"events.0.exceptions.0.#{field}\" matches the regex \"#{pattern}\""
    +            
    Then('the thread with name {string} contains the error reporting flag') do |thread_name|
    +  validate_error_reporting_thread('name', thread_name)
     end
    @@ -21348,12 +21219,12 @@
    - +
    Then - 'the {string} of stack frame {int} matches {string}' + 'the {request_type} {string} query parameter equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21364,14 +21235,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:259
    +
    lib/features/steps/query_parameter_steps.rb:10
    -

    Tests whether an element of a stack frame in the first exception of the first event matches a regex pattern.

    +

    Tests that a query parameter matches a string.

    @@ -21387,7 +21258,7 @@ -

    key [String] The element of the stack frame to test

    +

    request_type [String] The type of request (error, session, build, etc)

    @@ -21398,7 +21269,7 @@ -

    num [Integer] The stack frame where the element is present

    +

    parameter_name [String] The parameter to test

    @@ -21409,7 +21280,7 @@ -

    pattern [String] The regex to match against

    +

    parameter_value [String] The expected value

    @@ -21425,15 +21296,15 @@
    -
    249
    -250
    -251
    -252
    +
    314
    +315
    +316
    -
    Then('the {string} of stack frame {int} equals {int}') do |key, num, value|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" equals #{value}"
    +            
    Then('the thread with id {string} contains the error reporting flag') do |thread_id|
    +  validate_error_reporting_thread('id', thread_id)
     end
    @@ -21459,12 +21330,12 @@
    - +
    Then - 'the {string} of stack frame {int} equals {string}' + 'the {request_type} {string} query parameter is not null'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21475,14 +21346,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:269
    +
    lib/features/steps/query_parameter_steps.rb:19
    -

    Tests whether an element of a stack frame in the first exception of the first event equals a string.

    +

    Tests that a query parameter is present and not null.

    @@ -21498,18 +21369,7 @@ -

    key [String] The element of the stack frame to test

    -
    - - - -
  • - - - - - -

    num [Integer] The stack frame where the element is present

    +

    request_type [String] The type of request (error, session, build, etc)

  • @@ -21520,7 +21380,7 @@ -

    value [String] The value to test against

    +

    parameter_name [String] The parameter to test

    @@ -21536,15 +21396,15 @@
    -
    259
    -260
    -261
    -262
    +
    10
    +11
    +12
    +13
    -
    Then('the {string} of stack frame {int} matches {string}') do |key, num, pattern|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" matches the regex \"#{pattern}\""
    +            
    Then('the {request_type} {string} query parameter equals {string}') do |request_type, parameter_name, parameter_value|
    +  Maze.check.equal(parameter_value,
    +                   Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0])
     end
    @@ -21570,12 +21430,12 @@
    - +
    Then - 'the {string} of stack frame {int} starts with {string}' + 'the {request_type} {string} query parameter is a timestamp'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21586,14 +21446,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:279
    +
    lib/features/steps/query_parameter_steps.rb:28
    -

    Tests whether an element of a stack frame in the first exception of the first event starts with a string.

    +

    Tests that a query parameter is a timestamp.

    @@ -21609,18 +21469,7 @@ -

    key [String] The element of the stack frame to test

    -
    - - - -
  • - - - - - -

    num [Integer] The stack frame where the element is present

    +

    request_type [String] The type of request (error, session, build, etc)

  • @@ -21631,7 +21480,7 @@ -

    value [String] The value to test against

    +

    parameter_name [String] The parameter to test

    @@ -21647,15 +21496,15 @@
    -
    269
    -270
    -271
    -272
    +
    19
    +20
    +21
    +22
    -
    Then('the {string} of stack frame {int} equals {string}') do |key, num, value|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" equals \"#{value}\""
    +            
    Then('the {request_type} {string} query parameter is not null') do |request_type, parameter_name|
    +  Maze.check.not_nil(Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0],
    +                     "The '#{parameter_name}' query parameter should not be null")
     end
    @@ -21681,12 +21530,12 @@
    - +
    Then - 'the {string} of stack frame {int} ends with {string}' + 'the session is valid for the session reporting API version {string} for the {string} notifier'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21697,14 +21546,15 @@
    -
    lib/features/steps/error_reporting_steps.rb:289
    +
    lib/features/steps/session_tracking_steps.rb:8
    -

    Tests whether an element of a stack frame in the first exception of the first event ends with a string.

    +

    Verifies that generic elements of a session payload are present. +APIKey fields and headers are tested against the '$api_key' global variable.

    @@ -21720,18 +21570,7 @@ -

    key [String] The element of the stack frame to test

    -
    - - - -
  • - - - - - -

    num [Integer] The stack frame where the element is present

    +

    payload_version [String] The payload version expected

  • @@ -21742,7 +21581,7 @@ -

    value [String] The value to test against

    +

    notifier_name [String] The expected name of the notifier

    @@ -21758,15 +21597,39 @@
    -
    279
    -280
    -281
    -282
    +
    28
    +29
    +30
    +31
    -
    Then('the {string} of stack frame {int} starts with {string}') do |key, num, value|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" starts with \"#{value}\""
    +            
    Then('the {request_type} {string} query parameter is a timestamp') do |request_type, parameter_name|
    +  param = Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0]
    +  Maze.check.match(TIMESTAMP_REGEX, param)
     end
    @@ -21792,12 +21655,12 @@
    - +
    Then - /^the "(.*)" of stack frame (\d*) is (true|false|null|not null)$/ + 'the session is valid for the session reporting API version {string} for the React Native notifier'
    - Rubular + Rubular | UNUSED [Collapse] @@ -21808,14 +21671,18 @@
    -
    lib/features/steps/error_reporting_steps.rb:299
    +
    lib/features/steps/session_tracking_steps.rb:32
    -

    Tests whether an element of a stack frame in the first exception of the first event matches a literal.

    +

    Verifies that generic elements of a session payload are present for the React Native notifier +APIKey fields and headers are tested against the '$api_key' global variable.

    + +

    TODO: I'm reluctant to risk changing the previous step implementation right now, but we should consider + refactoring the two at some point to avoid duplication.

    @@ -21831,18 +21698,7 @@ -

    key [String] The element of the stack frame to test

    -
    - - - -
  • - - - - - -

    num [Integer] The stack frame where the element is present

    +

    payload_version [String] The payload version expected

  • @@ -21853,7 +21709,7 @@ -

    literal [Enum] The literal to test against, one of: true, false, null, not null

    +

    notifier_name [String] The expected name of the notifier

    @@ -21869,15 +21725,37 @@
    -
    289
    -290
    -291
    -292
    +
    8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    -
    Then('the {string} of stack frame {int} ends with {string}') do |key, num, value|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" ends with \"#{value}\""
    +            
    Then('the session is valid for the session reporting API version {string} for the {string} notifier') \
    +  do |payload_version, notifier_name|
    +  steps %(
    +    Then the session "bugsnag-api-key" header equals "#{$api_key}"
    +    And the session "bugsnag-payload-version" header equals "#{payload_version}"
    +    And the session "Content-Type" header equals "application/json"
    +    And the session "Bugsnag-Sent-At" header is a timestamp
    +
    +    And the session payload field "notifier.name" equals "#{notifier_name}"
    +    And the session payload field "notifier.url" is not null
    +    And the session payload field "notifier.version" is not null
    +
    +    And the session payload field "app" is not null
    +    And the session payload field "device" is not null
    +  )
     end
    @@ -21903,12 +21781,12 @@
    - +
    Then - 'the thread with name {string} contains the error reporting flag' + /^the session "(.+)" is (true|false|null|not null)$/
    - Rubular + Rubular | UNUSED [Collapse] @@ -21919,14 +21797,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:307
    +
    lib/features/steps/session_tracking_steps.rb:52
    -

    Tests whether a thread from the first event, identified by name, is the error reporting thread.

    +

    Tests whether a value in the first session entry matches a literal.

    @@ -21942,7 +21820,18 @@ -

    thread_name [String] The name of the thread to test

    +

    field [String] The relative location of the value to test

    +
    + + + +
  • + + + + + +

    literal [Enum] The literal to test against, one of: true, false, null, not null

  • @@ -21958,13 +21847,13 @@
    -
    299
    -300
    -301
    -302
    +
    32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    -
    Then(/^the "(.*)" of stack frame (\d*) is (true|false|null|not null)$/) do |key, num, literal|
    -  field = "events.0.exceptions.0.stacktrace.#{num}.#{key}"
    -  step "the error payload field \"#{field}\" is #{literal}"
    +            
    Then('the session is valid for the session reporting API version {string} for the React Native notifier') do |payload_version|
    +  steps %{
    +    Then the session "bugsnag-api-key" header equals "#{$api_key}"
    +    And the session "bugsnag-payload-version" header equals "#{payload_version}"
    +    And the session "Content-Type" header equals "application/json"
    +    And the session "Bugsnag-Sent-At" header is a timestamp
    +
    +    And the session payload field "notifier.name" matches the regex "(Bugsnag React Native|(Android|iOS) Bugsnag Notifier)"
    +    And the session payload field "notifier.url" is not null
    +    And the session payload field "notifier.version" is not null
    +
    +    And the session payload field "app" is not null
    +    And the session payload field "device" is not null
    +  }
     end
    @@ -21990,12 +21879,12 @@
    - +
    Then - 'the thread with id {string} contains the error reporting flag' + 'the session {string} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22006,14 +21895,14 @@
    -
    lib/features/steps/error_reporting_steps.rb:314
    +
    lib/features/steps/session_tracking_steps.rb:60
    -

    Tests whether a thread from the first event, identified by an id, is the error reporting thread.

    +

    Tests whether a value in the first session entry matches a string.

    @@ -22029,7 +21918,18 @@ -

    thread_id [String] The id of the thread to test

    +

    field [String] The relative location of the value to test

    +
    + + + +
  • + + + + + +

    string_value [String] The string to match against

  • @@ -22045,13 +21945,13 @@
    -
    307
    -308
    -309
    +
    52
    +53
    +54
    -
    Then('the thread with name {string} contains the error reporting flag') do |thread_name|
    -  validate_error_reporting_thread('name', thread_name)
    +            
    Then(/^the session "(.+)" is (true|false|null|not null)$/) do |field, literal|
    +  step "the session payload field \"sessions.0.#{field}\" is #{literal}"
     end
    @@ -22077,12 +21977,12 @@
    - +
    Then - 'the {request_type} {string} query parameter equals {string}' + 'the session {string} is a timestamp'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22093,14 +21993,14 @@
    -
    lib/features/steps/query_parameter_steps.rb:10
    +
    lib/features/steps/session_tracking_steps.rb:67
    -

    Tests that a query parameter matches a string.

    +

    Tests whether a value in the first session entry is a timestamp.

    @@ -22116,29 +22016,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    -
    - - - -
  • - - - - - -

    parameter_name [String] The parameter to test

    -
    - -
  • - -
  • - - - - - -

    parameter_value [String] The expected value

    +

    field [String] The relative location of the value to test

  • @@ -22154,15 +22032,13 @@
    -
    314
    -315
    -316
    +
    60
    +61
    +62
    -
    Then('the thread with id {string} contains the error reporting flag') do |thread_id|
    -  validate_error_reporting_thread('id', thread_id)
    +            
    Then('the session {string} equals {string}') do |field, string_value|
    +  step "the session payload field \"sessions.0.#{field}\" equals \"#{string_value}\""
     end
    @@ -22188,12 +22064,12 @@
    - +
    Then - 'the {request_type} {string} query parameter is not null' + /^the sessionCount "(.+)" is (true|false|null|not null)$/
    - Rubular + Rubular | UNUSED [Collapse] @@ -22204,14 +22080,14 @@
    -
    lib/features/steps/query_parameter_steps.rb:19
    +
    lib/features/steps/session_tracking_steps.rb:75
    -

    Tests that a query parameter is present and not null.

    +

    Tests whether a value in the first sessionCount entry matches a literal.

    @@ -22227,7 +22103,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field [String] The relative location of the value to test

    @@ -22238,7 +22114,7 @@ -

    parameter_name [String] The parameter to test

    +

    literal [Enum] The literal to test against, one of: true, false, null, not null

    @@ -22254,15 +22130,13 @@
    -
    10
    -11
    -12
    -13
    +
    67
    +68
    +69
    -
    Then('the {request_type} {string} query parameter equals {string}') do |request_type, parameter_name, parameter_value|
    -  Maze.check.equal(parameter_value,
    -                   Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0])
    +            
    Then('the session {string} is a timestamp') do |field|
    +  step "the session payload field \"sessions.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
     end
    @@ -22288,12 +22162,12 @@
    - +
    Then - 'the {request_type} {string} query parameter is a timestamp' + 'the sessionCount {string} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22304,14 +22178,14 @@
    -
    lib/features/steps/query_parameter_steps.rb:28
    +
    lib/features/steps/session_tracking_steps.rb:83
    -

    Tests that a query parameter is a timestamp.

    +

    Tests whether a value in the first sessionCount entry matches a string.

    @@ -22327,7 +22201,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field [String] The relative location of the value to test

    @@ -22338,7 +22212,7 @@ -

    parameter_name [String] The parameter to test

    +

    string_value [String] The string to match against

    @@ -22354,15 +22228,13 @@
    -
    19
    -20
    -21
    -22
    +
    75
    +76
    +77
    -
    Then('the {request_type} {string} query parameter is not null') do |request_type, parameter_name|
    -  Maze.check.not_nil(Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0],
    -                     "The '#{parameter_name}' query parameter should not be null")
    +            
    Then(/^the sessionCount "(.+)" is (true|false|null|not null)$/) do |field, literal|
    +  step "the session payload field \"sessionCounts.0.#{field}\" is #{literal}"
     end
    @@ -22388,12 +22260,12 @@
    - +
    Then - 'the session is valid for the session reporting API version {string} for the {string} notifier' + 'the sessionCount {string} equals {int}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22404,15 +22276,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:8
    +
    lib/features/steps/session_tracking_steps.rb:91
    -

    Verifies that generic elements of a session payload are present. -APIKey fields and headers are tested against the '$api_key' global variable.

    +

    Tests whether a value in the first sessionCount entry equals an integer.

    @@ -22428,7 +22299,7 @@ -

    payload_version [String] The payload version expected

    +

    field [String] The relative location of the value to test

    @@ -22439,7 +22310,7 @@ -

    notifier_name [String] The expected name of the notifier

    +

    int_value [Integer] The integer to test against

    @@ -22455,39 +22326,13 @@
    -
    28
    -29
    -30
    -31
    +
    83
    +84
    +85
    -
    Then('the {request_type} {string} query parameter is a timestamp') do |request_type, parameter_name|
    -  param = Maze::Helper.parse_querystring(Maze::Server.list_for(request_type).current)[parameter_name][0]
    -  Maze.check.match(TIMESTAMP_REGEX, param)
    +            
    Then('the sessionCount {string} equals {string}') do |field, string_value|
    +  step "the session payload field \"sessionCounts.0.#{field}\" equals \"#{string_value}\""
     end
    @@ -22513,12 +22358,12 @@
    - +
    Then - 'the session is valid for the session reporting API version {string} for the React Native notifier' + 'the sessionCount {string} is a timestamp'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22529,18 +22374,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:32
    +
    lib/features/steps/session_tracking_steps.rb:98
    -

    Verifies that generic elements of a session payload are present for the React Native notifier -APIKey fields and headers are tested against the '$api_key' global variable.

    - -

    TODO: I'm reluctant to risk changing the previous step implementation right now, but we should consider - refactoring the two at some point to avoid duplication.

    +

    Tests whether a value in the first sessionCount entry is a timestamp.

    @@ -22556,18 +22397,7 @@ -

    payload_version [String] The payload version expected

    -
    - - - -
  • - - - - - -

    notifier_name [String] The expected name of the notifier

    +

    field [String] The relative location of the value to test

  • @@ -22583,37 +22413,13 @@
    -
    8
    -9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    +
    91
    +92
    +93
    -
    Then('the session is valid for the session reporting API version {string} for the {string} notifier') \
    -  do |payload_version, notifier_name|
    -  steps %(
    -    Then the session "bugsnag-api-key" header equals "#{$api_key}"
    -    And the session "bugsnag-payload-version" header equals "#{payload_version}"
    -    And the session "Content-Type" header equals "application/json"
    -    And the session "Bugsnag-Sent-At" header is a timestamp
    -
    -    And the session payload field "notifier.name" equals "#{notifier_name}"
    -    And the session payload field "notifier.url" is not null
    -    And the session payload field "notifier.version" is not null
    -
    -    And the session payload field "app" is not null
    -    And the session payload field "device" is not null
    -  )
    +            
    Then('the sessionCount {string} equals {int}') do |field, int_value|
    +  step "the session payload field \"sessionCounts.0.#{field}\" equals #{int_value}"
     end
    @@ -22639,12 +22445,12 @@
    - +
    Then - /^the session "(.+)" is (true|false|null|not null)$/ + 'the session payload has a valid sessions array'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22655,46 +22461,20 @@
    -
    lib/features/steps/session_tracking_steps.rb:52
    +
    lib/features/steps/session_tracking_steps.rb:103
    -

    Tests whether a value in the first session entry matches a literal.

    +

    Tests that a payload has an appropriately structured session array

    -

    Step parameters:

    -
      - -
    • - - - - - -

      field [String] The relative location of the value to test

      -
      - -
    • - -
    • - - - - - -

      literal [Enum] The literal to test against, one of: true, false, null, not null

      -
      - -
    • - -
    @@ -22705,13 +22485,33 @@
    -
    32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    +
    98
    +99
    +100
    -
    Then('the session is valid for the session reporting API version {string} for the React Native notifier') do |payload_version|
    -  steps %{
    -    Then the session "bugsnag-api-key" header equals "#{$api_key}"
    -    And the session "bugsnag-payload-version" header equals "#{payload_version}"
    -    And the session "Content-Type" header equals "application/json"
    -    And the session "Bugsnag-Sent-At" header is a timestamp
    -
    -    And the session payload field "notifier.name" matches the regex "(Bugsnag React Native|(Android|iOS) Bugsnag Notifier)"
    -    And the session payload field "notifier.url" is not null
    -    And the session payload field "notifier.version" is not null
    -
    -    And the session payload field "app" is not null
    -    And the session payload field "device" is not null
    -  }
    +            
    Then('the sessionCount {string} is a timestamp') do |field|
    +  step "the session payload field \"sessionCounts.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
     end
    @@ -22737,12 +22537,12 @@
    - +
    Then - 'the session {string} equals {string}' + 'the {request_type} request is valid multipart form-data'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22753,14 +22553,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:60
    +
    lib/features/steps/multipart_request_steps.rb:25
    -

    Tests whether a value in the first session entry matches a string.

    +

    Verifies that any type of request contains multipart form-data

    @@ -22776,18 +22576,7 @@ -

    field [String] The relative location of the value to test

    -
    - - - -
  • - - - - - -

    string_value [String] The string to match against

    +

    request_type [String] The type of request (error, session, build, etc)

  • @@ -22803,13 +22592,15 @@
    -
    52
    -53
    -54
    +
    103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    -
    Then(/^the session "(.+)" is (true|false|null|not null)$/) do |field, literal|
    -  step "the session payload field \"sessions.0.#{field}\" is #{literal}"
    +            
    Then('the session payload has a valid sessions array') do
    +  if sessions = Maze::Server.sessions.current[:body]['sessions']
    +    steps %(
    +      Then the session "id" is not null
    +      And the session "startedAt" is a timestamp
    +    )
    +  else
    +    steps %(
    +      Then the sessionCount "sessionsStarted" is not null
    +      And the sessionCount "startedAt" is a timestamp
    +    )
    +  end
     end
    @@ -22835,12 +22626,12 @@
    - +
    Then - 'the session {string} is a timestamp' + 'all {request_type} requests are valid multipart form-data'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22851,14 +22642,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:67
    +
    lib/features/steps/multipart_request_steps.rb:33
    -

    Tests whether a value in the first session entry is a timestamp.

    +

    Verifies all requests of a given type contain multipart form-data

    @@ -22874,7 +22665,7 @@ -

    field [String] The relative location of the value to test

    +

    request_type [String] The type of request (error, session, build, etc)

    @@ -22890,13 +22681,15 @@
    -
    60
    -61
    -62
    +
    25
    +26
    +27
    +28
    -
    Then('the session {string} equals {string}') do |field, string_value|
    -  step "the session payload field \"sessions.0.#{field}\" equals \"#{string_value}\""
    +            
    Then('the {request_type} request is valid multipart form-data') do |request_type|
    +  list = Maze::Server.list_for request_type
    +  valid_multipart_form_data?(list.current)
     end
    @@ -22922,12 +22715,12 @@
    - +
    Then - /^the sessionCount "(.+)" is (true|false|null|not null)$/ + 'the {request_type} multipart request has {int} fields'
    - Rubular + Rubular | UNUSED [Collapse] @@ -22938,14 +22731,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:75
    +
    lib/features/steps/multipart_request_steps.rb:42
    -

    Tests whether a value in the first sessionCount entry matches a literal.

    +

    Tests the number of fields a given type of multipart request contains.

    @@ -22961,7 +22754,7 @@ -

    field [String] The relative location of the value to test

    +

    request_type [String] The type of request (error, session, build, etc)

    @@ -22972,7 +22765,7 @@ -

    literal [Enum] The literal to test against, one of: true, false, null, not null

    +

    part_count [Integer] The number of expected fields

    @@ -22988,13 +22781,17 @@
    -
    67
    -68
    -69
    +
    33
    +34
    +35
    +36
    -
    Then('the session {string} is a timestamp') do |field|
    -  step "the session payload field \"sessions.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
    +            
    Then('all {request_type} requests are valid multipart form-data') do |request_type|
    +  list = Maze::Server.list_for request_type
    +  list.all.all? { |request| valid_multipart_form_data?(request) }
     end
    @@ -23020,12 +22817,12 @@
    - +
    Then - 'the sessionCount {string} equals {string}' + 'the {request_type} multipart request has a non-empty body'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23036,14 +22833,14 @@
    -
    lib/features/steps/session_tracking_steps.rb:83
    +
    lib/features/steps/multipart_request_steps.rb:51
    -

    Tests whether a value in the first sessionCount entry matches a string.

    +

    Tests a given type of multipart request has at least one field.

    @@ -23059,18 +22856,7 @@ -

    field [String] The relative location of the value to test

    -
    - - - -
  • - - - - - -

    string_value [String] The string to match against

    +

    request_type [String] The type of request (error, session, build, etc)

  • @@ -23086,13 +22872,17 @@
    -
    75
    -76
    -77
    +
    42
    +43
    +44
    +45
    +46
    -
    Then(/^the sessionCount "(.+)" is (true|false|null|not null)$/) do |field, literal|
    -  step "the session payload field \"sessionCounts.0.#{field}\" is #{literal}"
    +            
    Then('the {request_type} multipart request has {int} fields') do |request_type, part_count|
    +  list = Maze::Server.list_for request_type
    +  parts = list.current[:body]
    +  Maze.check.equal(part_count, parts.size)
     end
    @@ -23118,12 +22908,12 @@
    - +
    Then - 'the sessionCount {string} equals {int}' + 'the {request_type} multipart body does not match the JSON file in {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23134,14 +22924,15 @@
    -
    lib/features/steps/session_tracking_steps.rb:91
    +
    lib/features/steps/multipart_request_steps.rb:76
    -

    Tests whether a value in the first sessionCount entry equals an integer.

    +

    Tests that a given type of multipart payload body does not match a JSON file. +JSON formatted multipart fields will be parsed into hashes.

    @@ -23157,7 +22948,7 @@ -

    field [String] The relative location of the value to test

    +

    request_type [String] The type of request (error, session, build, etc)

    @@ -23168,7 +22959,7 @@ -

    int_value [Integer] The integer to test against

    +

    json_path [String] Path to a JSON file relative to maze-runner root

    @@ -23184,13 +22975,25 @@
    -
    83
    -84
    -85
    +
    51
    +52
    +53
    +54
    +55
    -
    Then('the sessionCount {string} equals {string}') do |field, string_value|
    -  step "the session payload field \"sessionCounts.0.#{field}\" equals \"#{string_value}\""
    +            
    Then('the {request_type} multipart request has a non-empty body') do |request_type|
    +  list = Maze::Server.list_for request_type
    +  parts = list.current[:body]
    +  Maze.check.true(parts.size.positive?, "Multipart request payload contained #{parts.size} fields")
     end
    @@ -23216,12 +23019,12 @@
    - +
    Then - 'the sessionCount {string} is a timestamp' + 'the {request_type} multipart body matches the JSON file in {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23232,14 +23035,15 @@
    -
    lib/features/steps/session_tracking_steps.rb:98
    +
    lib/features/steps/multipart_request_steps.rb:91
    -

    Tests whether a value in the first sessionCount entry is a timestamp.

    +

    Tests that a given type of multipart payload body matches a JSON fixture. +JSON formatted multipart fields will be parsed into hashes.

    @@ -23255,14 +23059,25 @@ -

    field [String] The relative location of the value to test

    +

    request_type [String] The type of request (error, session, build, etc)

    - - -
    +
  • + + + + + +

    json_path [String] Path to a JSON file relative to maze-runner root

    +
    + +
  • + + + +
    @@ -23271,13 +23086,25 @@
    -
    91
    -92
    -93
    +
    76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    -
    Then('the sessionCount {string} equals {int}') do |field, int_value|
    -  step "the session payload field \"sessionCounts.0.#{field}\" equals #{int_value}"
    +            
    Then('the {request_type} multipart body does not match the JSON file in {string}') do |request_type, json_path|
    +  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
    +  payload_list = Maze::Server.list_for request_type
    +  raw_payload_value = payload_list.current[:body]
    +  payload_value = parse_multipart_body(raw_payload_value)
    +  expected_value = JSON.parse(File.open(json_path, &:read))
    +  result = Maze::Compare.value(expected_value, payload_value)
    +  Maze.check.false(result.equal?, "Payload:\n#{payload_value}\nExpected:#{expected_value}")
     end
    @@ -23303,12 +23130,12 @@
    - +
    Then - 'the session payload has a valid sessions array' + 'the {request_type} multipart field {string} matches the JSON file in {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23319,20 +23146,58 @@
    -
    lib/features/steps/session_tracking_steps.rb:103
    +
    lib/features/steps/multipart_request_steps.rb:107
    -

    Tests that a payload has an appropriately structured session array

    +

    Tests that a given type of multipart field matches a JSON fixture. +The field will be parsed into a hash.

    +

    Step parameters:

    +
      + +
    • + + + + + +

      request_type [String] The type of request (error, session, build, etc)

      +
      + +
    • + +
    • + + + + + +

      field_path [String] Path to the tested element

      +
      + +
    • + +
    • + + + + + +

      json_path [String] Path to a JSON file relative to maze-runner root

      +
      + +
    • + +
    @@ -23343,33 +23208,23 @@
    -
    98
    -99
    -100
    +
    91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    -
    Then('the sessionCount {string} is a timestamp') do |field|
    -  step "the session payload field \"sessionCounts.0.#{field}\" matches the regex \"#{TIMESTAMP_REGEX}\""
    +            
    Then('the {request_type} multipart body matches the JSON file in {string}') do |request_type, json_path|
    +  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
    +  payload_list = Maze::Server.list_for request_type
    +  raw_payload_value = payload_list.current[:body]
    +  payload_value = parse_multipart_body(raw_payload_value)
    +  expected_value = JSON.parse(File.open(json_path, &:read))
    +  result = Maze::Compare.value(expected_value, payload_value)
    +  Maze.check.true(result.equal?, "The payload field '#{result.keypath}' does not match the fixture:\n #{result.reasons.join('\n')}")
     end
    @@ -23395,12 +23250,12 @@
    - +
    Then - 'the {request_type} request is valid multipart form-data' + 'the field {string} for multipart {request_type} is not null'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23411,14 +23266,14 @@
    -
    lib/features/steps/multipart_request_steps.rb:25
    +
    lib/features/steps/multipart_request_steps.rb:120
    -

    Verifies that any type of request contains multipart form-data

    +

    Tests that a multipart request field exists and is not null.

    @@ -23439,6 +23294,17 @@ +
  • + + + + + +

    part_key [String] The key to the multipart element

    +
    + +
  • +
    @@ -23450,15 +23316,15 @@
    -
    103
    -104
    -105
    -106
    -107
    +            
    107
     108
     109
     110
     111
     112
     113
    -114
    -115
    +114
    -
    Then('the session payload has a valid sessions array') do
    -  if sessions = Maze::Server.sessions.current[:body]['sessions']
    -    steps %(
    -      Then the session "id" is not null
    -      And the session "startedAt" is a timestamp
    -    )
    -  else
    -    steps %(
    -      Then the sessionCount "sessionsStarted" is not null
    -      And the sessionCount "startedAt" is a timestamp
    -    )
    -  end
    +            
    Then('the {request_type} multipart field {string} matches the JSON file in {string}') do |request_type, field_path, json_path|
    +  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
    +  payload_list = Maze::Server.list_for request_type
    +  payload_value = JSON.parse(payload_list.current[:body][field_path].to_s)
    +  expected_value = JSON.parse(File.open(json_path, &:read))
    +  result = Maze::Compare.value(expected_value, payload_value)
    +  Maze.check.true(result.equal?, "The multipart field '#{result.keypath}' does not match the fixture:\n #{result.reasons.join('\n')}")
     end
    @@ -23484,12 +23350,12 @@
    - +
    Then - 'all {request_type} requests are valid multipart form-data' + 'the field {string} for multipart {request_type} is null'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23500,14 +23366,14 @@
    -
    lib/features/steps/multipart_request_steps.rb:33
    +
    lib/features/steps/multipart_request_steps.rb:129
    -

    Verifies all requests of a given type contain multipart form-data

    +

    Tests that a multipart request field exists and is null.

    @@ -23523,6 +23389,17 @@ +

    part_key [String] The key to the multipart element

    +
    + + + +
  • + + + + +

    request_type [String] The type of request (error, session, build, etc)

    @@ -23539,15 +23416,15 @@
  • -
    25
    -26
    -27
    -28
    +
    120
    +121
    +122
    +123
    -
    Then('the {request_type} request is valid multipart form-data') do |request_type|
    -  list = Maze::Server.list_for request_type
    -  valid_multipart_form_data?(list.current)
    +            
    Then('the field {string} for multipart {request_type} is not null') do |part_key, request_type|
    +  parts = Maze::Server.list_for(request_type).current[:body]
    +  Maze.check.not_nil(parts[part_key], "The field '#{part_key}' should not be null")
     end
    @@ -23573,12 +23450,12 @@
    - +
    Then - 'the {request_type} multipart request has {int} fields' + 'the field {string} for multipart {request_type} equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23589,14 +23466,14 @@
    -
    lib/features/steps/multipart_request_steps.rb:42
    +
    lib/features/steps/multipart_request_steps.rb:139
    -

    Tests the number of fields a given type of multipart request contains.

    +

    Tests that a multipart request field equals a string.

    @@ -23612,6 +23489,17 @@ +

    part_key [String] The key to the multipart element

    +
    + + + +
  • + + + + +

    request_type [String] The type of request (error, session, build, etc)

    @@ -23623,7 +23511,7 @@ -

    part_count [Integer] The number of expected fields

    +

    expected_value [String] The string to match against

  • @@ -23639,17 +23527,15 @@
    -
    33
    -34
    -35
    -36
    +
    129
    +130
    +131
    +132
    -
    Then('all {request_type} requests are valid multipart form-data') do |request_type|
    -  list = Maze::Server.list_for request_type
    -  list.all.all? { |request| valid_multipart_form_data?(request) }
    +            
    Then('the field {string} for multipart {request_type} is null') do |part_key, request_type|
    +  parts = Maze::Server.list_for(request_type).current[:body]
    +  Maze.check.nil(parts[part_key], "The field '#{part_key}' should be null")
     end
    @@ -23675,12 +23561,12 @@
    - +
    Then - 'the {request_type} multipart request has a non-empty body' + 'I wait to receive a(n) {request_type}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23691,14 +23577,16 @@
    -
    lib/features/steps/multipart_request_steps.rb:51
    +
    lib/features/steps/request_assertion_steps.rb:58
    -

    Tests a given type of multipart request has at least one field.

    +

    Request assertions

    + +

    Shortcut to waiting to receive a single request of the given type

    @@ -23730,17 +23618,13 @@
    -
    42
    -43
    -44
    -45
    -46
    +
    139
    +140
    +141
    +142
    -
    Then('the {request_type} multipart request has {int} fields') do |request_type, part_count|
    -  list = Maze::Server.list_for request_type
    -  parts = list.current[:body]
    -  Maze.check.equal(part_count, parts.size)
    +            
    Then('the field {string} for multipart {request_type} equals {string}') do |part_key, request_type, expected_value|
    +  parts = Maze::Server.list_for(request_type).current[:body]
    +  Maze.check.equal(parts[part_key], expected_value)
     end
    @@ -23766,12 +23650,12 @@
    - +
    Then - 'the {request_type} multipart body does not match the JSON file in {string}' + 'I wait to receive {int} {request_type}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23782,15 +23666,17 @@
    -
    lib/features/steps/multipart_request_steps.rb:76
    +
    lib/features/steps/request_assertion_steps.rb:69
    -

    Tests that a given type of multipart payload body does not match a JSON file. -JSON formatted multipart fields will be parsed into hashes.

    +

    Continually checks to see if the required amount of requests have been received, +timing out according to @see Maze.config.receive_requests_wait. +If all expected requests are received and have the Bugsnag-Sent-At header, they +will be sorted by the header.

    @@ -23817,7 +23703,7 @@ -

    json_path [String] Path to a JSON file relative to maze-runner root

    +

    request_count [Integer] The amount of requests expected

    @@ -23833,25 +23719,17 @@
    -
    51
    -52
    -53
    -54
    -55
    +
    58
    +59
    +60
    -
    Then('the {request_type} multipart request has a non-empty body') do |request_type|
    -  list = Maze::Server.list_for request_type
    -  parts = list.current[:body]
    -  Maze.check.true(parts.size.positive?, "Multipart request payload contained #{parts.size} fields")
    +            
    Then('I wait to receive a(n) {request_type}') do |request_type|
    +  step "I wait to receive 1 #{request_type}"
     end
    @@ -23877,12 +23755,12 @@
    - +
    Then - 'the {request_type} multipart body matches the JSON file in {string}' + 'I wait to receive at least {int} {request_type}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -23893,15 +23771,17 @@
    -
    lib/features/steps/multipart_request_steps.rb:91
    +
    lib/features/steps/request_assertion_steps.rb:82
    -

    Tests that a given type of multipart payload body matches a JSON fixture. -JSON formatted multipart fields will be parsed into hashes.

    +

    Continually checks to see if at least the number requests given has been received, +timing out according to @see Maze.config.receive_requests_wait.

    + +

    This step can tolerate receiving more than the expected number of requests.

    @@ -23928,7 +23808,7 @@ -

    json_path [String] Path to a JSON file relative to maze-runner root

    +

    request_count [Integer] The amount of requests expected

    @@ -23944,25 +23824,15 @@
    -
    76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    +
    69
    +70
    +71
    +72
    +73
    -
    Then('the {request_type} multipart body does not match the JSON file in {string}') do |request_type, json_path|
    -  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
    -  payload_list = Maze::Server.list_for request_type
    -  raw_payload_value = payload_list.current[:body]
    -  payload_value = parse_multipart_body(raw_payload_value)
    -  expected_value = JSON.parse(File.open(json_path, &:read))
    -  result = Maze::Compare.value(expected_value, payload_value)
    -  Maze.check.false(result.equal?, "Payload:\n#{payload_value}\nExpected:#{expected_value}")
    +            
    Then('I wait to receive {int} {request_type}') do |request_count, request_type|
    +  list = Maze::Server.list_for(request_type)
    +  assert_received_requests request_count, list, request_type
    +  list.sort_by_sent_at! request_count
     end
    @@ -23988,12 +23858,12 @@
    - +
    Then - 'the {request_type} multipart field {string} matches the JSON file in {string}' + 'I sort the {request_type} by the payload field {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24004,15 +23874,14 @@
    -
    lib/features/steps/multipart_request_steps.rb:107
    +
    lib/features/steps/request_assertion_steps.rb:91
    -

    Tests that a given type of multipart field matches a JSON fixture. -The field will be parsed into a hash.

    +

    Sorts the remaining requests in a list by the field path given.

    @@ -24039,7 +23908,97 @@ -

    field_path [String] Path to the tested element

    +

    field_path [String] The field to sort by

    +
    + + + + + +
    +
    + + + +
    +
    -
    91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    +
    82
    +83
    +84
    +85
    -
    Then('the {request_type} multipart body matches the JSON file in {string}') do |request_type, json_path|
    -  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
    -  payload_list = Maze::Server.list_for request_type
    -  raw_payload_value = payload_list.current[:body]
    -  payload_value = parse_multipart_body(raw_payload_value)
    -  expected_value = JSON.parse(File.open(json_path, &:read))
    -  result = Maze::Compare.value(expected_value, payload_value)
    -  Maze.check.true(result.equal?, "The payload field '#{result.keypath}' does not match the fixture:\n #{result.reasons.join('\n')}")
    +            
    Then('I wait to receive at least {int} {request_type}') do |request_count, request_type|
    +  list = Maze::Server.list_for(request_type)
    +  assert_received_requests request_count, list, request_type, false
     end
    + + + + +
    +
    91
    +92
    +93
    +94
    +
    +
    Then('I sort the {request_type} by the payload field {string}') do |request_type, field_path|
    +  list = Maze::Server.list_for(request_type)
    +  list.sort_by! field_path
    +end
    +
    +
    + + + +
    + +
    No steps were found to match this step definition.
    + +
    + +
    + +
    + + + + + +
    + +
    + Then + 'I have received at least {int} {request_type}' +
    + Rubular + + | UNUSED + [Collapse] +
    +
    +
    + +
    + +
    +
    lib/features/steps/request_assertion_steps.rb:101
    +
    + + +
    +
    +
    +

    Verify that at least a certain amount of requests have been received +This step is only intended for use in stress tests

    + + +
    +
    +
    + +

    Step parameters:

    +
      + +
    • + + + + + +

      min_received [Integer] The minimum amount of requests required to pass

    • @@ -24050,7 +24009,7 @@ -

      json_path [String] Path to a JSON file relative to maze-runner root

      +

      request_type [String] The type of request (error, session, build, etc)

      @@ -24066,23 +24025,400 @@ + +
      -
      107
      -108
      -109
      -110
      -111
      -112
      -113
      -114
      +
      101
      +102
      +103
      +104
      -
      Then('the {request_type} multipart field {string} matches the JSON file in {string}') do |request_type, field_path, json_path|
      -  Maze.check.true(File.exist?(json_path), "'#{json_path}' does not exist")
      -  payload_list = Maze::Server.list_for request_type
      -  payload_value = JSON.parse(payload_list.current[:body][field_path].to_s)
      -  expected_value = JSON.parse(File.open(json_path, &:read))
      -  result = Maze::Compare.value(expected_value, payload_value)
      -  Maze.check.true(result.equal?, "The multipart field '#{result.keypath}' does not match the fixture:\n #{result.reasons.join('\n')}")
      +            
      Then('I have received at least {int} {request_type}') do |min_received, request_type|
      +  list = Maze::Server.list_for(request_type)
      +  Maze.check.operator(list.size_remaining, :>=, min_received, "Actually received #{list.size_remaining} #{request_type} requests")
      +end
      +
      +
      + + + +
      + +
      No steps were found to match this step definition.
      + +
      + +
    + +
    + +
    + + + +
    + +
    + Then + 'I wait to receive between {int} and {int} {request_type}' +
    + Rubular + + | UNUSED + [Collapse] +
    +
    +
    + +
    + +
    +
    lib/features/steps/request_assertion_steps.rb:111
    +
    + + +
    +
    +
    +

    Verify that an amount of requests within a range have been received

    + + +
    +
    +
    + +

    Step parameters:

    +
      + +
    • + + + + + +

      min_received [Integer] The minimum amount of requests required to pass

      +
      + +
    • + +
    • + + + + + +

      max_received [Integer] The maximum amount of requests before failure

      +
      + +
    • + +
    • + + + + + +

      request_type [String] The type of request (error, session, build, etc)

      +
      + +
    • + +
    + +
    +
    + + + +
    + + + + + +
    +
    111
    +112
    +113
    +114
    +
    +
    Then('I wait to receive between {int} and {int} {request_type}') do |min_received, max_received, request_type|
    +  list = Maze::Server.list_for(request_type)
    +  assert_received_requests min_received, list, request_type, false, max_received
    +end
    +
    +
    + + + +
    + +
    No steps were found to match this step definition.
    + +
    + +
    + +
    + +
    + + + +
    + +
    + Then + 'I should receive no {request_type}' +
    + Rubular + + | UNUSED + [Collapse] +
    +
    +
    + +
    + +
    +
    lib/features/steps/request_assertion_steps.rb:119
    +
    + + +
    +
    +
    +

    Assert that the test Server hasn't received any requests - of a specific, or any, type.

    + + +
    +
    +
    + +

    Step parameters:

    +
      + +
    • + + + + + +

      request_type [String] The type of request ('error', 'session', 'trace', sampling request', etc)

      +
      + +
    • + +
    + +
    +
    + + + +
    + + + + + +
    +
    119
    +120
    +121
    +122
    +123
    +
    +
    Then('I should receive no {request_type}') do |request_type|
    +  sleep Maze.config.receive_no_requests_wait
    +  list = Maze::Server.list_for(request_type)
    +  Maze.check.equal(0, list.size_remaining, "#{list.size_remaining} #{request_type} received")
    +end
    +
    +
    + + + +
    + +
    No steps were found to match this step definition.
    + +
    + +
    + +
    + +
    + + + +
    + +
    + Then + 'I discard the oldest {request_type}' +
    + Rubular + + | UNUSED + [Collapse] +
    +
    +
    + +
    + +
    +
    lib/features/steps/request_assertion_steps.rb:128
    +
    + + +
    +
    +
    +

    Moves to the next request

    + + +
    +
    +
    + +

    Step parameters:

    +
      + +
    • + + + + + +

      request_type [String] The type of request (error, session, build, etc)

      +
      + +
    • + +
    + +
    +
    + + + +
    + + + + + +
    +
    128
    +129
    +130
    +131
    +132
    +
    +
    Then('I discard the oldest {request_type}') do |request_type|
    +  raise "No #{request_type} to discard" if Maze::Server.list_for(request_type).current.nil?
    +
    +  Maze::Server.list_for(request_type).next
    +end
    +
    +
    + + + +
    + +
    No steps were found to match this step definition.
    + +
    + +
    + +
    + +
    + + + +
    + +
    + Then + 'the received errors match:' +
    + Rubular + + | UNUSED + [Collapse] +
    +
    +
    + +
    + +
    +
    lib/features/steps/request_assertion_steps.rb:134
    +
    + + +
    + +
    + + + +
    + + + + @@ -24108,12 +24444,12 @@
    - +
    Then - 'the field {string} for multipart {request_type} is not null' + 'the {request_type} request method equals {string}'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24124,14 +24460,15 @@
    -
    lib/features/steps/multipart_request_steps.rb:120
    +
    lib/features/steps/request_assertion_steps.rb:158
    -

    Tests that a multipart request field exists and is not null.

    +

    Verifies that a request was sent via a given method. +Currently only supported with the reflective servlet.

    @@ -24158,7 +24495,7 @@ -

    part_key [String] The key to the multipart element

    +

    method [String] The request method expected (GET, POST, etc)

    @@ -24174,15 +24511,23 @@
    +
    134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +
    +
    Then('the received errors match:') do |table|
    +  # Checks that each request matches one of the event fields
    +  requests = Maze::Server.errors.remaining
    +  match_count = 0
    +
    +  # iterate through each row in the table. exactly 1 request should match each row.
    +  table.hashes.each do |row|
    +    requests.each do |request|
    +      # Skip if no body.events in this request
    +      next if (!request.key? :body) || (!request[:body].key? 'events')
    +
    +      events = request[:body]['events']
    +      Maze.check.equal(1, events.length, 'Expected exactly one event per request')
    +      match_count += 1 if Maze::Assertions::RequestSetAssertions.request_matches_row(events[0], row)
    +    end
    +  end
    +  Maze.check.equal(requests.size, match_count, 'Unexpected number of requests matched the received payloads')
     end
    @@ -24208,12 +24553,12 @@
    - +
    Then - 'the field {string} for multipart {request_type} is null' + 'the {request_type} payload field {string} equals the platform-dependent string:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24224,14 +24569,24 @@
    -
    lib/features/steps/multipart_request_steps.rb:129
    +
    lib/features/steps/platform_dependent_steps.rb:18
    -

    Tests that a multipart request field exists and is null.

    +

    Tests that the given payload value is correct for the target BrowserStack platform. +This step will assume the expected and payload values are strings. +If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    + +

    The DataTable used for this step should have ios and android in the same row as their expected value: + | android | Java.lang.RuntimeException | + | ios | NSException |

    + +

    If the expected value is set to "@skip", the check should be skipped +If the expected value is set to "@null", the check will be for null +If the expected value is set to "@not_null", the check will be for a non-null value

    @@ -24247,7 +24602,7 @@ -

    part_key [String] The key to the multipart element

    +

    request_type [String] The type of request (error, session, build, etc)

    @@ -24258,7 +24613,18 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test

    +
    + + + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable values for each platform

  • @@ -24274,15 +24640,13 @@
    -
    120
    -121
    -122
    -123
    +
    158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    -
    Then('the field {string} for multipart {request_type} is not null') do |part_key, request_type|
    -  parts = Maze::Server.list_for(request_type).current[:body]
    -  Maze.check.not_nil(parts[part_key], "The field '#{part_key}' should not be null")
    +            
    Then('the {request_type} request method equals {string}') do |request_type, method|
    +  list = Maze::Server.list_for(request_type)
    +  payload = list.current
    +  if payload[:method].nil?
    +    raise Test::Unit::AssertionFailedError.new("#{request_type} request had no receipt method listed")
    +  end
    +  Maze.check.equal(method, payload[:method], "Expected #{request_type} request method to be #{method}")
     end
    @@ -24308,12 +24672,12 @@
    - +
    Then - 'the field {string} for multipart {request_type} equals {string}' + 'the event {string} equals the platform-dependent string:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24324,14 +24688,14 @@
    -
    lib/features/steps/multipart_request_steps.rb:139
    +
    lib/features/steps/platform_dependent_steps.rb:26
    -

    Tests that a multipart request field equals a string.

    +

    See the error payload field {string} equals the platform-dependent string:

    @@ -24347,18 +24711,7 @@ -

    part_key [String] The key to the multipart element

    -
    - - - -
  • - - - - - -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test, prepended with "events.0"

  • @@ -24369,7 +24722,7 @@ -

    expected_value [String] The string to match against

    +

    platform_values [DataTable] A table of acceptable values for each platform

    @@ -24385,15 +24738,13 @@
    -
    129
    -130
    -131
    -132
    +
    18
    +19
    +20
    -
    Then('the field {string} for multipart {request_type} is null') do |part_key, request_type|
    -  parts = Maze::Server.list_for(request_type).current[:body]
    -  Maze.check.nil(parts[part_key], "The field '#{part_key}' should be null")
    +            
    Then('the {request_type} payload field {string} equals the platform-dependent string:') do |request_type, field_path, platform_values|
    +  test_string_platform_values(request_type, field_path, platform_values)
     end
    @@ -24419,12 +24770,12 @@
    - +
    Then - 'I wait to receive a(n) {request_type}' + 'the {request_type} payload field {string} equals the platform-dependent numeric:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24435,16 +24786,24 @@
    -
    lib/features/steps/request_assertion_steps.rb:58
    +
    lib/features/steps/platform_dependent_steps.rb:45
    -

    Request assertions

    +

    Tests that the given payload value is correct for the target BrowserStack platform. +This step will assume the expected and payload values are numeric. +If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    -

    Shortcut to waiting to receive a single request of the given type

    +

    The DataTable used for this step should have ios and android in the same row as their expected value: + | android | 1 | + | ios | 5.5 |

    + +

    If the expected value is set to "@skip", the check should be skipped +If the expected value is set to "@null", the check will be for null +If the expected value is set to "@not_null", the check will be for a non-null value

    @@ -24465,6 +24824,28 @@ +
  • + + + + + +

    field_path [String] The field to test

    +
    + +
  • + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable values for each platform

    +
    + +
  • +
    @@ -24476,13 +24857,13 @@
    -
    139
    -140
    -141
    -142
    +
    26
    +27
    +28
    -
    Then('the field {string} for multipart {request_type} equals {string}') do |part_key, request_type, expected_value|
    -  parts = Maze::Server.list_for(request_type).current[:body]
    -  Maze.check.equal(parts[part_key], expected_value)
    +            
    Then('the event {string} equals the platform-dependent string:') do |field_path, platform_values|
    +  test_string_platform_values('error', "events.0.#{field_path}", platform_values)
     end
    @@ -24508,12 +24889,12 @@
    - +
    Then - 'I wait to receive {int} {request_type}' + 'the event {string} equals the platform-dependent numeric:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24524,17 +24905,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:69
    +
    lib/features/steps/platform_dependent_steps.rb:53
    -

    Continually checks to see if the required amount of requests have been received, -timing out according to @see Maze.config.receive_requests_wait. -If all expected requests are received and have the Bugsnag-Sent-At header, they -will be sorted by the header.

    +

    See the payload field {string} equals the platform-dependent numeric:

    @@ -24550,7 +24928,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test, prepended with "events.0"

    @@ -24561,7 +24939,7 @@ -

    request_count [Integer] The amount of requests expected

    +

    platform_values [DataTable] A table of acceptable values for each platform

    @@ -24577,17 +24955,13 @@
    -
    58
    -59
    -60
    +
    45
    +46
    +47
    -
    Then('I wait to receive a(n) {request_type}') do |request_type|
    -  step "I wait to receive 1 #{request_type}"
    +            
    Then('the {request_type} payload field {string} equals the platform-dependent numeric:') do |request_type, field_path, platform_values|
    +  test_numeric_platform_values(request_type, field_path, platform_values)
     end
    @@ -24613,12 +24987,12 @@
    - +
    Then - 'I wait to receive at least {int} {request_type}' + 'the {request_type} payload field {string} equals the platform-dependent boolean:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24629,17 +25003,24 @@
    -
    lib/features/steps/request_assertion_steps.rb:82
    +
    lib/features/steps/platform_dependent_steps.rb:72
    -

    Continually checks to see if at least the number requests given has been received, -timing out according to @see Maze.config.receive_requests_wait.

    +

    Tests that the given payload value is correct for the target BrowserStack platform. +This step will assume the expected and payload values are booleans. +If the step is invoked when a remote BrowserStack device is not in use this step will fail.

    -

    This step can tolerate receiving more than the expected number of requests.

    +

    The DataTable used for this step should have ios and android in the same row as their expected value: + | android | 1 | + | ios | 5 |

    + +

    If the expected value is set to "@skip", the check should be skipped +If the expected value is set to "@null", the check will be for null +If the expected value is set to "@not_null", the check will be for a non-null value

    @@ -24666,7 +25047,18 @@ -

    request_count [Integer] The amount of requests expected

    +

    field_path [String] The field to test

    +
    + + + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable values for each platform

  • @@ -24682,15 +25074,13 @@
    -
    69
    -70
    -71
    -72
    -73
    +
    53
    +54
    +55
    -
    Then('I wait to receive {int} {request_type}') do |request_count, request_type|
    -  list = Maze::Server.list_for(request_type)
    -  assert_received_requests request_count, list, request_type
    -  list.sort_by_sent_at! request_count
    +            
    Then('the event {string} equals the platform-dependent numeric:') do |field_path, platform_values|
    +  test_numeric_platform_values('error', "events.0.#{field_path}", platform_values)
     end
    @@ -24716,12 +25106,12 @@
    - +
    Then - 'I sort the {request_type} by the payload field {string}' + 'the event {string} equals the platform-dependent boolean:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24732,14 +25122,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:91
    +
    lib/features/steps/platform_dependent_steps.rb:80
    -

    Sorts the remaining requests in a list by the field path given.

    +

    See the payload field {string} equals the platform-dependent boolean:

    @@ -24755,7 +25145,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test, prepended with "events.0"

    @@ -24766,7 +25156,7 @@ -

    field_path [String] The field to sort by

    +

    platform_values [DataTable] A table of acceptable values for each platform

    @@ -24782,15 +25172,13 @@
    -
    82
    -83
    -84
    -85
    +
    72
    +73
    +74
    -
    Then('I wait to receive at least {int} {request_type}') do |request_count, request_type|
    -  list = Maze::Server.list_for(request_type)
    -  assert_received_requests request_count, list, request_type, false
    +            
    Then('the {request_type} payload field {string} equals the platform-dependent boolean:') do |request_type, field_path, platform_values|
    +  test_boolean_platform_values(request_type, field_path, platform_values)
     end
    @@ -24816,12 +25204,12 @@
    - +
    Then - 'I have received at least {int} {request_type}' + 'the exception {string} equals the platform-dependent string:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24832,15 +25220,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:101
    +
    lib/features/steps/platform_dependent_steps.rb:88
    -

    Verify that at least a certain amount of requests have been received -This step is only intended for use in stress tests

    +

    See the payload field {string} equals the platform-dependent string:

    @@ -24856,7 +25243,7 @@ -

    min_received [Integer] The minimum amount of requests required to pass

    +

    field_path [String] The field to test, prepended with "events.0.exceptions.0."

    @@ -24867,7 +25254,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    platform_values [DataTable] A table of acceptable values for each platform

    @@ -24883,15 +25270,13 @@
    -
    91
    -92
    -93
    -94
    +
    80
    +81
    +82
    -
    Then('I sort the {request_type} by the payload field {string}') do |request_type, field_path|
    -  list = Maze::Server.list_for(request_type)
    -  list.sort_by! field_path
    +            
    Then('the event {string} equals the platform-dependent boolean:') do |field_path, platform_values|
    +  test_boolean_platform_values('error', "events.0.#{field_path}", platform_values)
     end
    @@ -24917,12 +25302,12 @@
    - +
    Then - 'I wait to receive between {int} and {int} {request_type}' + 'the {string} of stack frame {int} equals the platform-dependent string:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -24933,14 +25318,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:111
    +
    lib/features/steps/platform_dependent_steps.rb:97
    -

    Verify that an amount of requests within a range have been received

    +

    See the payload field {string} equals the platform-dependent string:

    @@ -24956,7 +25341,7 @@ -

    min_received [Integer] The minimum amount of requests required to pass

    +

    field_path [String] The field to test, prepended with "events.0.exceptions.0.stacktrace.#{num}"

    @@ -24967,7 +25352,7 @@ -

    max_received [Integer] The maximum amount of requests before failure

    +

    num [Integer] The index of the stack frame to test

    @@ -24978,7 +25363,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    platform_values [DataTable] A table of acceptable values for each platform

    @@ -24994,15 +25379,13 @@
    -
    101
    -102
    -103
    -104
    +
    88
    +89
    +90
    -
    Then('I have received at least {int} {request_type}') do |min_received, request_type|
    -  list = Maze::Server.list_for(request_type)
    -  Maze.check.operator(list.size_remaining, :>=, min_received, "Actually received #{list.size_remaining} #{request_type} requests")
    +            
    Then('the exception {string} equals the platform-dependent string:') do |field_path, platform_values|
    +  test_string_platform_values('error', "events.0.exceptions.0.#{field_path}", platform_values)
     end
    @@ -25028,12 +25411,12 @@
    - +
    Then - 'I should receive no {request_type}' + 'the {request_type} payload field {string} matches the platform-dependent regex:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -25044,15 +25427,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:119
    +
    lib/features/steps/platform_dependent_steps.rb:169
    -

    Assert that the test Server hasn't received any requests - of a specific, or any, type.

    - +
    @@ -25067,7 +25449,29 @@ -

    request_type [String] The type of request ('error', 'session', 'trace', sampling request', etc)

    +

    request_type [String] The type of request (error, session, build, etc)

    +
    + + + +
  • + + + + + +

    field_path [String] The field to test

    +
    + +
  • + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable regexes for each platform

  • @@ -25083,17 +25487,13 @@
    -
    111
    -112
    -113
    -114
    +
    97
    +98
    +99
    -
    Then('I wait to receive between {int} and {int} {request_type}') do |min_received, max_received, request_type|
    -  list = Maze::Server.list_for(request_type)
    -  assert_received_requests min_received, list, request_type, false, max_received
    +            
    Then('the {string} of stack frame {int} equals the platform-dependent string:') do |field_path, num, platform_values|
    +  test_string_platform_values('error', "events.0.exceptions.0.stacktrace.#{num}.#{field_path}", platform_values)
     end
    @@ -25119,12 +25519,12 @@
    - +
    Then - 'I discard the oldest {request_type}' + 'the event {string} matches the platform-dependent regex:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -25135,14 +25535,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:128
    +
    lib/features/steps/platform_dependent_steps.rb:177
    -

    Moves to the next request

    +

    See the error payload field {string} equals the platform-dependent string:

    @@ -25158,7 +25558,18 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test, prepended with "events.0"

    +
    + + + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable values for each platform

  • @@ -25174,17 +25585,13 @@
    -
    119
    -120
    -121
    -122
    -123
    +
    169
    +170
    +171
    -
    Then('I should receive no {request_type}') do |request_type|
    -  sleep Maze.config.receive_no_requests_wait
    -  list = Maze::Server.list_for(request_type)
    -  Maze.check.equal(0, list.size_remaining, "#{list.size_remaining} #{request_type} received")
    +            
    Then('the {request_type} payload field {string} matches the platform-dependent regex:') do |request_type, field_path, platform_regexes|
    +  match_string_platform_regexes(request_type, field_path, platform_regexes)
     end
    @@ -25210,12 +25617,12 @@
    - +
    Then - 'the received errors match:' + 'the exception {string} matches the platform-dependent regex:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -25226,12 +25633,47 @@
    -
    lib/features/steps/request_assertion_steps.rb:134
    +
    lib/features/steps/platform_dependent_steps.rb:183
    +
    +
    + + +
    +
    +
    + +

    Step parameters:

    +
      + +
    • + + + + +

      field_path [String] The field to test, prepended with "events.0.exceptions.0."

      +
      + +
    • + +
    • + + + + + +

      platform_values [DataTable] A table of acceptable regexes for each platform

      +
      + +
    • + +
    + +
    @@ -25240,43 +25682,13 @@
    -
    128
    -129
    -130
    -131
    -132
    +
    177
    +178
    +179
    -
    Then('I discard the oldest {request_type}') do |request_type|
    -  raise "No #{request_type} to discard" if Maze::Server.list_for(request_type).current.nil?
    -
    -  Maze::Server.list_for(request_type).next
    +            
    Then('the event {string} matches the platform-dependent regex:') do |field_path, platform_regexes|
    +  match_string_platform_regexes('error', "events.0.#{field_path}", platform_regexes)
     end
    @@ -25302,12 +25714,12 @@
    - +
    Then - 'the {request_type} request method equals {string}' + 'the {string} of stack frame {int} matches the platform-dependent regex:'
    - Rubular + Rubular | UNUSED [Collapse] @@ -25318,16 +25730,14 @@
    -
    lib/features/steps/request_assertion_steps.rb:158
    +
    lib/features/steps/platform_dependent_steps.rb:190
    -

    Verifies that a request was sent via a given method. -Currently only supported with the reflective servlet.

    - +
    @@ -25342,7 +25752,7 @@ -

    request_type [String] The type of request (error, session, build, etc)

    +

    field_path [String] The field to test, prepended with "events.0.exceptions.0.stacktrace.#{num}"

    @@ -25353,7 +25763,18 @@ -

    method [String] The request method expected (GET, POST, etc)

    +

    num [Integer] The index of the stack frame to test

    +
    + + + +
  • + + + + + +

    platform_values [DataTable] A table of acceptable values for each platform

  • @@ -25369,23 +25790,13 @@
    -
    134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    +
    183
    +184
    +185
    -
    Then('the received errors match:') do |table|
    -  # Checks that each request matches one of the event fields
    -  requests = Maze::Server.errors.remaining
    -  match_count = 0
    -
    -  # iterate through each row in the table. exactly 1 request should match each row.
    -  table.hashes.each do |row|
    -    requests.each do |request|
    -      # Skip if no body.events in this request
    -      next if (!request.key? :body) || (!request[:body].key? 'events')
    -
    -      events = request[:body]['events']
    -      Maze.check.equal(1, events.length, 'Expected exactly one event per request')
    -      match_count += 1 if Maze::Assertions::RequestSetAssertions.request_matches_row(events[0], row)
    -    end
    -  end
    -  Maze.check.equal(requests.size, match_count, 'Unexpected number of requests matched the received payloads')
    +            
    Then('the exception {string} matches the platform-dependent regex:') do |field_path, platform_regexes|
    +  match_string_platform_regexes('error', "events.0.exceptions.0.#{field_path}", platform_regexes)
     end
    @@ -25643,7 +26054,7 @@ diff --git a/requirements/tags.html b/requirements/tags.html index 86d3799fc..babe3f1f5 100644 --- a/requirements/tags.html +++ b/requirements/tags.html @@ -176,7 +176,7 @@ diff --git a/stepdefinition_list.html b/stepdefinition_list.html index 85378a150..6ffa6ac55 100644 --- a/stepdefinition_list.html +++ b/stepdefinition_list.html @@ -2549,119 +2549,15 @@

    Step Definitions List

    -
  • -
    - - Then - - 'the {request_type} payload field {string} equals the platform-dependent string:' -    - - lib/features/steps/app_automator_steps.rb:82 -
    -
  • - - -
  • -
    - - Then - - 'the event {string} equals the platform-dependent string:' -    - - lib/features/steps/app_automator_steps.rb:90 -
    -
  • - - -
  • -
    - - Then - - 'the {request_type} payload field {string} equals the platform-dependent numeric:' -    - - lib/features/steps/app_automator_steps.rb:109 -
    -
  • - - -
  • -
    - - Then - - 'the event {string} equals the platform-dependent numeric:' -    - - lib/features/steps/app_automator_steps.rb:117 -
    -
  • - - -
  • -
    - - Then - - 'the {request_type} payload field {string} equals the platform-dependent boolean:' -    - - lib/features/steps/app_automator_steps.rb:136 -
    -
  • - - -
  • -
    - - Then - - 'the event {string} equals the platform-dependent boolean:' -    - - lib/features/steps/app_automator_steps.rb:144 -
    -
  • - - -
  • -
    - - Then - - 'the exception {string} equals the platform-dependent string:' -    - - lib/features/steps/app_automator_steps.rb:152 -
    -
  • - - -
  • -
    - - Then - - 'the {string} of stack frame {int} equals the platform-dependent string:' -    - - lib/features/steps/app_automator_steps.rb:161 -
    -
  • - -
  • When - + 'I clear and send the keys {string} to the element {string}'    - lib/features/steps/app_automator_steps.rb:170 + lib/features/steps/app_automator_steps.rb:72
  • @@ -2670,7 +2566,7 @@

    Step Definitions List

    When - + 'I start the document server'    @@ -2683,7 +2579,7 @@

    Step Definitions List

    Then - + 'the error is valid for the error reporting API version {string} for the {string} notifier'    @@ -2696,7 +2592,7 @@

    Step Definitions List

    Then - 'the error is valid for the error reporting API version {string}' \ ' for the {string} notifier with the apiKey {string}' @@ -2711,7 +2607,7 @@

    Step Definitions List

    Then - + 'event {int} is unhandled'    @@ -2724,7 +2620,7 @@

    Step Definitions List

    Then - + 'event {int} is unhandled with the severity {string}'    @@ -2737,7 +2633,7 @@

    Step Definitions List

    Then - + 'event {int} is handled'    @@ -2750,7 +2646,7 @@

    Step Definitions List

    Then - + 'event {int} is handled with the severity {string}'    @@ -2763,7 +2659,7 @@

    Step Definitions List

    Then - + 'the error payload contains the payloadVersion {string}'    @@ -2776,7 +2672,7 @@

    Step Definitions List

    Then - + /^the event "(.+)" is (true|false|null|not null)$/    @@ -2789,7 +2685,7 @@

    Step Definitions List

    Then - + 'the event {string} equals {string}'    @@ -2802,7 +2698,7 @@

    Step Definitions List

    Then - + 'the event {string} equals {float}'    @@ -2815,7 +2711,7 @@

    Step Definitions List

    Then - + 'the event {string} equals {float} to {int} decimal place(s)'    @@ -2828,7 +2724,7 @@

    Step Definitions List

    Then - + 'the event {string} equals {int}'    @@ -2841,7 +2737,7 @@

    Step Definitions List

    Then - + 'the event {string} starts with {string}'    @@ -2854,7 +2750,7 @@

    Step Definitions List

    Then - + 'the event {string} ends with {string}'    @@ -2867,7 +2763,7 @@

    Step Definitions List

    Then - + 'the event {string} matches {string}'    @@ -2880,7 +2776,7 @@

    Step Definitions List

    Then - + 'the event {string} is a timestamp'    @@ -2893,7 +2789,7 @@

    Step Definitions List

    Then - + 'the event {string} is a parsable timestamp in seconds'    @@ -2906,7 +2802,7 @@

    Step Definitions List

    Then - + 'the event {string} equals the environment variable {string}'    @@ -2919,7 +2815,7 @@

    Step Definitions List

    Then - + 'the event {string} matches the JSON fixture in {string}'    @@ -2932,7 +2828,7 @@

    Step Definitions List

    Then - + 'the event {string} string is empty'    @@ -2945,7 +2841,7 @@

    Step Definitions List

    Then - + 'the event {string} is greater than {int}'    @@ -2958,7 +2854,7 @@

    Step Definitions List

    Then - + 'the exception {string} starts with {string}'    @@ -2971,7 +2867,7 @@

    Step Definitions List

    Then - + 'the exception {string} ends with {string}'    @@ -2984,7 +2880,7 @@

    Step Definitions List

    Then - + 'the exception {string} equals {string}'    @@ -2997,7 +2893,7 @@

    Step Definitions List

    Then - + 'the exception {string} matches {string}'    @@ -3010,7 +2906,7 @@

    Step Definitions List

    Then - + 'the {string} of stack frame {int} equals {int}'    @@ -3023,7 +2919,7 @@

    Step Definitions List

    Then - + 'the {string} of stack frame {int} matches {string}'    @@ -3036,7 +2932,7 @@

    Step Definitions List

    Then - + 'the {string} of stack frame {int} equals {string}'    @@ -3049,7 +2945,7 @@

    Step Definitions List

    Then - + 'the {string} of stack frame {int} starts with {string}'    @@ -3062,7 +2958,7 @@

    Step Definitions List

    Then - + 'the {string} of stack frame {int} ends with {string}'    @@ -3075,7 +2971,7 @@

    Step Definitions List

    Then - + /^the "(.*)" of stack frame (\d*) is (true|false|null|not null)$/    @@ -3088,7 +2984,7 @@

    Step Definitions List

    Then - + 'the thread with name {string} contains the error reporting flag'    @@ -3101,7 +2997,7 @@

    Step Definitions List

    Then - + 'the thread with id {string} contains the error reporting flag'    @@ -3114,7 +3010,7 @@

    Step Definitions List

    Then - + 'the {request_type} {string} query parameter equals {string}'    @@ -3127,7 +3023,7 @@

    Step Definitions List

    Then - + 'the {request_type} {string} query parameter is not null'    @@ -3140,7 +3036,7 @@

    Step Definitions List

    Then - + 'the {request_type} {string} query parameter is a timestamp'    @@ -3153,7 +3049,7 @@

    Step Definitions List

    Then - + 'the session is valid for the session reporting API version {string} for the {string} notifier'    @@ -3166,7 +3062,7 @@

    Step Definitions List

    Then - + 'the session is valid for the session reporting API version {string} for the React Native notifier'    @@ -3179,7 +3075,7 @@

    Step Definitions List

    Then - + /^the session "(.+)" is (true|false|null|not null)$/    @@ -3192,7 +3088,7 @@

    Step Definitions List

    Then - + 'the session {string} equals {string}'    @@ -3205,7 +3101,7 @@

    Step Definitions List

    Then - + 'the session {string} is a timestamp'    @@ -3218,7 +3114,7 @@

    Step Definitions List

    Then - + /^the sessionCount "(.+)" is (true|false|null|not null)$/    @@ -3231,7 +3127,7 @@

    Step Definitions List

    Then - + 'the sessionCount {string} equals {string}'    @@ -3244,7 +3140,7 @@

    Step Definitions List

    Then - + 'the sessionCount {string} equals {int}'    @@ -3257,7 +3153,7 @@

    Step Definitions List

    Then - + 'the sessionCount {string} is a timestamp'    @@ -3270,7 +3166,7 @@

    Step Definitions List

    Then - + 'the session payload has a valid sessions array'    @@ -3283,7 +3179,7 @@

    Step Definitions List

    Then - + 'the {request_type} request is valid multipart form-data'    @@ -3296,7 +3192,7 @@

    Step Definitions List

    Then - + 'all {request_type} requests are valid multipart form-data'    @@ -3309,7 +3205,7 @@

    Step Definitions List

    Then - + 'the {request_type} multipart request has {int} fields'    @@ -3322,7 +3218,7 @@

    Step Definitions List

    Then - + 'the {request_type} multipart request has a non-empty body'    @@ -3335,7 +3231,7 @@

    Step Definitions List

    Then - + 'the {request_type} multipart body does not match the JSON file in {string}'    @@ -3348,7 +3244,7 @@

    Step Definitions List

    Then - + 'the {request_type} multipart body matches the JSON file in {string}'    @@ -3361,7 +3257,7 @@

    Step Definitions List

    Then - + 'the {request_type} multipart field {string} matches the JSON file in {string}'    @@ -3374,7 +3270,7 @@

    Step Definitions List

    Then - + 'the field {string} for multipart {request_type} is not null'    @@ -3387,7 +3283,7 @@

    Step Definitions List

    Then - + 'the field {string} for multipart {request_type} is null'    @@ -3400,7 +3296,7 @@

    Step Definitions List

    Then - + 'the field {string} for multipart {request_type} equals {string}'    @@ -3413,7 +3309,7 @@

    Step Definitions List

    Then - + 'I wait to receive a(n) {request_type}'    @@ -3426,7 +3322,7 @@

    Step Definitions List

    Then - + 'I wait to receive {int} {request_type}'    @@ -3439,7 +3335,7 @@

    Step Definitions List

    Then - + 'I wait to receive at least {int} {request_type}'    @@ -3452,7 +3348,7 @@

    Step Definitions List

    Then - + 'I sort the {request_type} by the payload field {string}'    @@ -3465,7 +3361,7 @@

    Step Definitions List

    Then - + 'I have received at least {int} {request_type}'    @@ -3478,7 +3374,7 @@

    Step Definitions List

    Then - + 'I wait to receive between {int} and {int} {request_type}'    @@ -3491,7 +3387,7 @@

    Step Definitions List

    Then - + 'I should receive no {request_type}'    @@ -3504,7 +3400,7 @@

    Step Definitions List

    Then - + 'I discard the oldest {request_type}'    @@ -3517,7 +3413,7 @@

    Step Definitions List

    Then - + 'the received errors match:'    @@ -3530,7 +3426,7 @@

    Step Definitions List

    Then - + 'the {request_type} request method equals {string}'    @@ -3539,6 +3435,162 @@

    Step Definitions List

    +
  • +
    + + Then + + 'the {request_type} payload field {string} equals the platform-dependent string:' +    + + lib/features/steps/platform_dependent_steps.rb:18 +
    +
  • + + +
  • +
    + + Then + + 'the event {string} equals the platform-dependent string:' +    + + lib/features/steps/platform_dependent_steps.rb:26 +
    +
  • + + +
  • +
    + + Then + + 'the {request_type} payload field {string} equals the platform-dependent numeric:' +    + + lib/features/steps/platform_dependent_steps.rb:45 +
    +
  • + + +
  • +
    + + Then + + 'the event {string} equals the platform-dependent numeric:' +    + + lib/features/steps/platform_dependent_steps.rb:53 +
    +
  • + + +
  • +
    + + Then + + 'the {request_type} payload field {string} equals the platform-dependent boolean:' +    + + lib/features/steps/platform_dependent_steps.rb:72 +
    +
  • + + +
  • +
    + + Then + + 'the event {string} equals the platform-dependent boolean:' +    + + lib/features/steps/platform_dependent_steps.rb:80 +
    +
  • + + +
  • +
    + + Then + + 'the exception {string} equals the platform-dependent string:' +    + + lib/features/steps/platform_dependent_steps.rb:88 +
    +
  • + + +
  • +
    + + Then + + 'the {string} of stack frame {int} equals the platform-dependent string:' +    + + lib/features/steps/platform_dependent_steps.rb:97 +
    +
  • + + +
  • +
    + + Then + + 'the {request_type} payload field {string} matches the platform-dependent regex:' +    + + lib/features/steps/platform_dependent_steps.rb:169 +
    +
  • + + +
  • +
    + + Then + + 'the event {string} matches the platform-dependent regex:' +    + + lib/features/steps/platform_dependent_steps.rb:177 +
    +
  • + + +
  • +
    + + Then + + 'the exception {string} matches the platform-dependent regex:' +    + + lib/features/steps/platform_dependent_steps.rb:183 +
    +
  • + + +
  • +
    + + Then + + 'the {string} of stack frame {int} matches the platform-dependent regex:' +    + + lib/features/steps/platform_dependent_steps.rb:190 +
    +
  • + +
    diff --git a/top-level-namespace.html b/top-level-namespace.html index b3f315dca..a05b1f85c 100644 --- a/top-level-namespace.html +++ b/top-level-namespace.html @@ -461,7 +461,7 @@

    - App Automator steps + Error reporting steps collapse

    @@ -470,7 +470,7 @@

  • - #assert_equal_with_nullability(expected_value, payload_value) ⇒ Object + #test_unhandled_state(event, unhandled, severity = nil) ⇒ Object @@ -484,7 +484,8 @@

    -
    +

    Tests whether an event has the correct attributes we'd expect for un/handled events.

    +

  • @@ -492,7 +493,7 @@

  • - #get_expected_platform_value(platform_values) ⇒ Object + #validate_error_reporting_thread(payload_key, payload_value) ⇒ Object @@ -506,15 +507,25 @@

    -
    +

    Tests that a thread from the first event, identified by a particular key-value pair, is the error reporting thread.

    +

  • + + +

    + Multipart request assertion steps + collapse +

    + + + +

    + Request assertion steps + collapse +

    + + + +

    + Platform dependent steps + collapse +

    + + - -

    - Error reporting steps - collapse -

    - - - -

    - Multipart request assertion steps - collapse -

    - - +
  • + + + #test_numeric_platform_values(request_type, field_path, platform_values) ⇒ Object + + + + + + + + + + -

    - Request assertion steps - collapse -

    -
  • -
    158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    +
    190
    +191
    +192
    -
    Then('the {request_type} request method equals {string}') do |request_type, method|
    -  list = Maze::Server.list_for(request_type)
    -  payload = list.current
    -  if payload[:method].nil?
    -    raise Test::Unit::AssertionFailedError.new("#{request_type} request had no receipt method listed")
    -  end
    -  Maze.check.equal(method, payload[:method], "Expected #{request_type} request method to be #{method}")
    +            
    Then('the {string} of stack frame {int} matches the platform-dependent regex:') do |field_path, num, platform_regexes|
    +  match_string_platform_regexes('error', "events.0.exceptions.0.stacktrace.#{num}.#{field_path}", platform_regexes)
     end
    -
    # File 'lib/features/steps/app_automator_steps.rb', line 225
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 143
     
     def assert_equal_with_nullability(expected_value, payload_value)
       case expected_value
    @@ -1421,16 +1445,16 @@ 

     
     
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    +154 +155 +156 +157 +158 +159 +160

    -
    # File 'lib/features/steps/app_automator_steps.rb', line 174
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 154
     
     def get_expected_platform_value(platform_values)
       os = Maze::Helper.get_current_platform
    @@ -1518,6 +1542,56 @@ 

    +
    + +
    +

    + + #match_string_platform_regexes(request_type, field_path, platform_values) ⇒ Object + + + + + +

    +
    +

    Regex match routines

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +
    +
    # File 'lib/features/steps/platform_dependent_steps.rb', line 197
    +
    +def match_string_platform_regexes(request_type, field_path, platform_values)
    +  expected_regex = get_expected_platform_value(platform_values)
    +  return if should_skip_platform_check(expected_regex)
    +  list = Maze::Server.list_for(request_type)
    +  payload_value = Maze::Helper.read_key_path(list.current[:body], field_path)
    +
    +  Maze.check.match(expected_regex, payload_value)
    +end
    +
    @@ -1724,12 +1798,12 @@

     
     
    -182
    -183
    -184
    +162 +163 +164 -
    # File 'lib/features/steps/app_automator_steps.rb', line 182
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 162
     
     def should_skip_platform_check(expected_value)
       expected_value.eql?('@skip')
    @@ -1792,25 +1866,25 @@ 

     
     
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128

    -
    # File 'lib/features/steps/app_automator_steps.rb', line 195
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 113
     
     def test_boolean_platform_values(request_type, field_path, platform_values)
       expected_value = get_expected_platform_value(platform_values)
    @@ -1848,21 +1922,21 @@ 

     
     
    -212
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
    +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141

    -
    # File 'lib/features/steps/app_automator_steps.rb', line 212
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 130
     
     def test_numeric_platform_values(request_type, field_path, platform_values)
       expected_value = get_expected_platform_value(platform_values)
    @@ -1890,23 +1964,33 @@ 

    -

    +
    +
    +

    Equality check routines

    + + +
    +
    +
    + + +
     
     
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    +104 +105 +106 +107 +108 +109 +110 +111
    -
    # File 'lib/features/steps/app_automator_steps.rb', line 186
    +      
    # File 'lib/features/steps/platform_dependent_steps.rb', line 104
     
     def test_string_platform_values(request_type, field_path, platform_values)
       expected_value = get_expected_platform_value(platform_values)
    @@ -2322,7 +2406,7 @@