diff --git a/Gemfile b/Gemfile index e20e035..12edf99 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem "bugsnag-maze-runner", "~> 9.0" \ No newline at end of file +gem "bugsnag-maze-runner", "~> 9.14" \ No newline at end of file diff --git a/features/net-http/appversion.feature b/features/net-http/appversion.feature index c2d10ad..95f3c52 100644 --- a/features/net-http/appversion.feature +++ b/features/net-http/appversion.feature @@ -11,7 +11,6 @@ Scenario: A error report contains the configured app type when using a net http And I open the URL "http://localhost:4512/handled" And I wait to receive an error And I should receive no sessions - And the error is valid for the error reporting API version "4" for the "Bugsnag Go" notifier And the event "app.version" equals "3.1.2" Scenario: A session report contains the configured app type when using a net http app @@ -21,5 +20,4 @@ Scenario: A session report contains the configured app type when using a net htt And I wait for the host "localhost" to open port "4512" And I open the URL "http://localhost:4512/session" And I wait to receive a session - And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier And the session payload field "app.version" equals "3.1.2" diff --git a/features/sessioncontext.feature b/features/sessioncontext.feature index 8cc09a1..a3af0b6 100644 --- a/features/sessioncontext.feature +++ b/features/sessioncontext.feature @@ -6,8 +6,5 @@ Scenario: An error report contains a session count when part of a session Then I wait to receive 1 error # one session is created on start And I wait to receive 2 session - And the error is valid for the error reporting API version "4" for the "Bugsnag Go" notifier - And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier And I discard the oldest session - And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier And the session payload has a valid sessions array \ No newline at end of file diff --git a/features/support/env.rb b/features/support/env.rb index d806b18..3235071 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -5,4 +5,25 @@ steps %( When I configure the base endpoint ) -end \ No newline at end of file +end + +Maze.config.add_validator('error') do |validator| + validator.validate_header('bugsnag-api-key') { |value| value.eql?($api_key) } + validator.validate_header('content-type') { |value| value.eql?('application/json') } + validator.validate_header('bugsnag-payload-version') { |value| value.eql?('4') } + validator.validate_header('bugsnag-sent-at') { |value| Date.iso8601(value) } + + validator.element_has_value('notifier.name', 'Bugsnag Go') + validator.each_element_exists(['notifier.url', 'notifier.version', 'events']) + validator.each_event_contains_each(['severity', 'severityReason.type', 'unhandled', 'exceptions']) +end + +Maze.config.add_validator('session') do |validator| + validator.validate_header('bugsnag-api-key') { |value| value.eql?($api_key) } + validator.validate_header('content-type') { |value| value.eql?('application/json') } + validator.validate_header('bugsnag-payload-version') { |value| value.eql?('1.0') } + validator.validate_header('bugsnag-sent-at') { |value| Date.iso8601(value) } + + validator.element_has_value('notifier.name', 'Bugsnag Go') + validator.each_element_exists(['notifier.url', 'notifier.version', 'app', 'device']) +end